public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Adrian Garcia Badaracco <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Wrapping a where clause to preserve rows with nulls
Date: Wed, 18 Dec 2024 21:14:43 -0700
Message-ID: <CAKFQuwa2jcBnsZxHmNn7_1MjcmOZx_fU93epBx9+orw3yMNgKw@mail.gmail.com> (raw)
In-Reply-To: <CAE8z92GN0-5J=4q6RSsPGk_OP-Y_EHVNgQimTWwcq+BE+HGqRQ@mail.gmail.com>
References: <CAE8z92GN0-5J=4q6RSsPGk_OP-Y_EHVNgQimTWwcq+BE+HGqRQ@mail.gmail.com>
On Wednesday, December 18, 2024, Adrian Garcia Badaracco <
[email protected]> 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.
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Wrapping a where clause to preserve rows with nulls
In-Reply-To: <CAKFQuwa2jcBnsZxHmNn7_1MjcmOZx_fU93epBx9+orw3yMNgKw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox