Re: feature idea: use index when checking for NULLs before SET NOT NULL

Поиск
Список
Период
Сортировка
От Sergei Kornilov
Тема Re: feature idea: use index when checking for NULLs before SET NOT NULL
Дата
Msg-id 11131101590757378@mail.yandex.ru
обсуждение исходный текст
Ответ на Re: feature idea: use index when checking for NULLs before SET NOT NULL  ("John Bachir" <j@jjb.cc>)
Ответы Re: feature idea: use index when checking for NULLs before SET NOT NULL  ("John Bachir" <j@jjb.cc>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: password_encryption default
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: password_encryption default