Re: BUG #18477: A specific SQL query with "ORDER BY ... NULLS FIRST" is performing poorly if an ordering column is n

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alexander Alexander <alexander(dot)berezin3000(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18477: A specific SQL query with "ORDER BY ... NULLS FIRST" is performing poorly if an ordering column is n
Date: 2024-05-24 10:03:42
Message-ID: 202405241003.uxtpwvtwcods@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2024-05-24 10:20:05 Re: BUG #18476: Debian Install Docs have confusing code block structure
Previous Message Alexander Alexander 2024-05-24 08:34:34 Re: BUG #18477: A specific SQL query with "ORDER BY ... NULLS FIRST" is performing poorly if an ordering column is n