aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/extension.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-23 17:11:41 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-23 17:13:12 -0400
commit43f0c20839aa82705700e4de5bb452b7f044c838 (patch)
tree714b1f46d6f9de4e5102159a36926eed69626025 /src/backend/commands/extension.c
parent1af55e2751cdf3bf3bf25993c34be1fa9ad1e342 (diff)
downloadpostgresql-43f0c20839aa82705700e4de5bb452b7f044c838.tar.gz
postgresql-43f0c20839aa82705700e4de5bb452b7f044c838.zip
Fix overoptimistic assumptions in column width estimation for subqueries.
set_append_rel_pathlist supposed that, while computing per-column width estimates for the appendrel, it could ignore child rels for which the translated reltargetlist entry wasn't a Var. This gave rise to completely silly estimates in some common cases, such as constant outputs from some or all of the arms of a UNION ALL. Instead, fall back on get_typavgwidth to estimate from the value's datatype; which might be a poor estimate but at least it's not completely wacko. That problem was exposed by an Assert in set_subquery_size_estimates, which unfortunately was still overoptimistic even with that fix, since we don't compute attr_widths estimates for appendrels that are entirely excluded by constraints. So remove the Assert; we'll just fall back on get_typavgwidth in such cases. Also, since set_subquery_size_estimates calls set_baserel_size_estimates which calls set_rel_width, there's no need for set_subquery_size_estimates to call get_typavgwidth; set_rel_width will handle it for us if we just leave the estimate set to zero. Remove the unnecessary code. Per report from Erik Rijkers and subsequent investigation.
Diffstat (limited to 'src/backend/commands/extension.c')
0 files changed, 0 insertions, 0 deletions