PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | AggStatePerTransData |
struct | AggStatePerAggData |
struct | AggStatePerGroupData |
struct | AggStatePerPhaseData |
struct | AggStatePerHashData |
Macros | |
#define | FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUE 0 |
#define | FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUEISNULL 1 |
#define | FIELDNO_AGGSTATEPERGROUPDATA_NOTRANSVALUE 2 |
Typedefs | |
typedef struct AggStatePerTransData | AggStatePerTransData |
typedef struct AggStatePerAggData | AggStatePerAggData |
typedef struct AggStatePerGroupData | AggStatePerGroupData |
typedef struct AggStatePerPhaseData | AggStatePerPhaseData |
typedef struct AggStatePerHashData | AggStatePerHashData |
Functions | |
AggState * | ExecInitAgg (Agg *node, EState *estate, int eflags) |
void | ExecEndAgg (AggState *node) |
void | ExecReScanAgg (AggState *node) |
Size | hash_agg_entry_size (int numTrans, Size tupleWidth, Size transitionSpace) |
void | hash_agg_set_limits (double hashentrysize, double input_groups, int used_bits, Size *mem_limit, uint64 *ngroups_limit, int *num_partitions) |
void | ExecAggEstimate (AggState *node, ParallelContext *pcxt) |
void | ExecAggInitializeDSM (AggState *node, ParallelContext *pcxt) |
void | ExecAggInitializeWorker (AggState *node, ParallelWorkerContext *pwcxt) |
void | ExecAggRetrieveInstrumentation (AggState *node) |
typedef struct AggStatePerAggData AggStatePerAggData |
typedef struct AggStatePerGroupData AggStatePerGroupData |
typedef struct AggStatePerHashData AggStatePerHashData |
typedef struct AggStatePerPhaseData AggStatePerPhaseData |
typedef struct AggStatePerTransData AggStatePerTransData |
void ExecAggEstimate | ( | AggState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 4682 of file nodeAgg.c.
References add_size(), ParallelContext::estimator, PlanState::instrument, mul_size(), ParallelContext::nworkers, ScanState::ps, shm_toc_estimate_chunk, shm_toc_estimate_keys, size, and AggState::ss.
Referenced by ExecParallelEstimate().
void ExecAggInitializeDSM | ( | AggState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 4703 of file nodeAgg.c.
References PlanState::instrument, SharedAggInfo::num_workers, ParallelContext::nworkers, PlanState::plan, Plan::plan_node_id, ScanState::ps, AggState::shared_info, shm_toc_allocate(), shm_toc_insert(), size, AggState::ss, and ParallelContext::toc.
Referenced by ExecParallelInitializeDSM().
void ExecAggInitializeWorker | ( | AggState * | node, |
ParallelWorkerContext * | pwcxt | ||
) |
Definition at line 4728 of file nodeAgg.c.
References PlanState::plan, Plan::plan_node_id, ScanState::ps, AggState::shared_info, shm_toc_lookup(), AggState::ss, and ParallelWorkerContext::toc.
Referenced by ExecParallelInitializeWorker().
void ExecAggRetrieveInstrumentation | ( | AggState * | node | ) |
Definition at line 4741 of file nodeAgg.c.
References SharedAggInfo::num_workers, palloc(), AggState::shared_info, and size.
Referenced by ExecParallelRetrieveInstrumentation().
void ExecEndAgg | ( | AggState * | node | ) |
Definition at line 4303 of file nodeAgg.c.
References AggState::aggcontexts, Assert, ExecEndNode(), AggregateInstrumentation::hash_batches_used, AggState::hash_batches_used, AggregateInstrumentation::hash_disk_used, AggState::hash_disk_used, AggregateInstrumentation::hash_mem_peak, AggState::hash_mem_peak, AggState::hash_metacxt, hashagg_reset_spill_state(), AggState::hashcontext, IsParallelWorker, Max, AggState::maxsets, MemoryContextDelete(), AggState::numtrans, outerPlan, outerPlanState, ParallelWorkerNumber, AggState::pertrans, ReScanExprContext(), AggState::shared_info, SharedAggInfo::sinstrument, AggState::sort_in, AggState::sort_out, AggStatePerTransData::sortstates, and tuplesort_end().
Referenced by ExecEndNode().
Definition at line 3172 of file nodeAgg.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, AggState::agg_done, AGG_HASHED, AGG_MIXED, AGG_PLAIN, AGG_SORTED, AggState::aggcontexts, AggStatePerAggData::aggdirectargs, Aggref::aggdirectargs, Aggref::aggfnoid, AggStatePerPhaseData::aggnode, AggStatePerHashData::aggnode, AggStatePerTransData::aggref, AggStatePerAggData::aggref, AggState::aggs, AggStatePerTransData::aggshared, AggState::aggsplit, Agg::aggsplit, AggStatePerPhaseData::aggstrategy, AggState::aggstrategy, Agg::aggstrategy, AggState::all_grouped_cols, AggState::all_pergroups, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Aggref::args, Assert, bms_add_member(), bms_add_members(), bms_next_member(), build_aggregate_finalfn_expr(), build_hash_tables(), build_pertrans_for_aggref(), castNode, Agg::chain, CreateWorkExprContext(), AggState::curperagg, AggState::curpertrans, AggState::current_phase, AggState::current_set, DO_AGGSPLIT_COMBINE, DO_AGGSPLIT_DESERIALIZE, DO_AGGSPLIT_SERIALIZE, DO_AGGSPLIT_SKIPFINAL, ExprContext::ecxt_aggnulls, ExprContext::ecxt_aggvalues, elog, AggStatePerPhaseData::eqfunctions, ereport, errcode(), errmsg(), ERROR, EState::es_query_cxt, AggStatePerPhaseData::evaltrans, AggStatePerPhaseData::evaltrans_cache, EXEC_FLAG_BACKWARD, EXEC_FLAG_EXPLAIN_ONLY, EXEC_FLAG_MARK, EXEC_FLAG_REWIND, ExecAgg(), ExecAssignExprContext(), ExecAssignProjectionInfo(), ExecBuildAggTrans(), ExecCreateScanSlotFromOuterPlan(), ExecGetResultSlotOps(), ExecInitExprList(), ExecInitExtraTupleSlot(), ExecInitNode(), ExecInitQual(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, execTuplesMatchPrepare(), AggStatePerAggData::finalfn, AggStatePerAggData::finalfn_oid, find_hash_columns(), fmgr_info(), fmgr_info_set_expr, FmgrInfo::fn_strict, format_type_be(), FUNC_MAX_ARGS, get_aggregate_argtypes(), get_func_name(), get_typlenbyval(), GetAggInitVal(), GETSTRUCT, GetUserId(), AggStatePerPhaseData::grouped_cols, Agg::groupingSets, AggState::grp_firstTuple, AggStatePerPhaseData::gset_lengths, hash_agg_entry_size(), hash_agg_set_limits(), AggState::hash_batches_used, AggState::hash_mem_limit, AggState::hash_metacxt, AggState::hash_ngroups_limit, AggState::hash_pergroup, AggState::hash_planned_partitions, AggState::hash_spill_rslot, AggState::hash_spill_wslot, AggState::hashcontext, AggState::hashentrysize, HeapTupleIsValid, i, initialize_phase(), initValue(), AggStatePerTransData::initValueIsNull, AggState::input_done, InvalidOid, InvokeFunctionExecuteHook, IsBinaryCoercible(), j, lcons_int(), lfirst, list_length(), list_nth_node, makeNode, Max, AggState::maxsets, NIL, AggState::num_hashes, AggState::numaggs, AggStatePerHashData::numCols, Agg::numCols, AggStatePerAggData::numFinalArgs, Agg::numGroups, AggState::numphases, AggStatePerPhaseData::numsets, AggState::numtrans, AggStatePerTransData::numTransInputs, object_aclcheck(), OBJECT_AGGREGATE, OBJECT_FUNCTION, ObjectIdGetDatum(), OidIsValid, PlanState::outerops, PlanState::outeropsfixed, PlanState::outeropsset, outerPlan, outerPlanState, palloc(), palloc0(), AggState::peragg, AggState::pergroups, AggState::perhash, AggState::pertrans, AggState::phases, PlanState::plan, Agg::plan, Plan::plan_width, AggState::projected_set, ScanState::ps, PlanState::ps_ExprContext, PlanState::qual, Plan::qual, ReleaseSysCache(), AggStatePerAggData::resulttypeByVal, AggStatePerAggData::resulttypeLen, SearchSysCache1(), select_current_set(), AggState::sort_in, AggState::sort_out, AggState::sort_slot, AggStatePerPhaseData::sortnode, AggState::ss, ScanState::ss_ScanTupleSlot, PlanState::state, SysCacheGetAttr(), AggState::table_filled, AggState::tmpcontext, AggStatePerTransData::transfn, Agg::transitionSpace, AggStatePerAggData::transno, TupleTableSlot::tts_tupleDescriptor, TTSOpsMinimalTuple, and TTSOpsVirtual.
Referenced by ExecInitNode().
void ExecReScanAgg | ( | AggState * | node | ) |
Definition at line 4363 of file nodeAgg.c.
References AggState::agg_done, AGG_HASHED, AGG_MIXED, AggState::aggcontexts, Agg::aggParams, AggState::aggstrategy, bms_overlap(), build_hash_tables(), PlanState::chgParam, ExprContext::ecxt_aggnulls, ExprContext::ecxt_aggvalues, ExecClearTuple(), ExecReScan(), AggState::grp_firstTuple, AggState::hash_ever_spilled, AggState::hash_ngroups_current, AggState::hash_spill_mode, hashagg_recompile_expressions(), hashagg_reset_spill_state(), AggState::hashcontext, AggStatePerHashData::hashiter, AggStatePerHashData::hashtable, heap_freetuple(), initialize_phase(), AggState::input_done, Max, AggState::maxsets, MemSet, AggState::numaggs, AggState::numtrans, outerPlan, outerPlanState, AggState::pergroups, AggState::perhash, AggState::pertrans, PlanState::plan, AggState::projected_set, ScanState::ps, PlanState::ps_ExprContext, ReScanExprContext(), ResetTupleHashIterator, select_current_set(), AggStatePerTransData::sortstates, AggState::ss, ScanState::ss_ScanTupleSlot, AggState::table_filled, and tuplesort_end().
Referenced by ExecReScan().
Definition at line 1693 of file nodeAgg.c.
References CHUNKHDRSZ, MAXALIGN, and SizeofMinimalTupleHeader.
Referenced by cost_agg(), estimate_hashagg_tablesize(), and ExecInitAgg().
void hash_agg_set_limits | ( | double | hashentrysize, |
double | input_groups, | ||
int | used_bits, | ||
Size * | mem_limit, | ||
uint64 * | ngroups_limit, | ||
int * | num_partitions | ||
) |
Definition at line 1797 of file nodeAgg.c.
References get_hash_memory_limit(), hash_choose_num_partitions(), HASHAGG_READ_BUFFER_SIZE, and HASHAGG_WRITE_BUFFER_SIZE.
Referenced by agg_refill_hash_table(), cost_agg(), and ExecInitAgg().