aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistproc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-11-17 14:36:23 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-11-17 14:36:23 -0500
commitf7816aec23eed1dc1da5f9a53cb6507d30b7f0a2 (patch)
treed0018a8f1e729865ed27ca0b3083f724f5647a53 /src/backend/access/gist/gistproc.c
parent06c70849fb26ac431a722b1d10cffe1c65e728a4 (diff)
downloadpostgresql-f7816aec23eed1dc1da5f9a53cb6507d30b7f0a2.tar.gz
postgresql-f7816aec23eed1dc1da5f9a53cb6507d30b7f0a2.zip
Extract column statistics from CTE references, if possible.
examine_simple_variable() left this as an unimplemented case years ago, with the result that plans for queries involving un-flattened CTEs might be much stupider than necessary. It's not hard to extend the existing logic for RTE_SUBQUERY cases to also be able to drill down into CTEs, so let's do that. There was some discussion of whether this patch breaks the idea of a MATERIALIZED CTE being an optimization fence. We concluded it's okay, because we already allow the outer planner level to see the estimated width and rowcount of the CTE result, and letting it see column statistics too seems fairly equivalent. Basically, what we expect of the optimization fence is that the outer query should not affect the plan chosen for the CTE query. Once that plan is chosen, it's okay for the outer planner level to make use of whatever information we have about it. Jian Guo and Tom Lane, per complaint from Hans Buschmann Discussion: https://postgr.es/m/4504e67078d648cdac3651b2960da6e7@nidsa.net
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions