Re: Index ordering after IS NULL

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Index ordering after IS NULL
Дата
Msg-id CAH2-Wz=iDDL7H=rbgEiaHTXGEMTJ0Nhu8c4q9ZgOP1KfNna6Dg@mail.gmail.com
обсуждение исходный текст
Ответ на Index ordering after IS NULL  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
On Sat, Sep 10, 2022 at 2:28 PM Jeff Janes <jeff.janes@gmail.com> wrote:
> explain analyze select * from j where b is null order by c limit 10;
> explain analyze select * from j where b =8 order by c limit 10;
>
> The first uses a sort despite it being disabled.

The first/is null query seems to give the result and plan you're
looking for if the query is rewritten to order by "b, c", and not just
"c".

That in itself doesn't make your complaint any less valid, of course.
You don't have to do this with the second query, so why should you
have to do it with the first?

-- 
Peter Geoghegan



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

Предыдущее
От: Michael Banck
Дата:
Сообщение: Re: Support load balancing in libpq
Следующее
От: Robert Haas
Дата:
Сообщение: Re: why can't a table be part of the same publication as its schema