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 |
typedef SetOpStatePerGroupData * | SetOpStatePerGroup |
Functions | |
static TupleTableSlot * | setop_retrieve_sorted (SetOpState *setopstate) |
static void | setop_load_group (SetOpStatePerInput *input, PlanState *inputPlan, SetOpState *setopstate) |
static int | setop_compare_slots (TupleTableSlot *s1, TupleTableSlot *s2, SetOpState *setopstate) |
static void | setop_fill_hash_table (SetOpState *setopstate) |
static TupleTableSlot * | setop_retrieve_hash_table (SetOpState *setopstate) |
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 SetOpStatePerGroupData* SetOpStatePerGroup |
Definition at line 68 of file nodeSetOp.c.
typedef struct SetOpStatePerGroupData SetOpStatePerGroupData |
|
static |
Definition at line 84 of file nodeSetOp.c.
References Assert, BuildTupleHashTable(), SetOpState::eqfuncoids, EState::es_query_cxt, ExecGetCommonChildSlotOps(), 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 670 of file nodeSetOp.c.
References ExecEndNode(), innerPlanState, MemoryContextDelete(), outerPlanState, and SetOpState::tableContext.
Referenced by ExecEndNode().
SetOpState * ExecInitSetOp | ( | SetOp * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 553 of file nodeSetOp.c.
References SortSupportData::abbreviate, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, build_hash_table(), CurrentMemoryContext, SetOpState::eqfuncoids, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecInitExtraTupleSlot(), ExecInitNode(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, ExecSetOp(), execTuplesHashPrepare(), SetOpStatePerInput::firstTupleSlot, SetOpState::hashfunctions, i, innerPlan, innerPlanState, SetOpState::leftInput, makeNode, SetOpState::need_init, SetOpState::numCols, SetOp::numCols, SetOpState::numOutput, outerPlan, outerPlanState, palloc0(), PlanState::plan, PrepareSortSupportFromOrderingOp(), SetOpState::ps, PlanState::ps_ProjInfo, PlanState::ps_ResultTupleDesc, PlanState::ps_ResultTupleSlot, SetOpState::rightInput, SetOpState::setop_done, SETOP_HASHED, SetOpState::sortKeys, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, PlanState::state, SetOp::strategy, SetOpState::table_filled, SetOpState::tableContext, and TTSOpsMinimalTuple.
Referenced by ExecInitNode().
void ExecReScanSetOp | ( | SetOpState * | node | ) |
Definition at line 682 of file nodeSetOp.c.
References ExecClearTuple(), ExecReScan(), SetOpState::hashiter, SetOpState::hashtable, innerPlan, innerPlanState, MemoryContextReset(), SetOpState::need_init, 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 160 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_hash_table(), setop_retrieve_sorted(), SetOp::strategy, and SetOpState::table_filled.
Referenced by ExecInitSetOp().
|
static |
Definition at line 120 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_hash_table(), and setop_retrieve_sorted().
|
static |
Definition at line 378 of file nodeSetOp.c.
References ApplySortComparator(), compare(), SetOpState::numCols, s1, s2, slot_getallattrs(), SetOpState::sortKeys, and SortSupportData::ssup_attno.
Referenced by setop_load_group(), and setop_retrieve_sorted().
|
static |
Definition at line 407 of file nodeSetOp.c.
References TupleHashEntryData::additional, ExecProcNode(), SetOpState::hashiter, SetOpState::hashtable, innerPlan, innerPlanState, LookupTupleHashEntry(), MemoryContextAllocZero(), outerPlan, outerPlanState, SetOpState::ps, PlanState::ps_ExprContext, ResetExprContext, ResetTupleHashIterator, SetOpState::table_filled, TupleHashTableData::tablecxt, and TupIsNull.
Referenced by ExecSetOp().
|
static |
Definition at line 331 of file nodeSetOp.c.
References Assert, ExecClearTuple(), ExecCopySlotMinimalTuple(), ExecProcNode(), ExecStoreMinimalTuple(), input, setop_compare_slots(), and TupIsNull.
Referenced by setop_retrieve_sorted().
|
static |
Definition at line 497 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().
|
static |
Definition at line 197 of file nodeSetOp.c.
References ExecClearTuple(), ExecProcNode(), SetOpStatePerInput::firstTupleSlot, innerPlan, innerPlanState, SetOpState::leftInput, SetOpState::need_init, SetOpStatePerInput::needGroup, SetOpStatePerInput::nextTupleSlot, SetOpStatePerGroupData::numLeft, SetOpState::numOutput, SetOpStatePerGroupData::numRight, SetOpStatePerInput::numTuples, outerPlan, outerPlanState, SetOpState::ps, PlanState::ps_ResultTupleSlot, SetOpState::rightInput, set_output_count(), setop_compare_slots(), SetOpState::setop_done, setop_load_group(), and TupIsNull.
Referenced by ExecSetOp().