pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Alexander Alexander <alexander.berezin3000@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18477: A specific SQL query with "ORDER BY ... NULLS FIRST" is performing poorly if an ordering column is n
Date: Fri, 24 May 2024 12:03:42 +0200
Message-ID: <202405241003.uxtpwvtwcods@alvherre.pgsql> (raw)
In-Reply-To: <CA+AiShyGQoZfS6NvCfZ6xz1kTm_Sei3DtreXkNhRr5yd8LacVQ@mail.gmail.com>

On 2024-May-24, Alexander Alexander wrote:

> Additionally, as you mentioned, the default index is created with NULLS
> LAST, but in this case, the column is non-nullable, making NULLS LAST
> unnecessary as well.

But the NOT NULL constraint could be dropped at any minute, so the
system needs to know where NULLs would go if that were to happen.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Los dioses no protegen a los insensatos.  Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)





view thread (9+ messages)  latest in thread

Message-ID: <202405241003.uxtpwvtwcods@alvherre.pgsql>
Permalink:  ../202405241003.uxtpwvtwcods@alvherre.pgsql/
Also on:    postgresql.org/message-id/202405241003.uxtpwvtwcods@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@alvh.no-ip.org, alexander.berezin3000@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18477: A specific SQL query with "ORDER BY ... NULLS FIRST" is performing poorly if an ordering column is n
  In-Reply-To: <202405241003.uxtpwvtwcods@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox