pghead_estimate.patch

text/x-patch

Filename: pghead_estimate.patch
Type: text/x-patch
Part: 0
Message: row estimation off the mark when generate_series calls are involved

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/backend/optimizer/plan/planner.c 7 0
Index: src/backend/optimizer/plan/planner.c
===================================================================
RCS file: /repositories/postgreshome/cvs/pgsql/src/backend/optimizer/plan/planner.c,v
retrieving revision 1.267
diff -c -r1.267 planner.c
*** src/backend/optimizer/plan/planner.c	30 Mar 2010 21:58:10 -0000	1.267
--- src/backend/optimizer/plan/planner.c	16 Apr 2010 13:46:35 -0000
***************
*** 1241,1246 ****
--- 1241,1253 ----
  					 * the desired tlist.
  					 */
  					result_plan->targetlist = sub_tlist;
+ 
+ 					/*
+ 					 * Account for changes in plan row estimates because of
+ 					 * this tlist addition
+ 					 */
+ 					result_plan->plan_rows += clamp_row_est(
+ 								expression_returns_set_rows((Node *)result_plan->targetlist));
  				}
  
  				/*