diff options
Diffstat (limited to 'src/include/nodes/relation.h')
-rw-r--r-- | src/include/nodes/relation.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 6e3d0f35181..f885f5a0c46 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -189,6 +189,8 @@ typedef struct PlannerInfo List *distinct_pathkeys; /* distinctClause pathkeys, if any */ List *sort_pathkeys; /* sortClause pathkeys, if any */ + List *minmax_aggs; /* List of MinMaxAggInfos */ + List *initial_rels; /* RelOptInfos we are now trying to join */ MemoryContext planner_cxt; /* context holding PlannerInfo */ @@ -1358,6 +1360,23 @@ typedef struct PlaceHolderInfo } PlaceHolderInfo; /* + * For each potentially index-optimizable MIN/MAX aggregate function, + * root->minmax_aggs stores a MinMaxAggInfo describing it. + * + * Note: a MIN/MAX agg doesn't really care about the nulls_first property, + * so the pathkey's nulls_first flag should be ignored. + */ +typedef struct MinMaxAggInfo +{ + NodeTag type; + + Oid aggfnoid; /* pg_proc Oid of the aggregate */ + Oid aggsortop; /* Oid of its sort operator */ + Expr *target; /* expression we are aggregating on */ + List *pathkeys; /* pathkeys representing needed sort order */ +} MinMaxAggInfo; + +/* * glob->paramlist keeps track of the PARAM_EXEC slots that we have decided * we need for the query. At runtime these slots are used to pass values * around from one plan node to another. They can be used to pass values |