Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used
Дата
Msg-id CAKFQuwZsXmhUdOoyjM4muydFym1PwaLsP+bHe2nXAbMX3SUC7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used  (Nandakumar M <m.nanda92@gmail.com>)
Ответы Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used
Список pgsql-performance
On Fri, Feb 2, 2018 at 8:49 AM, Nandakumar M <m.nanda92@gmail.com> wrote:
But, for the PK column we are not in control of the index that is created.

​You probably can (I assume the nulls aspect of the index doesn't prevent PK usage), but you must add the PK to the table after creating the index and not let the system auto-generate the index for you.​


​ALTER TABLE name ADD ​PRIMARY KEY USING INDEX index_name;

David J.

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

Предыдущее
От: Nandakumar M
Дата:
Сообщение: Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used
Следующее
От: Nandakumar M
Дата:
Сообщение: Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used