Re: Query optimiser is not using 'not null' constraint when 'order by nulls last' clause is used - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query optimiser is not using 'not null' constraint when 'order by nulls last' clause is used
Date
Msg-id 15987.1517583616@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used  (Nandakumar M <m.nanda92@gmail.com>)
Responses Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used  (Nandakumar M <m.nanda92@gmail.com>)
List pgsql-performance
Nandakumar M <m.nanda92@gmail.com> writes:
> The order by column has a not null constraint on it and so nulls last or
> first shouldn't make any difference.

The planner does not consider this and it doesn't really seem like
something worth expending cycles on.  If you know that there won't be
nulls in the column, why are you insisting on specifying a nondefault
value of NULLS FIRST/LAST in the query?

            regards, tom lane


pgsql-performance by date:

Previous
From: Nandakumar M
Date:
Subject: Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used
Next
From: Nandakumar M
Date:
Subject: Re: Query optimiser is not using 'not null' constraint when 'order bynulls last' clause is used