PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/gist.h"
#include "access/nbtree.h"
#include "fmgr.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/sortsupport.h"
Go to the source code of this file.
Data Structures | |
struct | SortShimExtra |
Macros | |
#define | SizeForSortShimExtra(nargs) (offsetof(SortShimExtra, fcinfo) + SizeForFunctionCallInfo(nargs)) |
Functions | |
static int | comparison_shim (Datum x, Datum y, SortSupport ssup) |
void | PrepareSortSupportComparisonShim (Oid cmpFunc, SortSupport ssup) |
static void | FinishSortSupportFunction (Oid opfamily, Oid opcintype, SortSupport ssup) |
void | PrepareSortSupportFromOrderingOp (Oid orderingOp, SortSupport ssup) |
void | PrepareSortSupportFromIndexRel (Relation indexRel, int16 strategy, SortSupport ssup) |
void | PrepareSortSupportFromGistIndexRel (Relation indexRel, SortSupport ssup) |
#define SizeForSortShimExtra | ( | nargs | ) | (offsetof(SortShimExtra, fcinfo) + SizeForFunctionCallInfo(nargs)) |
Definition at line 33 of file sortsupport.c.
|
static |
Definition at line 43 of file sortsupport.c.
References FunctionCallInfoBaseData::args, elog, ERROR, SortShimExtra::fcinfo, SortShimExtra::flinfo, FmgrInfo::fn_oid, FunctionCallInvoke, FunctionCallInfoBaseData::isnull, SortSupportData::ssup_extra, NullableDatum::value, x, and y.
Referenced by PrepareSortSupportComparisonShim().
|
static |
Definition at line 94 of file sortsupport.c.
References BTORDER_PROC, BTSORTSUPPORT_PROC, SortSupportData::comparator, elog, ERROR, get_opfamily_proc(), OidFunctionCall1, OidIsValid, PointerGetDatum(), and PrepareSortSupportComparisonShim().
Referenced by PrepareSortSupportFromIndexRel(), and PrepareSortSupportFromOrderingOp().
void PrepareSortSupportComparisonShim | ( | Oid | cmpFunc, |
SortSupport | ssup | ||
) |
Definition at line 68 of file sortsupport.c.
References FunctionCallInfoBaseData::args, SortSupportData::comparator, comparison_shim(), SortShimExtra::fcinfo, SortShimExtra::flinfo, fmgr_info_cxt(), InitFunctionCallInfoData, NullableDatum::isnull, MemoryContextAlloc(), SizeForSortShimExtra, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, and SortSupportData::ssup_extra.
Referenced by FinishSortSupportFunction(), and MJExamineQuals().
void PrepareSortSupportFromGistIndexRel | ( | Relation | indexRel, |
SortSupport | ssup | ||
) |
Definition at line 188 of file sortsupport.c.
References Assert, SortSupportData::comparator, elog, ERROR, get_opfamily_proc(), GIST_SORTSUPPORT_PROC, OidFunctionCall1, OidIsValid, PointerGetDatum(), RelationData::rd_opcintype, RelationData::rd_opfamily, RelationData::rd_rel, SortSupportData::ssup_attno, and SortSupportData::ssup_reverse.
Referenced by tuplesort_begin_index_gist().
void PrepareSortSupportFromIndexRel | ( | Relation | indexRel, |
int16 | strategy, | ||
SortSupport | ssup | ||
) |
Definition at line 161 of file sortsupport.c.
References Assert, BTGreaterStrategyNumber, BTLessStrategyNumber, SortSupportData::comparator, elog, ERROR, FinishSortSupportFunction(), RelationData::rd_opcintype, RelationData::rd_opfamily, RelationData::rd_rel, SortSupportData::ssup_attno, and SortSupportData::ssup_reverse.
Referenced by _bt_load(), tuplesort_begin_cluster(), and tuplesort_begin_index_btree().
void PrepareSortSupportFromOrderingOp | ( | Oid | orderingOp, |
SortSupport | ssup | ||
) |
Definition at line 134 of file sortsupport.c.
References Assert, BTGreaterStrategyNumber, SortSupportData::comparator, elog, ERROR, FinishSortSupportFunction(), get_ordering_op_properties(), and SortSupportData::ssup_reverse.
Referenced by compute_scalar_stats(), ExecInitGatherMerge(), ExecInitIndexScan(), ExecInitMergeAppend(), multi_sort_add_dimension(), statext_mcv_serialize(), tuplesort_begin_datum(), and tuplesort_begin_heap().