To-Do item: skip table scan for adding column with provable check constraints

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема To-Do item: skip table scan for adding column with provable check constraints
Дата
Msg-id CAMkU=1z5vXZ8Txd9_8hvNFovtbGuP4VTitFRN59XDncEHVGtJA@mail.gmail.com
обсуждение исходный текст
Ответы Re: To-Do item: skip table scan for adding column with provable check constraints  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
I recently had to run something like:

alter table pgbench_accounts add locked text check (locked != 'unlocked');

And was surprised that it took several minutes to complete as it
scanned the whole table.

The new column is going to start out as NULL in every row, so there is
no need to validate the check constraint by reading the table as it
can be proven from first principles.  Correct?

Is there a reason such an improvement would be unwanted or not
feasible?  If not, I will add as a To-Do item.

Cheers,

Jeff



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

Предыдущее
От: David Christensen
Дата:
Сообщение: Re: [PATCH] Add EXPLAIN (ALL) shorthand
Следующее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: Re: foreign table batch inserts