Andrei Lepikhov <[email protected]> writes:
> From time to time, I see user complaints on performance degradation
> caused by newly introduced transformation - it is usually related to
> correlated subplan transformation as well as trivial initplan → join
> transformation.
> The original issue (according to my case analysis) is usually that, by
> adding such a pull-up optimiser excess join collapse limit. As a result,
> the query tree tail, which was previously ordered according to the cost
> model, is now determined mechanically, sometimes causing severe
> degradation in execution time.
Certainly that's possible, but I doubt it's common enough to justify
putting a lot of work into specialized mechanisms to deal with such
scenarios.
What I'm wondering about is that join_collapse_limit and
from_collapse_limit were invented more than two decades ago, but
we've not touched their default values since then. Machines are a
lot faster since 2004, and we've probably achieved some net speedups
in the planner logic as well. Could we alleviate this concern by
raising those defaults, and if so, what are reasonable values in 2026?
(geqo_threshold should probably be looked at too.)
regards, tom lane