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/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/cost.h"
#include "optimizer/optimizer.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "optimizer/planmain.h"
#include "optimizer/subselect.h"
#include "optimizer/tlist.h"
#include "parser/parse_clause.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteManip.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static bool | can_minmax_aggs (PlannerInfo *root, List **context) |
static bool | build_minmax_path (PlannerInfo *root, MinMaxAggInfo *mminfo, Oid eqop, Oid sortop, bool nulls_first) |
static void | minmax_qp_callback (PlannerInfo *root, void *extra) |
static Oid | fetch_agg_sort_op (Oid aggfnoid) |
void | preprocess_minmax_aggregates (PlannerInfo *root) |
|
static |
Definition at line 316 of file planagg.c.
References PlannerInfo::agginfos, PlannerInfo::aggtransinfos, PlannerInfo::append_rel_list, apply_projection_to_path(), NullTest::arg, Assert, assignSortGroupRef(), copyObject, create_pathtarget, PlannerInfo::eq_classes, SortGroupClause::eqop, FLOAT8PASSBYVAL, get_cheapest_fractional_path_for_pathkeys(), PlannerInfo::hasHavingQual, IncrementVarSublevelsUp(), PlannerInfo::init_plans, Int64GetDatum(), InvalidOid, IS_NOT_NULL, PlannerInfo::join_info_list, lcons(), PlannerInfo::limit_tuples, list_make1, list_member(), NullTest::location, makeConst(), makeNode, makeTargetEntry(), minmax_qp_callback(), NIL, SortGroupClause::nulls_first, NullTest::nulltesttype, PlannerInfo::outer_params, palloc(), parse(), PlannerInfo::parse, MinMaxAggInfo::path, MinMaxAggInfo::pathcost, RelOptInfo::pathlist, PlannerInfo::placeholder_list, PlannerInfo::plan_params, PlannerInfo::processed_tlist, pstrdup(), PlannerInfo::query_level, PlannerInfo::query_pathkeys, query_planner(), root, RelOptInfo::rows, SortGroupClause::sortop, SS_charge_for_initplans(), SS_identify_outer_params(), Path::startup_cost, MinMaxAggInfo::target, SortGroupClause::tleSortGroupRef, Path::total_cost, and PlannerInfo::tuple_fraction.
Referenced by preprocess_minmax_aggregates().
|
static |
Definition at line 236 of file planagg.c.
References Aggref::aggfilter, MinMaxAggInfo::aggfnoid, Aggref::aggfnoid, Aggref::aggorder, AggInfo::aggrefs, MinMaxAggInfo::aggsortop, Aggref::args, Assert, contain_mutable_functions(), context, TargetEntry::expr, exprType(), fetch_agg_sort_op(), lappend(), lfirst_node, linitial, linitial_node, list_length(), makeNode, NIL, OidIsValid, MinMaxAggInfo::param, MinMaxAggInfo::path, MinMaxAggInfo::pathcost, root, MinMaxAggInfo::target, and type_is_rowtype().
Referenced by preprocess_minmax_aggregates().
Definition at line 497 of file planagg.c.
References GETSTRUCT, HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), ReleaseSysCache(), and SearchSysCache1().
Referenced by can_minmax_aggs().
|
static |
Definition at line 478 of file planagg.c.
References make_pathkeys_for_sortclauses(), NIL, and root.
Referenced by build_minmax_path().
void preprocess_minmax_aggregates | ( | PlannerInfo * | root | ) |
Definition at line 72 of file planagg.c.
References add_path(), MinMaxAggInfo::aggsortop, Assert, build_minmax_path(), can_minmax_aggs(), create_minmaxagg_path(), create_pathtarget, elog, ERROR, exprCollation(), exprType(), fetch_upper_rel(), FromExpr::fromlist, get_equality_op_for_ordering_op(), RangeTblEntry::inh, IsA, lfirst, linitial, list_length(), NIL, OidIsValid, MinMaxAggInfo::param, parse(), planner_rt_fetch, root, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, RangeTblRef::rtindex, SS_make_initplan_output_param(), MinMaxAggInfo::target, and UPPERREL_GROUP_AGG.
Referenced by grouping_planner().