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)
Список
Дерево обсуждения
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 'orderby nulls last' clause is used Laurenz Albe <laurenz.albe@cybertec.at>
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 by nulls last' clause is used Tom Lane <tgl@sss.pgh.pa.us>
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 "David G. Johnston" <david.g.johnston@gmail.com>
Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used Nandakumar M <m.nanda92@gmail.com>
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
Дата:
От: Nandakumar M
Дата: