51 Oid eqop,
Oid sortop,
bool nulls_first);
100 parse->hasWindowFuncs)
120 jtnode =
parse->jointree;
152 foreach(lc, aggs_list)
164 elog(
ERROR,
"could not find equality operator for ordering operator %u",
193 foreach(lc, aggs_list)
222 root->processed_tlist),
244 foreach(lc,
root->agginfos)
252 Assert(aggref->agglevelsup == 0);
297 mminfo->subroot = NULL;
300 mminfo->
param = NULL;
317 Oid eqop,
Oid sortop,
bool nulls_first)
328 double path_fraction;
340 subroot->parent_root =
root;
378 parse->havingQual = NULL;
381 parse->hasDistinctOn =
false;
382 parse->hasAggs =
false;
389 ntest->argisrow =
false;
403 sortcl->hashable =
false;
407 parse->limitOffset = NULL;
435 if (final_rel->
rows > 1.0)
436 path_fraction = 1.0 / final_rel->
rows;
467 mminfo->subroot = subroot;
468 mminfo->
path = sorted_path;
484 root->sort_pathkeys =
486 root->parse->sortClause,
487 root->parse->targetList);
489 root->query_pathkeys =
root->sort_pathkeys;
508 aggsortop = aggform->aggsortop;
#define Assert(condition)
#define OidIsValid(objectId)
bool contain_mutable_functions(Node *clause)
Datum Int64GetDatum(int64 X)
#define HeapTupleIsValid(tuple)
List * lappend(List *list, void *datum)
bool list_member(const List *list, const void *datum)
List * lcons(void *datum, List *list)
bool type_is_rowtype(Oid typid)
Oid get_equality_op_for_ordering_op(Oid opno, bool *reverse)
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
char * pstrdup(const char *in)
Oid exprType(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
Index assignSortGroupRef(TargetEntry *tle, List *tlist)
List * make_pathkeys_for_sortclauses(PlannerInfo *root, List *sortclauses, List *tlist)
Path * get_cheapest_fractional_path_for_pathkeys(List *paths, List *pathkeys, Relids required_outer, double fraction)
MinMaxAggPath * create_minmaxagg_path(PlannerInfo *root, RelOptInfo *rel, PathTarget *target, List *mmaggregates, List *quals)
void add_path(RelOptInfo *parent_rel, Path *new_path)
Path * apply_projection_to_path(PlannerInfo *root, RelOptInfo *rel, Path *path, PathTarget *target)
#define planner_rt_fetch(rti, root)
FormData_pg_aggregate * Form_pg_aggregate
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
static Oid fetch_agg_sort_op(Oid aggfnoid)
void preprocess_minmax_aggregates(PlannerInfo *root)
static bool can_minmax_aggs(PlannerInfo *root, List **context)
static void minmax_qp_callback(PlannerInfo *root, void *extra)
static bool build_minmax_path(PlannerInfo *root, MinMaxAggInfo *mminfo, Oid eqop, Oid sortop, bool nulls_first)
RelOptInfo * query_planner(PlannerInfo *root, query_pathkeys_callback qp_callback, void *qp_extra)
static Datum ObjectIdGetDatum(Oid X)
static struct subre * parse(struct vars *v, int stopper, int type, struct state *init, struct state *final)
RelOptInfo * fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind, Relids relids)
void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up, int min_sublevels_up)
NullTestType nulltesttype
Selectivity tuple_fraction
void SS_identify_outer_params(PlannerInfo *root)
Param * SS_make_initplan_output_param(PlannerInfo *root, Oid resulttype, int32 resulttypmod, Oid resultcollation)
void SS_charge_for_initplans(PlannerInfo *root, RelOptInfo *final_rel)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define create_pathtarget(root, tlist)