mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Account for SRFs in targetlists in planner rowcount estimates.
We made use of the ROWS estimate for set-returning functions used in FROM, but not for those used in SELECT targetlists; which is a bit of an oversight considering there are common usages that require the latter approach. Improve that. (I had initially thought it might be worth folding this into cost_qual_eval, but after investigation concluded that that wouldn't be very helpful, so just do it separately.) Per complaint from David Johnston. Back-patch to 9.2, but not further, for fear of destabilizing plan choices in existing releases.
This commit is contained in:
@@ -55,6 +55,7 @@ extern bool contain_window_function(Node *clause);
|
||||
extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
|
||||
|
||||
extern double expression_returns_set_rows(Node *clause);
|
||||
extern double tlist_returns_set_rows(List *tlist);
|
||||
|
||||
extern bool contain_subplans(Node *clause);
|
||||
|
||||
|
@@ -35,6 +35,9 @@ extern Plan *subquery_planner(PlannerGlobal *glob, Query *parse,
|
||||
bool hasRecursion, double tuple_fraction,
|
||||
PlannerInfo **subroot);
|
||||
|
||||
extern void add_tlist_costs_to_plan(PlannerInfo *root, Plan *plan,
|
||||
List *tlist);
|
||||
|
||||
extern bool is_dummy_plan(Plan *plan);
|
||||
|
||||
extern Expr *expression_planner(Expr *expr);
|
||||
|
Reference in New Issue
Block a user