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

Поиск
Список
Период
Сортировка
От Darafei "Komяpa" Praliaskouski
Тема Re: feature idea: use index when checking for NULLs before SET NOT NULL
Дата
Msg-id CAC8Q8tLqfDWACiGhi3WQac1h4SyHGSOYy6t88F=6aMB4cuwaSA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: feature idea: use index when checking for NULLs before SET NOT NULL  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
Список pgsql-hackers


John, I think it's worth pointing out that Postgres most likely does a full table scan to validate a constraint by design and not in optimization oversight.  Think of what's gonna happen if the index used for checking is corrupted?


This can't be true: a corrupted index is a failure mode, and failure modes are not expected in normal flow. Think of it this way: we must never use index scan, because if index is corrupted the results are going to be disastrous, so we will always do Seq Scans.

It's ok to assume index is not corrupted.

 

--
Darafei Praliaskouski

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: OpenSSL 3.0.0 compatibility
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Trouble with hashagg spill I/O pattern and costing