Re: Document atthasmissing default optimization avoids verification table scan

Поиск
Список
Период
Сортировка
От Bossart, Nathan
Тема Re: Document atthasmissing default optimization avoids verification table scan
Дата
Msg-id 90098862-68F6-4C57-B924-EF61CB12AAB3@amazon.com
обсуждение исходный текст
Ответ на Document atthasmissing default optimization avoids verification table scan  (James Coleman <jtc331@gmail.com>)
Ответы Re: Document atthasmissing default optimization avoids verification table scan  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 9/24/21, 7:30 AM, "James Coleman" <jtc331@gmail.com> wrote:
> When PG11 added the ability for ALTER TABLE ADD COLUMN to set a constant
> default value without rewriting the table the doc changes did not note
> how the new feature interplayed with ADD COLUMN DEFAULT NOT NULL.
> Previously such a new column required a verification table scan to
> ensure no values were null. That scan happens under an exclusive lock on
> the table, so it can have a meaningful impact on database "accessible
> uptime".

I'm likely misunderstanding, but are you saying that adding a new
column with a default value and a NOT NULL constraint used to require
a verification scan?

+     Additionally adding a column with a constant default value avoids a
+     a table scan to verify no <literal>NULL</literal> values are present.

Should this clarify that it's referring to NOT NULL constraints?

Nathan


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work
Следующее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message