mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Implement the FILTER clause for aggregate function calls.
This is SQL-standard with a few extensions, namely support for subqueries and outer references in clause expressions. catversion bump due to change in Aggref and WindowFunc. David Fetter, reviewed by Dean Rasheed.
This commit is contained in:
@ -1590,6 +1590,14 @@ cost_windowagg(Path *path, PlannerInfo *root,
|
||||
startup_cost += argcosts.startup;
|
||||
wfunccost += argcosts.per_tuple;
|
||||
|
||||
/*
|
||||
* Add the filter's cost to per-input-row costs. XXX We should reduce
|
||||
* input expression costs according to filter selectivity.
|
||||
*/
|
||||
cost_qual_eval_node(&argcosts, (Node *) wfunc->aggfilter, root);
|
||||
startup_cost += argcosts.startup;
|
||||
wfunccost += argcosts.per_tuple;
|
||||
|
||||
total_cost += wfunccost * input_tuples;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user