Search Postgresql Archives

Re: Wrapping a where clause to preserve rows with nulls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, December 18, 2024, Adrian Garcia Badaracco <adrian@xxxxxxxxxxxx> wrote:

Is there any way to include the rows where the predicate evaluates to null while still using an index?

That seems quite unlikely.  Your definition of equality is incompatible with the system’s standard definition while requiring that the standard equals operator be used in the query.  Null values and non-null values are not considered equal, or, put another way, always considered distinct from each other.  A btree index, which handles =, can’t be told to behave differently and so cannot fulfill your desire to produce rows where the stored value is null; it can only produce those equal to 5000.

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux