PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/brin_tuple.h"
#include "access/hash.h"
#include "access/htup_details.h"
#include "access/nbtree.h"
#include "catalog/index.h"
#include "executor/executor.h"
#include "pg_trace.h"
#include "utils/datum.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
#include "utils/tuplesort.h"
Go to the source code of this file.
Data Structures | |
struct | TuplesortClusterArg |
struct | TuplesortIndexArg |
struct | TuplesortIndexBTreeArg |
struct | TuplesortIndexHashArg |
struct | TuplesortDatumArg |
struct | BrinSortTuple |
Macros | |
#define | HEAP_SORT 0 |
#define | INDEX_SORT 1 |
#define | DATUM_SORT 2 |
#define | CLUSTER_SORT 3 |
#define | BRINSORTTUPLE_SIZE(len) (offsetof(BrinSortTuple, tuple) + (len)) |
Typedefs | |
typedef struct BrinSortTuple | BrinSortTuple |
#define BRINSORTTUPLE_SIZE | ( | len | ) | (offsetof(BrinSortTuple, tuple) + (len)) |
Definition at line 164 of file tuplesortvariants.c.
#define CLUSTER_SORT 3 |
Definition at line 39 of file tuplesortvariants.c.
#define DATUM_SORT 2 |
Definition at line 38 of file tuplesortvariants.c.
#define HEAP_SORT 0 |
Definition at line 36 of file tuplesortvariants.c.
#define INDEX_SORT 1 |
Definition at line 37 of file tuplesortvariants.c.
typedef struct BrinSortTuple BrinSortTuple |
|
static |
Definition at line 1213 of file tuplesortvariants.c.
References a, ApplySortComparator(), b, compare(), comparetup_cluster_tiebreak(), TuplesortPublic::haveDatum1, TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_cluster().
|
static |
Definition at line 1234 of file tuplesortvariants.c.
References a, ApplySortAbbrevFullComparator(), ApplySortComparator(), arg, TuplesortPublic::arg, b, compare(), ExecStoreHeapTuple(), FormIndexDatum(), GetPerTupleExprContext, TuplesortPublic::haveDatum1, heap_getattr(), if(), INDEX_MAX_KEYS, TuplesortPublic::nKeys, ResetPerTupleExprContext, TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by comparetup_cluster(), and tuplesort_begin_cluster().
|
static |
Definition at line 1780 of file tuplesortvariants.c.
References a, ApplySortComparator(), b, compare(), comparetup_datum_tiebreak(), TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_datum().
|
static |
Definition at line 1795 of file tuplesortvariants.c.
References a, SortSupportData::abbrev_converter, ApplySortAbbrevFullComparator(), b, compare(), PointerGetDatum(), TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by comparetup_datum(), and tuplesort_begin_datum().
|
static |
Definition at line 1071 of file tuplesortvariants.c.
References a, ApplySortComparator(), b, compare(), comparetup_heap_tiebreak(), TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_heap().
|
static |
Definition at line 1090 of file tuplesortvariants.c.
References a, SortSupportData::abbrev_converter, ApplySortAbbrevFullComparator(), ApplySortComparator(), TuplesortPublic::arg, b, compare(), heap_getattr(), if(), MINIMAL_TUPLE_OFFSET, TuplesortPublic::nKeys, TuplesortPublic::sortKeys, SortSupportData::ssup_attno, HeapTupleData::t_data, HeapTupleData::t_len, and TuplesortstateGetPublic.
Referenced by comparetup_heap(), and tuplesort_begin_heap().
|
static |
Definition at line 1711 of file tuplesortvariants.c.
References a, Assert, b, DatumGetUInt32(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_brin().
|
static |
Definition at line 1428 of file tuplesortvariants.c.
References a, ApplySortComparator(), b, compare(), comparetup_index_btree_tiebreak(), TuplesortPublic::sortKeys, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_btree(), and tuplesort_begin_index_gist().
|
static |
Definition at line 1452 of file tuplesortvariants.c.
References a, ApplySortAbbrevFullComparator(), ApplySortComparator(), arg, TuplesortPublic::arg, Assert, b, BuildIndexValueDescription(), compare(), ereport, errcode(), errdetail(), errmsg(), ERROR, errtableconstraint(), index_deform_tuple(), index_getattr(), INDEX_MAX_KEYS, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), TuplesortPublic::nKeys, RelationGetDescr, RelationGetRelationName, TuplesortPublic::sortKeys, TuplesortstateGetPublic, and values.
Referenced by comparetup_index_btree(), tuplesort_begin_index_btree(), and tuplesort_begin_index_gist().
|
static |
Definition at line 1574 of file tuplesortvariants.c.
References _hash_hashkey2bucket(), a, arg, TuplesortPublic::arg, Assert, b, DatumGetUInt32(), ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), IndexTupleData::t_tid, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_hash().
|
static |
Definition at line 1650 of file tuplesortvariants.c.
References Assert.
Referenced by tuplesort_begin_index_hash().
|
static |
Definition at line 1385 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, ExprContext::ecxt_scantuple, ExecDropSingleTupleTableSlot(), FreeExecutorState(), GetPerTupleExprContext, if(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_cluster().
|
static |
Definition at line 1356 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, SortTuple::datum1, TuplesortPublic::haveDatum1, heap_getattr(), HEAPTUPLESIZE, InvalidOid, SortTuple::isnull1, LogicalTapeReadExact, TuplesortPublic::sortopt, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, SortTuple::tuple, TUPLESORT_RANDOMACCESS, tuplesort_readtup_alloc(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_cluster().
|
static |
Definition at line 1844 of file tuplesortvariants.c.
References Assert, SortTuple::datum1, SortTuple::isnull1, len, LogicalTapeReadExact, PointerGetDatum(), TuplesortPublic::sortopt, SortTuple::tuple, TuplesortPublic::tuples, TUPLESORT_RANDOMACCESS, tuplesort_readtup_alloc(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_datum().
|
static |
Definition at line 1163 of file tuplesortvariants.c.
References TuplesortPublic::arg, SortTuple::datum1, heap_getattr(), SortTuple::isnull1, len, LogicalTapeReadExact, MINIMAL_TUPLE_DATA_OFFSET, MINIMAL_TUPLE_OFFSET, TuplesortPublic::sortKeys, TuplesortPublic::sortopt, SortSupportData::ssup_attno, HeapTupleData::t_data, HeapTupleData::t_len, MinimalTupleData::t_len, SortTuple::tuple, TUPLESORT_RANDOMACCESS, tuplesort_readtup_alloc(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_heap().
|
static |
Definition at line 1673 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, SortTuple::datum1, index_getattr(), SortTuple::isnull1, len, LogicalTapeReadExact, RelationGetDescr, TuplesortPublic::sortopt, SortTuple::tuple, TUPLESORT_RANDOMACCESS, tuplesort_readtup_alloc(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_btree(), tuplesort_begin_index_gist(), and tuplesort_begin_index_hash().
|
static |
Definition at line 1741 of file tuplesortvariants.c.
References BRINSORTTUPLE_SIZE, BrinTuple::bt_blkno, SortTuple::datum1, len, LogicalTapeReadExact, TuplesortPublic::sortopt, BrinSortTuple::tuple, SortTuple::tuple, BrinSortTuple::tuplen, TUPLESORT_RANDOMACCESS, tuplesort_readtup_alloc(), and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_brin().
|
static |
Definition at line 1194 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, SortTuple::datum1, for(), heap_getattr(), i, SortTuple::isnull1, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_cluster().
|
static |
Definition at line 1771 of file tuplesortvariants.c.
References i, and PointerGetDatum().
Referenced by tuplesort_begin_datum().
|
static |
Definition at line 1050 of file tuplesortvariants.c.
References TuplesortPublic::arg, SortTuple::datum1, heap_getattr(), i, SortTuple::isnull1, MINIMAL_TUPLE_OFFSET, TuplesortPublic::sortKeys, SortSupportData::ssup_attno, HeapTupleData::t_data, HeapTupleData::t_len, SortTuple::tuple, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_heap().
|
static |
Definition at line 1409 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, SortTuple::datum1, for(), i, index_getattr(), SortTuple::isnull1, RelationGetDescr, SortTuple::tuple, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_btree(), tuplesort_begin_index_gist(), and tuplesort_begin_index_hash().
|
static |
Definition at line 1697 of file tuplesortvariants.c.
References BrinTuple::bt_blkno, SortTuple::datum1, i, BrinSortTuple::tuple, and SortTuple::tuple.
Referenced by tuplesort_begin_index_brin().
Tuplesortstate * tuplesort_begin_cluster | ( | TupleDesc | tupDesc, |
Relation | indexRel, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 241 of file tuplesortvariants.c.
References _bt_mkscankey(), SortSupportData::abbreviate, arg, TuplesortPublic::arg, Assert, BTGreaterStrategyNumber, BTLessStrategyNumber, BuildIndexInfo(), CLUSTER_SORT, TuplesortPublic::comparetup, comparetup_cluster(), comparetup_cluster_tiebreak(), TuplesortPublic::comparetup_tiebreak, CreateExecutorState(), CurrentMemoryContext, ExprContext::ecxt_scantuple, elog, TuplesortPublic::freestate, freestate_cluster(), GetPerTupleExprContext, TuplesortPublic::haveDatum1, i, IndexRelationGetNumberOfKeyAttributes, LOG, TuplesortPublic::maincontext, MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), TuplesortPublic::nKeys, palloc0(), PARALLEL_SORT, pfree(), PrepareSortSupportFromIndexRel(), RelationData::rd_rel, TuplesortPublic::readtup, readtup_cluster(), RelationGetNumberOfAttributes, TuplesortPublic::removeabbrev, removeabbrev_cluster(), BTScanInsertData::scankeys, ScanKeyData::sk_attno, SK_BT_DESC, SK_BT_NULLS_FIRST, ScanKeyData::sk_collation, ScanKeyData::sk_flags, TuplesortPublic::sortKeys, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, trace_sort, TTSOpsHeapTuple, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_cluster().
Referenced by heapam_relation_copy_for_cluster().
Tuplesortstate * tuplesort_begin_datum | ( | Oid | datumType, |
Oid | sortOperator, | ||
Oid | sortCollation, | ||
bool | nullsFirstFlag, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 572 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, SortSupportData::abbreviate, arg, TuplesortPublic::arg, TuplesortPublic::comparetup, comparetup_datum(), comparetup_datum_tiebreak(), TuplesortPublic::comparetup_tiebreak, CurrentMemoryContext, DATUM_SORT, elog, get_typlenbyval(), TuplesortPublic::haveDatum1, LOG, TuplesortPublic::maincontext, MemoryContextSwitchTo(), TuplesortPublic::nKeys, TuplesortPublic::onlyKey, palloc(), palloc0(), PARALLEL_SORT, PrepareSortSupportFromOrderingOp(), TuplesortPublic::readtup, readtup_datum(), TuplesortPublic::removeabbrev, removeabbrev_datum(), TuplesortPublic::sortKeys, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, trace_sort, TuplesortPublic::tuples, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_datum().
Referenced by ExecSort(), initialize_aggregate(), ordered_set_startup(), and validate_index().
Tuplesortstate * tuplesort_begin_heap | ( | TupleDesc | tupDesc, |
int | nkeys, | ||
AttrNumber * | attNums, | ||
Oid * | sortOperators, | ||
Oid * | sortCollations, | ||
bool * | nullsFirstFlags, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 168 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, SortSupportData::abbreviate, TuplesortPublic::arg, Assert, TuplesortPublic::comparetup, comparetup_heap(), comparetup_heap_tiebreak(), TuplesortPublic::comparetup_tiebreak, CurrentMemoryContext, elog, TuplesortPublic::haveDatum1, HEAP_SORT, i, LOG, TuplesortPublic::maincontext, MemoryContextSwitchTo(), TuplesortPublic::nKeys, TuplesortPublic::onlyKey, palloc0(), PARALLEL_SORT, PrepareSortSupportFromOrderingOp(), TuplesortPublic::readtup, readtup_heap(), TuplesortPublic::removeabbrev, removeabbrev_heap(), TuplesortPublic::sortKeys, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, trace_sort, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_heap().
Referenced by ExecIncrementalSort(), ExecSort(), initialize_aggregate(), initialize_phase(), ordered_set_startup(), and switchToPresortedPrefixMode().
Tuplesortstate * tuplesort_begin_index_brin | ( | int | workMem, |
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 545 of file tuplesortvariants.c.
References TuplesortPublic::arg, TuplesortPublic::comparetup, comparetup_index_brin(), elog, TuplesortPublic::haveDatum1, LOG, TuplesortPublic::nKeys, TuplesortPublic::readtup, readtup_index_brin(), TuplesortPublic::removeabbrev, removeabbrev_index_brin(), trace_sort, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_index_brin().
Referenced by _brin_parallel_scan_and_build(), and brinbuild().
Tuplesortstate * tuplesort_begin_index_btree | ( | Relation | heapRel, |
Relation | indexRel, | ||
bool | enforceUnique, | ||
bool | uniqueNullsNotDistinct, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 348 of file tuplesortvariants.c.
References _bt_mkscankey(), SortSupportData::abbreviate, arg, TuplesortPublic::arg, Assert, BTGreaterStrategyNumber, BTLessStrategyNumber, TuplesortPublic::comparetup, comparetup_index_btree(), comparetup_index_btree_tiebreak(), TuplesortPublic::comparetup_tiebreak, CurrentMemoryContext, elog, TuplesortPublic::haveDatum1, i, INDEX_SORT, IndexRelationGetNumberOfKeyAttributes, LOG, TuplesortPublic::maincontext, MemoryContextSwitchTo(), TuplesortPublic::nKeys, palloc(), palloc0(), PARALLEL_SORT, pfree(), PrepareSortSupportFromIndexRel(), TuplesortPublic::readtup, readtup_index(), TuplesortPublic::removeabbrev, removeabbrev_index(), BTScanInsertData::scankeys, ScanKeyData::sk_attno, SK_BT_DESC, SK_BT_NULLS_FIRST, ScanKeyData::sk_collation, ScanKeyData::sk_flags, TuplesortPublic::sortKeys, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, trace_sort, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_index().
Referenced by _bt_parallel_scan_and_sort(), and _bt_spools_heapscan().
Tuplesortstate * tuplesort_begin_index_gist | ( | Relation | heapRel, |
Relation | indexRel, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 482 of file tuplesortvariants.c.
References SortSupportData::abbreviate, arg, TuplesortPublic::arg, Assert, TuplesortPublic::comparetup, comparetup_index_btree(), comparetup_index_btree_tiebreak(), TuplesortPublic::comparetup_tiebreak, CurrentMemoryContext, elog, TuplesortPublic::haveDatum1, i, IndexRelationGetNumberOfKeyAttributes, LOG, TuplesortPublic::maincontext, MemoryContextSwitchTo(), TuplesortPublic::nKeys, palloc(), palloc0(), PrepareSortSupportFromGistIndexRel(), RelationData::rd_indcollation, TuplesortPublic::readtup, readtup_index(), TuplesortPublic::removeabbrev, removeabbrev_index(), TuplesortPublic::sortKeys, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, trace_sort, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_index().
Referenced by gistbuild().
Tuplesortstate * tuplesort_begin_index_hash | ( | Relation | heapRel, |
Relation | indexRel, | ||
uint32 | high_mask, | ||
uint32 | low_mask, | ||
uint32 | max_buckets, | ||
int | workMem, | ||
SortCoordinate | coordinate, | ||
int | sortopt | ||
) |
Definition at line 431 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, TuplesortPublic::comparetup, comparetup_index_hash(), comparetup_index_hash_tiebreak(), TuplesortPublic::comparetup_tiebreak, elog, TuplesortPublic::haveDatum1, LOG, TuplesortPublic::maincontext, MemoryContextSwitchTo(), TuplesortPublic::nKeys, palloc(), TuplesortPublic::readtup, readtup_index(), TuplesortPublic::removeabbrev, removeabbrev_index(), trace_sort, tuplesort_begin_common(), TUPLESORT_RANDOMACCESS, TuplesortstateGetPublic, TuplesortPublic::writetup, and writetup_index().
Referenced by _h_spoolinit().
BrinTuple * tuplesort_getbrintuple | ( | Tuplesortstate * | state, |
Size * | len, | ||
bool | forward | ||
) |
Definition at line 956 of file tuplesortvariants.c.
References len, MemoryContextSwitchTo(), TuplesortPublic::sortcontext, BrinSortTuple::tuple, SortTuple::tuple, BrinSortTuple::tuplen, tuplesort_gettuple_common(), and TuplesortstateGetPublic.
Referenced by _brin_parallel_merge().
bool tuplesort_getdatum | ( | Tuplesortstate * | state, |
bool | forward, | ||
bool | copy, | ||
Datum * | val, | ||
bool * | isNull, | ||
Datum * | abbrev | ||
) |
Definition at line 1004 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, arg, TuplesortPublic::arg, datumCopy(), if(), MemoryContextSwitchTo(), PointerGetDatum(), TuplesortPublic::sortcontext, TuplesortPublic::sortKeys, TuplesortPublic::tuples, tuplesort_gettuple_common(), TuplesortstateGetPublic, and val.
Referenced by ExecSort(), heapam_index_validate_scan(), mode_final(), percentile_cont_final_common(), percentile_cont_multi_final_common(), percentile_disc_final(), percentile_disc_multi_final(), and process_ordered_aggregate_single().
HeapTuple tuplesort_getheaptuple | ( | Tuplesortstate * | state, |
bool | forward | ||
) |
Definition at line 914 of file tuplesortvariants.c.
References MemoryContextSwitchTo(), TuplesortPublic::sortcontext, SortTuple::tuple, tuplesort_gettuple_common(), and TuplesortstateGetPublic.
Referenced by heapam_relation_copy_for_cluster().
IndexTuple tuplesort_getindextuple | ( | Tuplesortstate * | state, |
bool | forward | ||
) |
Definition at line 935 of file tuplesortvariants.c.
References MemoryContextSwitchTo(), TuplesortPublic::sortcontext, SortTuple::tuple, tuplesort_gettuple_common(), and TuplesortstateGetPublic.
Referenced by _bt_load(), _h_indexbuild(), and gist_indexsortbuild().
bool tuplesort_gettupleslot | ( | Tuplesortstate * | state, |
bool | forward, | ||
bool | copy, | ||
TupleTableSlot * | slot, | ||
Datum * | abbrev | ||
) |
Definition at line 876 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, SortTuple::datum1, ExecClearTuple(), ExecStoreMinimalTuple(), heap_copy_minimal_tuple(), MemoryContextSwitchTo(), TuplesortPublic::sortcontext, TuplesortPublic::sortKeys, SortTuple::tuple, tuplesort_gettuple_common(), and TuplesortstateGetPublic.
Referenced by ExecIncrementalSort(), ExecSort(), fetch_input_tuple(), hypothetical_dense_rank_final(), hypothetical_rank_common(), process_ordered_aggregate_multi(), and switchToPresortedPrefixMode().
void tuplesort_putbrintuple | ( | Tuplesortstate * | state, |
BrinTuple * | tuple, | ||
Size | size | ||
) |
Definition at line 774 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, BRINSORTTUPLE_SIZE, BrinTuple::bt_blkno, SortTuple::datum1, GetMemoryChunkSpace(), SortTuple::isnull1, MAXALIGN, MemoryContextSwitchTo(), palloc(), size, TuplesortPublic::sortKeys, TuplesortPublic::sortopt, BrinSortTuple::tuple, SortTuple::tuple, TuplesortPublic::tuplecontext, BrinSortTuple::tuplen, tuplesort_puttuple_common(), TuplesortstateGetPublic, and TupleSortUseBumpTupleCxt.
Referenced by form_and_spill_tuple().
void tuplesort_putdatum | ( | Tuplesortstate * | state, |
Datum | val, | ||
bool | isNull | ||
) |
Definition at line 812 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, arg, TuplesortPublic::arg, datumCopy(), DatumGetPointer(), if(), MemoryContextSwitchTo(), TuplesortPublic::sortKeys, TuplesortPublic::tuplecontext, TuplesortPublic::tuples, tuplesort_puttuple_common(), TuplesortstateGetPublic, and val.
Referenced by ExecEvalAggOrderedTransDatum(), ExecSort(), ordered_set_transition(), and validate_index_callback().
void tuplesort_putheaptuple | ( | Tuplesortstate * | state, |
HeapTuple | tup | ||
) |
Definition at line 695 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, arg, TuplesortPublic::arg, SortTuple::datum1, GetMemoryChunkSpace(), TuplesortPublic::haveDatum1, heap_copytuple(), heap_getattr(), HEAPTUPLESIZE, SortTuple::isnull1, MAXALIGN, MemoryContextSwitchTo(), TuplesortPublic::sortKeys, TuplesortPublic::sortopt, HeapTupleData::t_len, SortTuple::tuple, TuplesortPublic::tuplecontext, tuplesort_puttuple_common(), TuplesortstateGetPublic, and TupleSortUseBumpTupleCxt.
Referenced by heapam_relation_copy_for_cluster().
void tuplesort_putindextuplevalues | ( | Tuplesortstate * | state, |
Relation | rel, | ||
ItemPointer | self, | ||
const Datum * | values, | ||
const bool * | isnull | ||
) |
Definition at line 738 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, arg, TuplesortPublic::arg, SortTuple::datum1, GetMemoryChunkSpace(), index_form_tuple_context(), index_getattr(), INDEX_SIZE_MASK, SortTuple::isnull1, MAXALIGN, RelationGetDescr, TuplesortPublic::sortKeys, TuplesortPublic::sortopt, IndexTupleData::t_info, IndexTupleData::t_tid, SortTuple::tuple, TuplesortPublic::tuplecontext, tuplesort_puttuple_common(), TuplesortstateGetPublic, TupleSortUseBumpTupleCxt, and values.
Referenced by _bt_spool(), _h_spool(), and gistSortedBuildCallback().
void tuplesort_puttupleslot | ( | Tuplesortstate * | state, |
TupleTableSlot * | slot | ||
) |
Definition at line 655 of file tuplesortvariants.c.
References SortSupportData::abbrev_converter, TuplesortPublic::arg, ExecCopySlotMinimalTuple(), GetMemoryChunkSpace(), heap_getattr(), MAXALIGN, MemoryContextSwitchTo(), MINIMAL_TUPLE_OFFSET, TuplesortPublic::sortKeys, TuplesortPublic::sortopt, SortSupportData::ssup_attno, MinimalTupleData::t_len, TuplesortPublic::tuplecontext, tuplesort_puttuple_common(), TuplesortstateGetPublic, and TupleSortUseBumpTupleCxt.
Referenced by ExecEvalAggOrderedTransTuple(), ExecIncrementalSort(), ExecSort(), fetch_input_tuple(), hypothetical_dense_rank_final(), hypothetical_rank_common(), ordered_set_transition_multi(), and switchToPresortedPrefixMode().
|
static |
Definition at line 1341 of file tuplesortvariants.c.
References LogicalTapeWrite(), TuplesortPublic::sortopt, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, SortTuple::tuple, TUPLESORT_RANDOMACCESS, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_cluster().
|
static |
Definition at line 1810 of file tuplesortvariants.c.
References arg, TuplesortPublic::arg, Assert, SortTuple::datum1, datumGetSize(), if(), SortTuple::isnull1, LogicalTapeWrite(), PointerGetDatum(), TuplesortPublic::sortopt, SortTuple::tuple, TuplesortPublic::tuples, TUPLESORT_RANDOMACCESS, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_datum().
|
static |
Definition at line 1144 of file tuplesortvariants.c.
References LogicalTapeWrite(), MINIMAL_TUPLE_DATA_OFFSET, TuplesortPublic::sortopt, MinimalTupleData::t_len, SortTuple::tuple, TUPLESORT_RANDOMACCESS, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_heap().
|
static |
Definition at line 1659 of file tuplesortvariants.c.
References IndexTupleSize, LogicalTapeWrite(), TuplesortPublic::sortopt, SortTuple::tuple, TUPLESORT_RANDOMACCESS, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_btree(), tuplesort_begin_index_gist(), and tuplesort_begin_index_hash().
|
static |
Definition at line 1727 of file tuplesortvariants.c.
References LogicalTapeWrite(), TuplesortPublic::sortopt, BrinSortTuple::tuple, SortTuple::tuple, BrinSortTuple::tuplen, TUPLESORT_RANDOMACCESS, and TuplesortstateGetPublic.
Referenced by tuplesort_begin_index_brin().