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/clauses.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 360 of file prepagg.c.
References Aggref::aggcollid, Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggfilter, Aggref::aggfnoid, PlannerInfo::agginfos, Aggref::aggkind, Aggref::aggorder, Aggref::aggstar, Aggref::aggtranstype, Aggref::aggtype, Aggref::aggvariadic, Aggref::args, contain_volatile_functions(), equal(), Aggref::inputcollid, lappend_int(), lfirst, list_free(), NIL, AggInfo::representative_aggref, AggInfo::shareable, and AggInfo::transno.
Referenced by preprocess_aggref().
|
static |
Definition at line 438 of file prepagg.c.
References PlannerInfo::aggtransinfos, AggTransInfo::aggtranstype, AggTransInfo::combinefn_oid, datumIsEqual(), AggTransInfo::deserialfn_oid, AggTransInfo::initValue, AggTransInfo::initValueIsNull, lfirst_int, list_nth(), 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 542 of file prepagg.c.
References add_function_cost(), Aggref::aggdirectargs, AggTransInfo::aggfilter, PlannerInfo::agginfos, PlannerInfo::aggtransinfos, 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, MAXALIGN, OidIsValid, QualCost::per_tuple, AggInfo::representative_aggref, AggTransInfo::serialfn_oid, QualCost::startup, AggClauseCosts::transCost, AggTransInfo::transfn_oid, AggClauseCosts::transitionSpace, and AggTransInfo::transtypeByVal.
Referenced by create_grouping_paths(), create_partial_grouping_paths(), and estimate_path_cost_size().
Definition at line 500 of file prepagg.c.
References getTypeInputInfo(), OidInputFunctionCall(), pfree(), and TextDatumGetCString.
Referenced by preprocess_aggref().
|
static |
Definition at line 117 of file prepagg.c.
References Aggref::aggdistinct, Aggref::aggfilter, AggTransInfo::aggfilter, AGGFNOID, Aggref::aggfnoid, PlannerInfo::agginfos, Aggref::agglevelsup, Aggref::aggno, Aggref::aggorder, PlannerInfo::aggtransinfos, Aggref::aggtransno, AggTransInfo::aggtransspace, Aggref::aggtranstype, AggTransInfo::aggtranstype, AggTransInfo::aggtranstypmod, Aggref::aggtype, Aggref::args, AggTransInfo::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, PlannerInfo::hasNonPartialAggs, PlannerInfo::hasNonSerialAggs, HeapTupleIsValid, initValue(), AggTransInfo::initValue, AggTransInfo::initValueIsNull, lappend(), linitial, list_length(), list_nth(), NIL, PlannerInfo::numOrderedAggs, ObjectIdGetDatum, OidIsValid, palloc(), ReleaseSysCache(), AggInfo::representative_aggref, resolve_aggregate_transtype(), 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 111 of file prepagg.c.
References preprocess_aggrefs_walker().
Referenced by grouping_planner().
|
static |
Definition at line 324 of file prepagg.c.
References Assert, expression_tree_walker(), IsA, and preprocess_aggref().
Referenced by preprocess_aggrefs().