Re: Why is a sort required for this query? (IS NULL predicate on leading key column) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Why is a sort required for this query? (IS NULL predicate on leading key column)
Date
Msg-id 2027067.1705504277@sss.pgh.pa.us
Whole thread Raw
In response to Why is a sort required for this query? (IS NULL predicate on leading key column)  (Jerry Brenner <jbrenner@guidewire.com>)
List pgsql-performance
Jerry Brenner <jbrenner@guidewire.com> writes:
> I'm wondering why a sort is required for this query, as the index should be
> providing the required ordering to satisfy the ORDER BY clause.  Does it
> have to do with the IS NULL predicate on the leading key column in the
> index?

IS NULL is not seen as an equality condition, no.  It's pretty much
of a hack that makes it an indexable condition at all, and we don't
really do any advanced optimization with it.

            regards, tom lane



pgsql-performance by date:

Previous
From: Jerry Brenner
Date:
Subject: Re: Why is a sort required for this query? (IS NULL predicate on leading key column)
Next
From: Jean-Christophe Boggio
Date:
Subject: I don't understand that EXPLAIN PLAN timings