#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.
Definition at line 2835 of file nbtpreprocesskeys.c.
References a, arg, b, BTSortArrayContext::collation, compare(), DatumGetInt32(), FunctionCall2Coll(), INVERT_COMPARE_RESULT, BTSortArrayContext::reverse, and BTSortArrayContext::sortproc.
Referenced by _bt_merge_arrays(), and _bt_sort_array_elements().
Definition at line 1088 of file nbtpreprocesskeys.c.
References _bt_saoparray_shrink(), _bt_skiparray_shrink(), Assert(), BTEqualStrategyNumber, BTArrayKeyInfo::num_elems, ScanKeyData::sk_attno, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHARRAY, and ScanKeyData::sk_strategy.
Referenced by _bt_compare_scankey_args().
Definition at line 861 of file nbtpreprocesskeys.c.
References _bt_compare_array_scankey_args(), Assert(), BTCommuteStrategyNumber, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, DatumGetBool(), elog, ERROR, FunctionCall2Coll(), get_opcode(), get_opfamily_member(), IndexScanDescData::indexRelation, InvalidOid, BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, OidFunctionCall2Coll(), OidIsValid, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, 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().
Definition at line 2570 of file nbtpreprocesskeys.c.
References Assert(), BTEqualStrategyNumber, DatumGetBool(), elog, ERROR, fmgr_info(), FunctionCall2Coll(), get_opcode(), get_opfamily_member(), i, IndexScanDescData::indexRelation, OidIsValid, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_attno, ScanKeyData::sk_collation, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_array_keys().
Definition at line 659 of file nbtpreprocesskeys.c.
References Assert(), BTCommuteStrategyNumber, BTEqualStrategyNumber, BTGreaterStrategyNumber, BTLessStrategyNumber, DatumGetPointer(), InvalidOid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_DESC, SK_BT_INDOPTION_SHIFT, SK_BT_NULLS_FIRST, ScanKeyData::sk_collation, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNOTNULL, SK_SEARCHNULL, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.
Referenced by _bt_preprocess_keys().
Definition at line 771 of file nbtpreprocesskeys.c.
References Assert(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, DatumGetPointer(), elog, ERROR, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_REQBKWD, SK_BT_REQFWD, ScanKeyData::sk_flags, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_keys().
Definition at line 2767 of file nbtpreprocesskeys.c.
References _bt_compare_array_elements(), BTScanOpaqueData::arrayContext, Assert(), BTEqualStrategyNumber, BTORDER_PROC, fmgr_info_cxt(), get_opfamily_proc(), i, IndexScanDescData::indexRelation, j, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_attno, ScanKeyData::sk_collation, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_array_keys().
Definition at line 2404 of file nbtpreprocesskeys.c.
References Assert(), BTEqualStrategyNumber, 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().
Definition at line 1836 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, BTScanOpaqueData::arrayContext, BTScanOpaqueData::arrayKeys, Assert(), BTArrayKeyInfo::attbyval, CompactAttribute::attbyval, BTArrayKeyInfo::attlen, CompactAttribute::attlen, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, cur, BTArrayKeyInfo::cur_elem, CurrentMemoryContext, DatumGetArrayTypeP, deconstruct_array(), BTArrayKeyInfo::elem_values, elog, ERROR, get_opcode(), get_typlenbyvalalign(), BTArrayKeyInfo::high_compare, INDEX_MAX_KEYS, IndexScanDescData::indexRelation, InvalidAttrNumber, InvalidOid, j, IndexScanDescData::keyData, BTArrayKeyInfo::low_compare, MemoryContextReset(), MemoryContextSwitchTo(), BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, BTScanOpaqueData::numArrayKeys, IndexScanDescData::numberOfKeys, OidIsValid, IndexScanDescData::opaque, BTScanOpaqueData::orderProcs, palloc(), pfree(), PrepareSkipSupportFromOpclass(), BTScanOpaqueData::qual_ok, RelationData::rd_indoption, RegProcedureIsValid, RelationGetDescr, BTArrayKeyInfo::scan_key, ScanKeyEntryInitialize(), ScanKeyData::sk_attno, SK_BT_SKIP, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_HEADER, SK_SEARCHARRAY, SK_SEARCHNOTNULL, SK_SEARCHNULL, ScanKeyData::sk_strategy, BTScanOpaqueData::skipScan, BTArrayKeyInfo::sksup, and TupleDescCompactAttr().
Referenced by _bt_preprocess_keys().
Definition at line 2216 of file nbtpreprocesskeys.c.
References _bt_setup_array_cmp(), _bt_skiparray_strat_adjust(), BTScanOpaqueData::arrayKeys, Assert(), BTEqualStrategyNumber, BTArrayKeyInfo::elem_values, ereport, errcode(), errmsg_internal(), ERROR, INDEX_MAX_KEYS, IndexScanDescData::indexRelation, IndexRelationGetNumberOfKeyAttributes, InvalidOid, InvalidStrategy, BTScanOpaqueData::keyData, BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, BTScanOpaqueData::numArrayKeys, BTScanOpaqueData::numberOfKeys, IndexScanDescData::opaque, BTScanOpaqueData::orderProcs, IndexScanDescData::parallel_scan, PG_USED_FOR_ASSERTS_ONLY, BTScanOpaqueData::qual_ok, BTArrayKeyInfo::scan_key, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_REQFWD, ScanKeyData::sk_flags, SK_SEARCHARRAY, SK_SEARCHNULL, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, and BTArrayKeyInfo::sksup.
Referenced by _bt_preprocess_keys().
Definition at line 194 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(), BTScanOpaqueData::arrayContext, BTScanOpaqueData::arrayKeys, Assert(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTMaxStrategyNumber, elog, ERROR, FmgrInfo::fn_oid, i, if(), IndexScanDescData::indexRelation, j, BTScanOpaqueData::keyData, IndexScanDescData::keyData, MemoryContextAlloc(), BTScanOpaqueData::numberOfKeys, IndexScanDescData::numberOfKeys, OidIsValid, IndexScanDescData::opaque, BTScanOpaqueData::orderProcs, BTScanOpaqueData::qual_ok, 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 1784 of file nbtpreprocesskeys.c.
References a, b, pg_cmp_s32(), and BTArrayKeyInfo::scan_key.
Referenced by _bt_unmark_keys().
Definition at line 1126 of file nbtpreprocesskeys.c.
References _bt_binsrch_array_skey(), Assert(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTORDER_PROC, BTArrayKeyInfo::elem_values, elog, ERROR, fmgr_info(), get_opfamily_proc(), IndexScanDescData::indexRelation, InvalidOid, NoMovementScanDirection, BTArrayKeyInfo::num_elems, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_SKIP, ScanKeyData::sk_flags, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.
Referenced by _bt_compare_array_scankey_args().
Definition at line 2643 of file nbtpreprocesskeys.c.
References BTScanOpaqueData::arrayContext, Assert(), BTEqualStrategyNumber, BTORDER_PROC, elog, ERROR, fmgr_info_cxt(), get_opfamily_proc(), index_getprocinfo(), IndexScanDescData::indexRelation, OidIsValid, IndexScanDescData::opaque, RelationData::rd_opcintype, RegProcedureIsValid, RelationGetRelationName, ScanKeyData::sk_attno, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_array_keys(), and _bt_preprocess_array_keys_final().
Definition at line 1251 of file nbtpreprocesskeys.c.
References _bt_compare_scankey_args(), Assert(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, elog, ERROR, BTArrayKeyInfo::high_compare, BTArrayKeyInfo::low_compare, BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, and ScanKeyData::sk_strategy.
Referenced by _bt_compare_array_scankey_args().
Definition at line 1373 of file nbtpreprocesskeys.c.
References _bt_skiparray_strat_decrement(), _bt_skiparray_strat_increment(), BTScanOpaqueData::arrayContext, Assert(), BTGreaterStrategyNumber, BTLessStrategyNumber, BTArrayKeyInfo::high_compare, BTArrayKeyInfo::low_compare, MemoryContextSwitchTo(), BTArrayKeyInfo::null_elem, BTArrayKeyInfo::num_elems, IndexScanDescData::opaque, SK_BT_SKIP, ScanKeyData::sk_flags, ScanKeyData::sk_strategy, and BTArrayKeyInfo::sksup.
Referenced by _bt_preprocess_array_keys_final().
Definition at line 1403 of file nbtpreprocesskeys.c.
References Assert(), BTGreaterEqualStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, SkipSupportData::decrement, fmgr_info(), get_opcode(), get_opfamily_member(), BTArrayKeyInfo::high_compare, IndexScanDescData::indexRelation, InvalidOid, OidIsValid, IndexScanDescData::opaque, BTScanOpaqueData::qual_ok, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_DESC, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, and BTArrayKeyInfo::sksup.
Referenced by _bt_skiparray_strat_adjust().
Definition at line 1461 of file nbtpreprocesskeys.c.
References Assert(), BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, fmgr_info(), get_opcode(), get_opfamily_member(), SkipSupportData::increment, IndexScanDescData::indexRelation, InvalidOid, BTArrayKeyInfo::low_compare, OidIsValid, IndexScanDescData::opaque, BTScanOpaqueData::qual_ok, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_DESC, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, and BTArrayKeyInfo::sksup.
Referenced by _bt_skiparray_strat_adjust().
Definition at line 2723 of file nbtpreprocesskeys.c.
References _bt_compare_array_elements(), BTSortArrayContext::collation, qsort_arg(), qunique_arg(), BTSortArrayContext::reverse, ScanKeyData::sk_collation, and BTSortArrayContext::sortproc.
Referenced by _bt_preprocess_array_keys().
Definition at line 1534 of file nbtpreprocesskeys.c.
References _bt_reorder_array_cmp(), BTScanOpaqueData::arrayKeys, Assert(), BTEqualStrategyNumber, DatumGetPointer(), i, j, BTScanOpaqueData::keyData, BTScanOpaqueData::numArrayKeys, BTScanOpaqueData::numberOfKeys, IndexScanDescData::opaque, BTScanOpaqueData::orderProcs, palloc(), palloc0(), pfree(), qsort, BTArrayKeyInfo::scan_key, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_REQBKWD, SK_BT_REQFWD, SK_BT_SKIP, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNULL, and ScanKeyData::sk_strategy.
Referenced by _bt_preprocess_keys().