Re: Query plan for "id IS NULL" on PK

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Query plan for "id IS NULL" on PK
Date: 2023-02-14 22:30:29
Message-ID: CAKFQuwb3mMRL-bAsMSo3ks78_4cYCV5qptxHPs7mSoKPz1w5Pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 14, 2023 at 3:25 PM Rob Sargent <robjsargent(at)gmail(dot)com> wrote:

>
> When will id be null in a primary key?
>
>
The OP seems to be aware of this...

"We cannot change the query being executed. Is there any way we can make
the query planner ignore `OR (id IS NULL)` (as that will never be the case
for the PK) and use both `id` clauses in the index condition?"

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2023-02-14 22:36:32 Re: Query plan for "id IS NULL" on PK
Previous Message Rob Sargent 2023-02-14 22:25:32 Re: Query plan for "id IS NULL" on PK