From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: pgsql: Fix PG 17 [NOT] NULL optimization bug for domains |
Date: | 2025-04-08 13:36:47 |
Message-ID: | Z_Umb38nfDqbqw5w@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Tue, Apr 8, 2025 at 01:34:07AM +0000, Bruce Momjian wrote:
> Fix PG 17 [NOT] NULL optimization bug for domains
>
> A PG 17 optimization allowed columns with NOT NULL constraints to skip
> table scans for IS NULL queries, and to skip IS NOT NULL checks for IS
> NOT NULL queries. This didn't work for domain types, since domain types
> don't follow the IS NULL/IS NOT NULL constraint logic. To fix, disable
> this optimization for domains for PG 17+.
>
> Discussion: https://postgr.es/m/Z37p0paENWWUarj-@momjian.us
Ugh, I knew there was something odd about the commit message I wrote
above, but I couldn't put my figure on it until this morning. The
problem above is not "domains" but row types; the bug report showed it
as an issue with row types used for domains, but it can happen with
columns which are row types too. The doc adjustment was for domains,
and that confused me.
Tom, can you remember this in the 17.5 release notes? Thanks. The
commit should have been:
Fix PG 17 [NOT] NULL optimization bug for row types
A PG 17 optimization allowed columns with NOT NULL constraints
to skip table scans for IS NULL queries, and to skip IS NOT NULL
checks for IS NOT NULL queries. This didn't work for row types,
since row types don't follow the IS NULL/IS NOT NULL constraint
logic. To fix, disable this optimization for row types for PG 17+.
--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com
Do not let urgent matters crowd out time for investment in the future.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-04-08 14:05:48 | Re: pgsql: Add support for basic NUMA awareness |
Previous Message | Daniel Gustafsson | 2025-04-08 13:36:25 | pgsql: ci: Add MBUILD_TARGET for NetBSD and OpenBSD |