Denis Smirnov <[email protected]> writes:
> So I think:
> 1. The patch needs a VOLATILE check and planning-time tests.
> 2. It fixes the selectivity estimate but does not fix the JIT regression.
> 3. The main problem is the JIT cost decision: it uses total plan cost but does
> not account for the number or size of generated JIT functions.
For the record, I do not think we should accept this patch, even
if the problems you mention get fixed. It would impose nontrivial
costs on every query --- roughly O(N^2) in the number of restriction
clauses --- in order to fix badly-written queries, and that is not
a tradeoff I like. We could doubtless improve the cost by expending
lots more engineering effort, but it's still catering to badly
written queries, and we have better places to put the effort.
(There have been plenty of previous discussions along this same line,
btw.)
regards, tom lane