|
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) |
| Size | EstimateSetOpHashTableSpace (double nentries, Size tupleWidth) |
| 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::tuplesContext.
Referenced by ExecInitSetOp().
Definition at line 115 of file nodeSetOp.c.
References EstimateTupleHashTableSpace().
Referenced by create_setop_path().
| void ExecEndSetOp | ( | SetOpState * | node | ) |
Definition at line 691 of file nodeSetOp.c.
References ExecEndNode(), innerPlanState, MemoryContextDelete(), outerPlanState, and SetOpState::tuplesContext.
Referenced by ExecEndNode().
| SetOpState * ExecInitSetOp | ( | SetOp * | node, |
| EState * | estate, | ||
| int | eflags | ||
| ) |
Definition at line 572 of file nodeSetOp.c.
References SortSupportData::abbreviate, ALLOCSET_DEFAULT_SIZES, Assert(), build_hash_table(), BumpContextCreate(), 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, TTSOpsMinimalTuple, and SetOpState::tuplesContext.
Referenced by ExecInitNode().
| void ExecReScanSetOp | ( | SetOpState * | node | ) |
Definition at line 703 of file nodeSetOp.c.
References ExecClearTuple(), ExecReScan(), SetOpState::hashiter, SetOpState::hashtable, innerPlan, innerPlanState, SetOpState::need_init, SetOpState::numOutput, outerPlan, outerPlanState, PlanState::plan, SetOpState::ps, PlanState::ps_ResultTupleSlot, ResetTupleHashIterator, ResetTupleHashTable(), SetOpState::setop_done, SETOP_HASHED, and SetOpState::table_filled.
Referenced by ExecReScan().
|
static |
Definition at line 168 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 128 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 386 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 415 of file nodeSetOp.c.
References ExecProcNode(), SetOpState::hashiter, SetOpState::hashtable, innerPlan, innerPlanState, LookupTupleHashEntry(), SetOpStatePerGroupData::numLeft, SetOpStatePerGroupData::numRight, outerPlan, outerPlanState, SetOpState::ps, PlanState::ps_ExprContext, ResetExprContext, ResetTupleHashIterator, SetOpState::table_filled, TupIsNull, and TupleHashEntryGetAdditional().
Referenced by ExecSetOp().
|
static |
Definition at line 339 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 512 of file nodeSetOp.c.
References CHECK_FOR_INTERRUPTS, ExecClearTuple(), ExecStoreMinimalTuple(), SetOpState::hashiter, SetOpState::hashtable, SetOpState::numOutput, SetOpState::ps, PlanState::ps_ResultTupleSlot, ScanTupleHashTable, set_output_count(), SetOpState::setop_done, TupleHashEntryGetAdditional(), and TupleHashEntryGetTuple().
Referenced by ExecSetOp().
|
static |
Definition at line 205 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().