On Fri, Aug 30, 2024 at 10:32 AM Peter Geoghegan <p...@bowt.ie> wrote: > It doesn't make a huge difference in practice, because we'll still end > the scan once the leaf level is reached. But it matters more when > array keys are involved, where there might be more than one descent to > the leaf level. Plus we might as well just be thorough about this > stuff.
Was your "explain (analyze, buffers) select * from c_s where x >4000 and y >10 and y <10 order by x desc" example intended to illustrate that these earlier remarks of mine about the problem not being so bad aren't always correct? With your patch, we can detect contradictory quals regardless of their required-ness. There will be some cases where (with your patch) we'll now avoid a very inefficient full index scan -- contrary to what I said about it back on August 30. If that is what you meant, then I accept your argument. I didn't quite get your point before, but this is a logical, useful argument. (You didn't really need to convince me, but this argument still helps your patch.) -- Peter Geoghegan