mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 06:17:23 +02:00
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 |
||
---|---|---|
.. | ||
access | ||
archive | ||
backup | ||
bootstrap | ||
catalog | ||
commands | ||
executor | ||
foreign | ||
jit | ||
lib | ||
libpq | ||
main | ||
nodes | ||
optimizer | ||
parser | ||
partitioning | ||
po | ||
port | ||
postmaster | ||
regex | ||
replication | ||
rewrite | ||
snowball | ||
statistics | ||
storage | ||
tcop | ||
tsearch | ||
utils | ||
.gitignore | ||
common.mk | ||
Makefile | ||
meson.build | ||
nls.mk |