Re: ADD COLUMN ts tsvector GENERATED too slow

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ADD COLUMN ts tsvector GENERATED too slow
Дата
Msg-id 20220706113333.leh3lnzkvzn2dgbo@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: ADD COLUMN ts tsvector GENERATED too slow  (Florents Tselai <florents.tselai@gmail.com>)
Список pgsql-general
On 2022-Jul-06, Florents Tselai wrote:

> Actually, I monitored my disk usage and it was **definitely** working as 
> It had already eaten up an additional 30% of my disk capacity.

Adding a column like this requires creating a second copy of the table,
copying all the contents from the old table (plus the new column) into
the new one, then recreating all indexes from scratch on the new copy of
the table.  If you have a lot of indexes, this can be significant.
Also, AFAIU all data has to be uncompressed on read, then compressed
back on write.

Note: the 80 GB from pg_relation_size() does *not* include the size of
TOAST data.  You're copying a lot of additional data.  See
pg_table_size().

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)



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

Предыдущее
От: Florents Tselai
Дата:
Сообщение: Re: ADD COLUMN ts tsvector GENERATED too slow
Следующее
От: Ludwig Isaac Lim
Дата:
Сообщение: Error when pasting function blocks into psql