using index or check in ALTER TABLE SET NOT NULL

Поиск
Список
Период
Сортировка
От Sergei Kornilov
Тема using index or check in ALTER TABLE SET NOT NULL
Дата
Msg-id 81911511895540@web58j.yandex.ru
обсуждение исходный текст
Ответы Re: using index or check in ALTER TABLE SET NOT NULL
Список pgsql-hackers
Hello
I write patch to speed up ALTER TABLE SET NOT NULL by check existed check constraints or indexes. Huge phase 3 with
verifytable data will be skipped if table has valid check constraint cover "alteredfield IS NOT NULL" condition or by
SPIquery if found index with compatible condition or regular amsearchnulls index on processed field.
 

Patch based on current master branch, i believe it has no platform-dependent code, of course code compiled and pass
testslocally.
 
Tell me please, what i forgot or make incorrectly.

Implementation notes:
I use existed PartConstraintImpliedByRelConstraint method to check relation constraints. But i rename original method
tostatic ConstraintImpliedByRelConstraint (because method now used not only in partitions) and leave
PartConstraintImpliedByRelConstraintas proxy to not change public API.
 
I found it difficult to do index scan and choose index with lower costs if found many suitable indexes. Is it
acceptableto use SPI here?
 

Related archive discussions:
https://www.postgresql.org/message-id/flat/530C10CF.4020101%40strangersgate.com
https://www.postgresql.org/message-id/flat/CAASwCXdAK55BzuOy_FtYj2zQWg26PriDKL5pRoWiyFJe0eg-Hg%40mail.gmail.com

Thanks!
Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Transaction control in procedures
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: Updated macOS start scripts