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

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Query plan for "id IS NULL" on PK
Дата
Msg-id 20230214224304.ykdgobmkqpaygbth@hjp.at
обсуждение исходный текст
Ответ на Re: Query plan for "id IS NULL" on PK  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: Query plan for "id IS NULL" on PK  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On 2023-02-14 15:36:32 -0700, Rob Sargent wrote:
> But if the query is supposed to be generic and re-used in a situation where id
> could be null, wouldn't the null id records be fetched every time? 

No, they will never be fetched because of the AND (("id" <= ?)).

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Query plan for "id IS NULL" on PK
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: Query plan for "id IS NULL" on PK