|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "catalog/pg_aggregate.h"#include "catalog/pg_type.h"#include "nodes/nodeFuncs.h"#include "nodes/pathnodes.h"#include "optimizer/cost.h"#include "optimizer/optimizer.h"#include "optimizer/plancat.h"#include "optimizer/prep.h"#include "parser/parse_agg.h"#include "utils/builtins.h"#include "utils/datum.h"#include "utils/fmgroids.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
| static bool | preprocess_aggrefs_walker (Node *node, PlannerInfo *root) |
| static int | find_compatible_agg (PlannerInfo *root, Aggref *newagg, List **same_input_transnos) |
| static int | find_compatible_trans (PlannerInfo *root, Aggref *newagg, bool shareable, Oid aggtransfn, Oid aggtranstype, int transtypeLen, bool transtypeByVal, Oid aggcombinefn, Oid aggserialfn, Oid aggdeserialfn, Datum initValue, bool initValueIsNull, List *transnos) |
| static Datum | GetAggInitVal (Datum textInitVal, Oid transtype) |
| void | preprocess_aggrefs (PlannerInfo *root, Node *clause) |
| static void | preprocess_aggref (Aggref *aggref, PlannerInfo *root) |
| void | get_agg_clause_costs (PlannerInfo *root, AggSplit aggsplit, AggClauseCosts *costs) |
|
static |
Definition at line 379 of file prepagg.c.
References Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggfilter, Aggref::aggfnoid, Aggref::aggorder, AggInfo::aggrefs, Aggref::args, contain_volatile_functions(), equal(), lappend_int(), lfirst_node, linitial_node, list_free(), NIL, root, AggInfo::shareable, and AggInfo::transno.
Referenced by preprocess_aggref().
|
static |
Definition at line 457 of file prepagg.c.
References AggTransInfo::aggtranstype, AggTransInfo::combinefn_oid, datumIsEqual(), AggTransInfo::deserialfn_oid, initValue(), AggTransInfo::initValueIsNull, lfirst_int, list_nth_node, root, AggTransInfo::serialfn_oid, and AggTransInfo::transfn_oid.
Referenced by preprocess_aggref().
| void get_agg_clause_costs | ( | PlannerInfo * | root, |
| AggSplit | aggsplit, | ||
| AggClauseCosts * | costs | ||
| ) |
Definition at line 559 of file prepagg.c.
References add_function_cost(), Aggref::aggdirectargs, AggTransInfo::aggfilter, AggInfo::aggrefs, AggTransInfo::aggtransspace, AggTransInfo::aggtranstype, AggTransInfo::aggtranstypmod, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_SMALL_INITSIZE, AggTransInfo::args, AggTransInfo::combinefn_oid, cost_qual_eval_node(), AggTransInfo::deserialfn_oid, DO_AGGSPLIT_COMBINE, DO_AGGSPLIT_DESERIALIZE, DO_AGGSPLIT_SERIALIZE, DO_AGGSPLIT_SKIPFINAL, AggClauseCosts::finalCost, AggInfo::finalfn_oid, get_typavgwidth(), lfirst_node, linitial_node, MAXALIGN, OidIsValid, QualCost::per_tuple, root, AggTransInfo::serialfn_oid, QualCost::startup, AggClauseCosts::transCost, AggTransInfo::transfn_oid, AggClauseCosts::transitionSpace, and AggTransInfo::transtypeByVal.
Referenced by create_grouping_paths(), create_partial_grouping_paths(), estimate_path_cost_size(), and generate_grouped_paths().
Definition at line 521 of file prepagg.c.
References getTypeInputInfo(), OidInputFunctionCall(), pfree(), and TextDatumGetCString.
Referenced by preprocess_aggref().
|
static |
Definition at line 116 of file prepagg.c.
References agg_args_support_sendreceive(), Aggref::aggdistinct, AggTransInfo::aggfilter, Aggref::aggfilter, Aggref::aggfnoid, Aggref::aggorder, AggInfo::aggrefs, AggTransInfo::aggtransspace, AggTransInfo::aggtranstype, AggTransInfo::aggtranstypmod, AggTransInfo::args, Aggref::args, Assert(), AggTransInfo::combinefn_oid, AggTransInfo::deserialfn_oid, elog, ERROR, TargetEntry::expr, exprType(), exprTypmod(), AggInfo::finalfn_oid, find_compatible_agg(), find_compatible_trans(), FUNC_MAX_ARGS, get_aggregate_argtypes(), get_typlenbyval(), GetAggInitVal(), GETSTRUCT(), HeapTupleIsValid, initValue(), AggTransInfo::initValueIsNull, lappend(), linitial, list_length(), list_make1, list_nth_node, makeNode, NIL, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), resolve_aggregate_transtype(), root, SearchSysCache1(), AggTransInfo::serialfn_oid, AggInfo::shareable, SysCacheGetAttr(), AggTransInfo::transfn_oid, AggInfo::transno, AggTransInfo::transtypeByVal, and AggTransInfo::transtypeLen.
Referenced by preprocess_aggrefs_walker().
| void preprocess_aggrefs | ( | PlannerInfo * | root, |
| Node * | clause | ||
| ) |
Definition at line 110 of file prepagg.c.
References preprocess_aggrefs_walker(), and root.
Referenced by grouping_planner().
|
static |
Definition at line 344 of file prepagg.c.
References Assert(), expression_tree_walker, IsA, preprocess_aggref(), preprocess_aggrefs_walker(), and root.
Referenced by preprocess_aggrefs(), and preprocess_aggrefs_walker().