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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 2, 2018 at 8:49 AM, Nandakumar M <m.nanda92@xxxxxxxxx> 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.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux