68 const Datum *orderbyvals,
const bool *orderbynulls);
103 if (scandesc ==
NULL)
199 if (scandesc ==
NULL)
311 elog(
ERROR,
"index returned tuples in wrong order");
452 rta->orderbyvals,
rta->orderbynulls,
461 const Datum *orderbyvals,
const bool *orderbynulls)
475 if (!orderbynulls[
i])
481 rt->orderbynulls[
i] = orderbynulls[
i];
671 for (
j = 0;
j < numArrayKeys;
j++)
704 &elem_values, &elem_nulls, &num_elems);
751 for (
j = numArrayKeys - 1;
j >= 0;
j--)
759 if (next_elem >= num_elems)
767 if (elem_nulls[next_elem])
839 if (epqstate !=
NULL)
858 elog(
ERROR,
"unexpected ExecIndexMarkPos call in EPQ recheck");
887 elog(
ERROR,
"unexpected ExecIndexRestrPos call in EPQ recheck");
1218 opno = ((
OpExpr *) clause)->opno;
1233 elog(
ERROR,
"indexqual doesn't have key on left side");
1237 elog(
ERROR,
"bogus index qualification");
1243 opfamily =
index->rd_opfamily[varattno - 1];
1305 ((
OpExpr *) clause)->inputcollid,
1350 elog(
ERROR,
"indexqual doesn't have key on left side");
1358 if (!
index->rd_indam->amcanorder ||
1360 elog(
ERROR,
"bogus RowCompare index qualification");
1361 opfamily =
index->rd_opfamily[varattno - 1];
1368 if (op_strategy != rc->
cmptype)
1369 elog(
ERROR,
"RowCompare index qualification contains wrong operator");
1376 elog(
ERROR,
"missing support function %d(%u,%u) in opfamily %u",
1474 elog(
ERROR,
"indexqual doesn't have key on left side");
1478 elog(
ERROR,
"bogus index qualification");
1484 opfamily =
index->rd_opfamily[varattno - 1];
1501 if (
index->rd_indam->amsearcharray)
1588 elog(
ERROR,
"NullTest indexqual has wrong key");
1595 switch (
ntest->nulltesttype)
1604 elog(
ERROR,
"unrecognized nulltesttype: %d",
1605 (
int)
ntest->nulltesttype);
1620 elog(
ERROR,
"unsupported indexqual type: %d",
1646 elog(
ERROR,
"ScalarArrayOpExpr index qual found where not allowed");
1669 if (!instrument && !parallel_aware)
1679 instrument, parallel_aware,
1700 if (!instrument && !parallel_aware)
1710 instrument, parallel_aware, pcxt->
nworkers,
1714 if (!parallel_aware)
1766 if (!instrument && !parallel_aware)
1778 if (!parallel_aware)
#define DatumGetArrayTypeP(X)
void deconstruct_array(const ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp)
#define OffsetToPointer(base, offset)
#define RegProcedureIsValid(p)
#define Assert(condition)
#define MemSet(start, val, len)
Datum datumCopy(Datum value, bool typByVal, int typLen)
void ExecReScan(PlanState *node)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
ExprState * ExecInitQual(List *qual, PlanState *parent)
List * ExecInitExprList(List *nodes, PlanState *parent)
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
void ExecAssignScanProjectionInfo(ScanState *node)
void ExecScanReScan(ScanState *node)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTypeTL(PlanState *planstate)
void ExecForceStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
#define InstrCountFiltered2(node, delta)
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
#define ResetExprContext(econtext)
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
#define EXEC_FLAG_EXPLAIN_ONLY
#define palloc_object(type)
#define palloc_array(type, count)
#define PG_DETOAST_DATUM(datum)
void heap_freetuple(HeapTuple htup)
#define IsParallelWorker()
void index_parallelscan_initialize(Relation heapRelation, Relation indexRelation, Snapshot snapshot, bool instrument, bool parallel_aware, int nworkers, SharedIndexScanInstrumentation **sharedinfo, ParallelIndexScanDesc target)
bool index_getnext_slot(IndexScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
IndexScanDesc index_beginscan_parallel(Relation heaprel, Relation indexrel, IndexScanInstrumentation *instrument, int nkeys, int norderbys, ParallelIndexScanDesc pscan)
void index_restrpos(IndexScanDesc scan)
IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, IndexScanInstrumentation *instrument, int nkeys, int norderbys)
void index_close(Relation relation, LOCKMODE lockmode)
void index_markpos(IndexScanDesc scan)
void index_endscan(IndexScanDesc scan)
Size index_parallelscan_estimate(Relation indexRelation, int nkeys, int norderbys, Snapshot snapshot, bool instrument, bool parallel_aware, int nworkers)
Relation index_open(Oid relationId, LOCKMODE lockmode)
void index_parallelrescan(IndexScanDesc scan)
void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys)
void get_op_opfamily_properties(Oid opno, Oid opfamily, bool ordering_op, int *strategy, Oid *lefttype, Oid *righttype)
void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign)
Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype, int16 procnum)
void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval)
#define TypeIsToastable(typid)
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define CHECK_FOR_INTERRUPTS()
Oid exprType(const Node *expr)
Oid exprCollation(const Node *expr)
static Node * get_rightop(const void *clause)
static Node * get_leftop(const void *clause)
void ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, bool isorderby, ScanKey *scanKeys, int *numScanKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexArrayKeyInfo **arrayKeys, int *numArrayKeys)
void ExecIndexScanRetrieveInstrumentation(IndexScanState *node)
static void reorderqueue_push(IndexScanState *node, TupleTableSlot *slot, const Datum *orderbyvals, const bool *orderbynulls)
void ExecIndexScanEstimate(IndexScanState *node, ParallelContext *pcxt)
static void EvalOrderByExpressions(IndexScanState *node, ExprContext *econtext)
bool ExecIndexEvalArrayKeys(ExprContext *econtext, IndexArrayKeyInfo *arrayKeys, int numArrayKeys)
void ExecIndexEvalRuntimeKeys(ExprContext *econtext, IndexRuntimeKeyInfo *runtimeKeys, int numRuntimeKeys)
void ExecIndexScanReInitializeDSM(IndexScanState *node, ParallelContext *pcxt)
static int cmp_orderbyvals(const Datum *adist, const bool *anulls, const Datum *bdist, const bool *bnulls, IndexScanState *node)
void ExecReScanIndexScan(IndexScanState *node)
void ExecIndexScanInitializeDSM(IndexScanState *node, ParallelContext *pcxt)
IndexScanState * ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
static TupleTableSlot * IndexNextWithReorder(IndexScanState *node)
void ExecIndexScanInitializeWorker(IndexScanState *node, ParallelWorkerContext *pwcxt)
void ExecEndIndexScan(IndexScanState *node)
static bool IndexRecheck(IndexScanState *node, TupleTableSlot *slot)
void ExecIndexRestrPos(IndexScanState *node)
static TupleTableSlot * ExecIndexScan(PlanState *pstate)
static int reorderqueue_cmp(const pairingheap_node *a, const pairingheap_node *b, void *arg)
void ExecIndexMarkPos(IndexScanState *node)
static HeapTuple reorderqueue_pop(IndexScanState *node)
bool ExecIndexAdvanceArrayKeys(IndexArrayKeyInfo *arrayKeys, int numArrayKeys)
static TupleTableSlot * IndexNext(IndexScanState *node)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
void pairingheap_add(pairingheap *heap, pairingheap_node *node)
pairingheap * pairingheap_allocate(pairingheap_comparator compare, void *arg)
pairingheap_node * pairingheap_remove_first(pairingheap *heap)
pairingheap_node * pairingheap_first(pairingheap *heap)
#define pairingheap_is_empty(h)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
static int cmp(const chr *x, const chr *y, size_t len)
#define RelationGetDescr(relation)
#define IndexRelationGetNumberOfKeyAttributes(relation)
void ScanKeyEntryInitialize(ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, RegProcedure procedure, Datum argument)
#define ScanDirectionIsForward(direction)
#define ScanDirectionCombine(a, b)
#define ScanDirectionIsBackward(direction)
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)
#define shm_toc_estimate_chunk(e, sz)
#define shm_toc_estimate_keys(e, cnt)
void PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup)
ExecAuxRowMark ** relsubs_rowmark
TupleTableSlot ** relsubs_slot
MemoryContext es_query_cxt
ScanDirection es_direction
struct EPQState * es_epq_active
MemoryContext ecxt_per_tuple_memory
TupleTableSlot * ecxt_scantuple
bool * iss_OrderByTypByVals
struct IndexScanDescData * iss_ScanDesc
IndexScanInstrumentation iss_Instrument
ExprState * indexqualorig
Relation iss_RelationDesc
pairingheap * iss_ReorderQueue
bool iss_RuntimeKeysReady
ScanKeyData * iss_ScanKeys
ScanKeyData * iss_OrderByKeys
SortSupport iss_SortSupport
SharedIndexScanInstrumentation * iss_SharedInfo
ExprContext * iss_RuntimeContext
Datum * iss_OrderByValues
int16 * iss_OrderByTypLens
IndexRuntimeKeyInfo * iss_RuntimeKeys
shm_toc_estimator estimator
Instrumentation * instrument
ExprContext * ps_ExprContext
Relation ss_currentRelation
TupleTableSlot * ss_ScanTupleSlot
IndexScanInstrumentation winstrument[FLEXIBLE_ARRAY_MEMBER]
int(* comparator)(Datum x, Datum y, SortSupport ssup)
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
static HeapTuple ExecCopySlotHeapTuple(TupleTableSlot *slot)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)