Re: feature idea: use index when checking for NULLs before SET NOT NULL - Mailing list pgsql-hackers

From Sergei Kornilov
Subject Re: feature idea: use index when checking for NULLs before SET NOT NULL
Date
Msg-id 11131101590757378@mail.yandex.ru
Whole thread Raw
In response to Re: feature idea: use index when checking for NULLs before SET NOT NULL  ("John Bachir" <j@jjb.cc>)
Responses Re: feature idea: use index when checking for NULLs before SET NOT NULL
List pgsql-hackers
Hi

> Sergei, a few questions:
>
> - Just to be clear, your recipe does not require any indexes, right? Because the constraint check table scan is
inherentlyconcurrent?
 

Right. "alter table validate constraint" can not use indexes, but does not block concurrent read/write queries. Other
queriesin this scenario can not use indexes too, but should be fast.
 

> - Was this new behavior mentioned in the release nose?

Yes, small note in documentation and small note in release notes https://www.postgresql.org/docs/12/release-12.html
thisone:
 

> Allow ALTER TABLE ... SET NOT NULL to avoid unnecessary table scans (Sergei Kornilov)
> This can be optimized when the table's column constraints can be recognized as disallowing nulls.

> - Do you know if there are any blog posts etc. discussing this? (I'm definitely going to write one!!)

I do not know. Personally, I mentioned this feature in only a few Russian-speaking communities. And right now I wrote
answerin dba.SO.
 

regards, Sergei



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: password_encryption default
Next
From: Stephen Frost
Date:
Subject: Re: password_encryption default