PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "executor/executor.h"
#include "executor/nodeSetOp.h"
#include "miscadmin.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | SetOpStatePerGroupData |
Typedefs | |
typedef struct SetOpStatePerGroupData | SetOpStatePerGroupData |
Functions | |
static TupleTableSlot * | setop_retrieve_direct (SetOpState *setopstate) |
static void | setop_fill_hash_table (SetOpState *setopstate) |
static TupleTableSlot * | setop_retrieve_hash_table (SetOpState *setopstate) |
static void | initialize_counts (SetOpStatePerGroup pergroup) |
static void | advance_counts (SetOpStatePerGroup pergroup, int flag) |
static int | fetch_tuple_flag (SetOpState *setopstate, TupleTableSlot *inputslot) |
static void | build_hash_table (SetOpState *setopstate) |
static void | set_output_count (SetOpState *setopstate, SetOpStatePerGroup pergroup) |
static TupleTableSlot * | ExecSetOp (PlanState *pstate) |
SetOpState * | ExecInitSetOp (SetOp *node, EState *estate, int eflags) |
void | ExecEndSetOp (SetOpState *node) |
void | ExecReScanSetOp (SetOpState *node) |
typedef struct SetOpStatePerGroupData SetOpStatePerGroupData |
|
inlinestatic |
Definition at line 89 of file nodeSetOp.c.
References flag(), SetOpStatePerGroupData::numLeft, and SetOpStatePerGroupData::numRight.
Referenced by setop_fill_hash_table(), and setop_retrieve_direct().
|
static |
Definition at line 120 of file nodeSetOp.c.
References Assert, BuildTupleHashTableExt(), SetOpState::eqfuncoids, EState::es_query_cxt, ExecGetResultType(), SetOpState::hashfunctions, SetOpState::hashtable, SetOp::numCols, SetOp::numGroups, outerPlanState, PlanState::plan, SetOpState::ps, PlanState::ps_ExprContext, SETOP_HASHED, PlanState::state, SetOp::strategy, and SetOpState::tableContext.
Referenced by ExecInitSetOp().
void ExecEndSetOp | ( | SetOpState * | node | ) |
Definition at line 583 of file nodeSetOp.c.
References ExecEndNode(), MemoryContextDelete(), outerPlanState, and SetOpState::tableContext.
Referenced by ExecEndNode().
SetOpState* ExecInitSetOp | ( | SetOp * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 481 of file nodeSetOp.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, build_hash_table(), CurrentMemoryContext, SetOpState::eqfuncoids, SetOpState::eqfunction, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, EXEC_FLAG_REWIND, ExecAssignExprContext(), ExecGetResultType(), ExecInitNode(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, ExecSetOp(), execTuplesHashPrepare(), execTuplesMatchPrepare(), SetOpState::grp_firstTuple, SetOpState::hashfunctions, SetOpState::hashtable, makeNode, SetOp::numCols, SetOpState::numOutput, outerPlan, outerPlanState, palloc0(), SetOpState::pergroup, PlanState::plan, SetOpState::ps, PlanState::ps_ProjInfo, SetOpState::setop_done, SETOP_HASHED, PlanState::state, SetOp::strategy, SetOpState::table_filled, SetOpState::tableContext, TTSOpsHeapTuple, and TTSOpsMinimalTuple.
Referenced by ExecInitNode().
void ExecReScanSetOp | ( | SetOpState * | node | ) |
Definition at line 594 of file nodeSetOp.c.
References ExecClearTuple(), ExecReScan(), SetOpState::grp_firstTuple, SetOpState::hashiter, SetOpState::hashtable, heap_freetuple(), MemoryContextReset(), SetOpState::numOutput, outerPlan, outerPlanState, PlanState::plan, SetOpState::ps, PlanState::ps_ResultTupleSlot, ResetTupleHashIterator, ResetTupleHashTable(), SetOpState::setop_done, SETOP_HASHED, SetOpState::table_filled, and SetOpState::tableContext.
Referenced by ExecReScan().
|
static |
Definition at line 190 of file nodeSetOp.c.
References castNode, CHECK_FOR_INTERRUPTS, SetOpState::numOutput, PlanState::plan, SetOpState::ps, PlanState::ps_ResultTupleSlot, SetOpState::setop_done, setop_fill_hash_table(), SETOP_HASHED, setop_retrieve_direct(), setop_retrieve_hash_table(), SetOp::strategy, and SetOpState::table_filled.
Referenced by ExecInitSetOp().
|
static |
Definition at line 102 of file nodeSetOp.c.
References Assert, DatumGetInt32(), flag(), SetOp::flagColIdx, PlanState::plan, SetOpState::ps, and slot_getattr().
Referenced by setop_fill_hash_table(), and setop_retrieve_direct().
|
inlinestatic |
Definition at line 80 of file nodeSetOp.c.
References SetOpStatePerGroupData::numLeft, and SetOpStatePerGroupData::numRight.
Referenced by setop_fill_hash_table(), and setop_retrieve_direct().
|
static |
Definition at line 150 of file nodeSetOp.c.
References SetOp::cmd, elog, ERROR, if(), SetOpStatePerGroupData::numLeft, SetOpState::numOutput, SetOpStatePerGroupData::numRight, PlanState::plan, SetOpState::ps, SETOPCMD_EXCEPT, SETOPCMD_EXCEPT_ALL, SETOPCMD_INTERSECT, and SETOPCMD_INTERSECT_ALL.
Referenced by setop_retrieve_direct(), and setop_retrieve_hash_table().
|
static |
Definition at line 339 of file nodeSetOp.c.
References TupleHashEntryData::additional, advance_counts(), Assert, SetOp::cmd, ExecProcNode(), fetch_tuple_flag(), SetOp::firstFlag, flag(), SetOpState::hashiter, SetOpState::hashtable, initialize_counts(), LookupTupleHashEntry(), MemoryContextAlloc(), outerPlan, outerPlanState, PG_USED_FOR_ASSERTS_ONLY, PlanState::plan, SetOpState::ps, PlanState::ps_ExprContext, ResetExprContext, ResetTupleHashIterator, SETOPCMD_INTERSECT, SETOPCMD_INTERSECT_ALL, SetOpState::table_filled, TupleHashTableData::tablecxt, and TupIsNull.
Referenced by ExecSetOp().
|
static |
Definition at line 227 of file nodeSetOp.c.
References advance_counts(), ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, SetOpState::eqfunction, ExecClearTuple(), ExecCopySlotHeapTuple(), ExecProcNode(), ExecQualAndReset(), ExecStoreHeapTuple(), fetch_tuple_flag(), SetOpState::grp_firstTuple, initialize_counts(), SetOpState::numOutput, outerPlan, outerPlanState, SetOpState::pergroup, SetOpState::ps, PlanState::ps_ExprContext, PlanState::ps_ResultTupleSlot, set_output_count(), SetOpState::setop_done, TupIsNull, and while().
Referenced by ExecSetOp().
|
static |
Definition at line 425 of file nodeSetOp.c.
References TupleHashEntryData::additional, CHECK_FOR_INTERRUPTS, ExecClearTuple(), ExecStoreMinimalTuple(), TupleHashEntryData::firstTuple, SetOpState::hashiter, SetOpState::hashtable, SetOpState::numOutput, SetOpState::ps, PlanState::ps_ResultTupleSlot, ScanTupleHashTable, set_output_count(), and SetOpState::setop_done.
Referenced by ExecSetOp().