|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/nbtree.h"#include "access/relscan.h"#include "common/int.h"#include "lib/qunique.h"#include "utils/array.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
| struct | BTScanKeyPreproc |
| struct | BTSortArrayContext |
Typedefs | |
| typedef struct BTScanKeyPreproc | BTScanKeyPreproc |
| typedef struct BTSortArrayContext | BTSortArrayContext |
Definition at line 2844 of file nbtpreprocesskeys.c.
References a, arg, b, BTSortArrayContext::collation, compare(), DatumGetInt32(), fb(), FunctionCall2Coll(), INVERT_COMPARE_RESULT, BTSortArrayContext::reverse, and BTSortArrayContext::sortproc.
Referenced by _bt_merge_arrays(), and _bt_sort_array_elements().
|
static |
Definition at line 1097 of file nbtpreprocesskeys.c.
References _bt_saoparray_shrink(), _bt_skiparray_shrink(), Assert, BTEqualStrategyNumber, fb(), BTArrayKeyInfo::num_elems, SK_ISNULL, SK_ROW_HEADER, SK_ROW_MEMBER, and SK_SEARCHARRAY.
Referenced by _bt_compare_scankey_args().
|
static |
Definition at line 870 of file nbtpreprocesskeys.c.
References _bt_compare_array_scankey_args(), Assert, BTCommuteStrategyNumber, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, DatumGetBool(), elog, ERROR, fb(), FunctionCall2Coll(), get_opcode(), get_opfamily_member(), IndexScanDescData::indexRelation, InvalidOid, BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, OidFunctionCall2Coll(), OidIsValid, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, SK_BT_DESC, SK_BT_NULLS_FIRST, SK_BT_SKIP, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, SK_ISNULL, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHARRAY, SK_SEARCHNOTNULL, SK_SEARCHNULL, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.
Referenced by _bt_preprocess_keys(), and _bt_skiparray_shrink().
|
static |
Definition at line 2579 of file nbtpreprocesskeys.c.
References Assert, BTEqualStrategyNumber, DatumGetBool(), elog, ERROR, fb(), fmgr_info(), FunctionCall2Coll(), get_opcode(), get_opfamily_member(), i, IndexScanDescData::indexRelation, OidIsValid, RelationData::rd_opfamily, and RegProcedureIsValid.
Referenced by _bt_preprocess_array_keys().
Definition at line 668 of file nbtpreprocesskeys.c.
References Assert, BTCommuteStrategyNumber, BTEqualStrategyNumber, BTGreaterStrategyNumber, BTLessStrategyNumber, DatumGetPointer(), fb(), InvalidOid, SK_BT_DESC, SK_BT_INDOPTION_SHIFT, SK_BT_NULLS_FIRST, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNOTNULL, and SK_SEARCHNULL.
Referenced by _bt_preprocess_keys().
Definition at line 780 of file nbtpreprocesskeys.c.
References Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, DatumGetPointer(), elog, ERROR, fb(), ScanKeyData::sk_attno, SK_BT_REQBKWD, SK_BT_REQFWD, SK_ROW_END, SK_ROW_HEADER, and SK_ROW_MEMBER.
Referenced by _bt_preprocess_keys().
|
static |
Definition at line 2776 of file nbtpreprocesskeys.c.
References _bt_compare_array_elements(), Assert, BTEqualStrategyNumber, BTORDER_PROC, BTSortArrayContext::collation, fb(), fmgr_info_cxt(), get_opfamily_proc(), i, IndexScanDescData::indexRelation, j, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opfamily, RegProcedureIsValid, BTSortArrayContext::reverse, and BTSortArrayContext::sortproc.
Referenced by _bt_preprocess_array_keys().
|
static |
Definition at line 2413 of file nbtpreprocesskeys.c.
References Assert, BTEqualStrategyNumber, fb(), get_opfamily_member(), i, IndexScanDescData::indexRelation, InvalidOid, IndexScanDescData::keyData, IndexScanDescData::numberOfKeys, OidIsValid, RelationData::rd_opcintype, RelationData::rd_opfamily, ScanKeyData::sk_attno, ScanKeyData::sk_flags, SK_ROW_HEADER, SK_SEARCHARRAY, SK_SEARCHNULL, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_array_keys().
|
static |
Definition at line 1845 of file nbtpreprocesskeys.c.
References _bt_find_extreme_element(), _bt_merge_arrays(), _bt_num_array_keys(), _bt_setup_array_cmp(), _bt_sort_array_elements(), ALLOCSET_SMALL_SIZES, AllocSetContextCreate, ARR_ELEMTYPE, Assert, CompactAttribute::attbyval, CompactAttribute::attlen, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, cur, CurrentMemoryContext, DatumGetArrayTypeP, deconstruct_array(), elog, ERROR, fb(), get_opcode(), get_typlenbyvalalign(), INDEX_MAX_KEYS, IndexScanDescData::indexRelation, InvalidAttrNumber, InvalidOid, j, IndexScanDescData::keyData, MemoryContextReset(), MemoryContextSwitchTo(), IndexScanDescData::numberOfKeys, OidIsValid, IndexScanDescData::opaque, palloc(), pfree(), PrepareSkipSupportFromOpclass(), RelationData::rd_indcollation, RelationData::rd_indoption, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, RelationGetDescr, ScanKeyEntryInitialize(), ScanKeyData::sk_attno, SK_BT_SKIP, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_HEADER, SK_SEARCHARRAY, SK_SEARCHNOTNULL, SK_SEARCHNULL, ScanKeyData::sk_strategy, and TupleDescCompactAttr().
Referenced by _bt_preprocess_keys().
|
static |
Definition at line 2225 of file nbtpreprocesskeys.c.
References _bt_setup_array_cmp(), _bt_skiparray_strat_adjust(), Assert, BTEqualStrategyNumber, BTArrayKeyInfo::elem_values, ereport, errcode(), errmsg_internal(), ERROR, fb(), INDEX_MAX_KEYS, IndexScanDescData::indexRelation, IndexRelationGetNumberOfKeyAttributes, InvalidOid, InvalidStrategy, BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, IndexScanDescData::opaque, IndexScanDescData::parallel_scan, PG_USED_FOR_ASSERTS_ONLY, RelationData::rd_opcintype, BTArrayKeyInfo::scan_key, SK_BT_REQFWD, SK_SEARCHARRAY, SK_SEARCHNULL, and BTArrayKeyInfo::sksup.
Referenced by _bt_preprocess_keys().
| void _bt_preprocess_keys | ( | IndexScanDesc | scan | ) |
Definition at line 203 of file nbtpreprocesskeys.c.
References _bt_compare_scankey_args(), _bt_fix_scankey_strategy(), _bt_mark_scankey_required(), _bt_preprocess_array_keys(), _bt_preprocess_array_keys_final(), _bt_unmark_keys(), Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTMaxStrategyNumber, elog, ERROR, fb(), i, IndexScanDescData::indexRelation, j, IndexScanDescData::keyData, MemoryContextAlloc(), IndexScanDescData::numberOfKeys, OidIsValid, IndexScanDescData::opaque, RelationData::rd_indoption, repalloc(), BTArrayKeyInfo::scan_key, ScanKeyData::sk_attno, SK_BT_SKIP, ScanKeyData::sk_flags, SK_SEARCHARRAY, SK_SEARCHNULL, ScanKeyData::sk_strategy, and unlikely.
Referenced by _bt_first().
Definition at line 1793 of file nbtpreprocesskeys.c.
References a, b, fb(), and pg_cmp_s32().
Referenced by _bt_unmark_keys().
|
static |
Definition at line 1135 of file nbtpreprocesskeys.c.
References _bt_binsrch_array_skey(), Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTORDER_PROC, BTArrayKeyInfo::elem_values, elog, ERROR, fb(), fmgr_info(), get_opfamily_proc(), IndexScanDescData::indexRelation, InvalidOid, NoMovementScanDirection, BTArrayKeyInfo::num_elems, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, and SK_BT_SKIP.
Referenced by _bt_compare_array_scankey_args().
|
static |
Definition at line 2652 of file nbtpreprocesskeys.c.
References Assert, BTEqualStrategyNumber, BTORDER_PROC, elog, ERROR, fb(), fmgr_info_cxt(), get_opfamily_proc(), index_getprocinfo(), IndexScanDescData::indexRelation, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, and RelationGetRelationName.
Referenced by _bt_preprocess_array_keys(), and _bt_preprocess_array_keys_final().
|
static |
Definition at line 1260 of file nbtpreprocesskeys.c.
References _bt_compare_scankey_args(), Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, elog, ERROR, fb(), BTArrayKeyInfo::high_compare, BTArrayKeyInfo::low_compare, BTArrayKeyInfo::null_elem, and BTArrayKeyInfo::num_elems.
Referenced by _bt_compare_array_scankey_args().
|
static |
Definition at line 1382 of file nbtpreprocesskeys.c.
References _bt_skiparray_strat_decrement(), _bt_skiparray_strat_increment(), Assert, BTGreaterStrategyNumber, BTLessStrategyNumber, fb(), BTArrayKeyInfo::high_compare, BTArrayKeyInfo::low_compare, MemoryContextSwitchTo(), BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, IndexScanDescData::opaque, SK_BT_SKIP, ScanKeyData::sk_strategy, and BTArrayKeyInfo::sksup.
Referenced by _bt_preprocess_array_keys_final().
|
static |
Definition at line 1412 of file nbtpreprocesskeys.c.
References Assert, BTGreaterEqualStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, SkipSupportData::decrement, fb(), fmgr_info(), get_opcode(), get_opfamily_member(), BTArrayKeyInfo::high_compare, IndexScanDescData::indexRelation, InvalidOid, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, SK_BT_DESC, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, and BTArrayKeyInfo::sksup.
Referenced by _bt_skiparray_strat_adjust().
|
static |
Definition at line 1470 of file nbtpreprocesskeys.c.
References Assert, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, fb(), fmgr_info(), get_opcode(), get_opfamily_member(), SkipSupportData::increment, IndexScanDescData::indexRelation, InvalidOid, BTArrayKeyInfo::low_compare, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, SK_BT_DESC, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, and BTArrayKeyInfo::sksup.
Referenced by _bt_skiparray_strat_adjust().
|
static |
Definition at line 2732 of file nbtpreprocesskeys.c.
References _bt_compare_array_elements(), BTSortArrayContext::collation, fb(), qsort_arg(), qunique_arg(), BTSortArrayContext::reverse, and BTSortArrayContext::sortproc.
Referenced by _bt_preprocess_array_keys().
|
static |
Definition at line 1543 of file nbtpreprocesskeys.c.
References _bt_reorder_array_cmp(), Assert, BTEqualStrategyNumber, DatumGetPointer(), fb(), i, j, IndexScanDescData::opaque, palloc(), palloc0(), pfree(), qsort, BTArrayKeyInfo::scan_key, ScanKeyData::sk_attno, SK_BT_REQBKWD, SK_BT_REQFWD, SK_BT_SKIP, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, and SK_SEARCHNULL.
Referenced by _bt_preprocess_keys().