Re: Dropping column from big table

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Dropping column from big table
Дата
Msg-id
CAKFQuwaHzz-BYGn7N4AMZ8QWy072eqMC-WQRwUFNNuOQeE19oQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table Adrian Klaver <adrian.klaver@aklaver.com>
Re: Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table Ron Johnson <ronljohnsonjr@gmail.com>
Re: Dropping column from big table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table Laurenz Albe <laurenz.albe@cybertec.at>
Re: Dropping column from big table "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Dropping column from big table Laurenz Albe <laurenz.albe@cybertec.at>
Re: Dropping column from big table "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Dropping column from big table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Dropping column from big table sud <suds1434@gmail.com>
Re: Dropping column from big table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Dropping column from big table Ron Johnson <ronljohnsonjr@gmail.com>


On Monday, July 15, 2024, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Monday, July 15, 2024, sud <suds1434@gmail.com> wrote:

However even with "vacuum full", the old rows will be removed completely from the storage , but the new rows will always be there with the 'dropped' column still existing under the hood along with the table storage,  with just carrying "null" values in it. […] Is this understanding correct?

No.  The table rewrite process involves creating new tuples that exactly conform to the current row specification.  The potentially non-null data present in live tuples for columns that have been dropped are not copied into the newly constructed tuples.



My bad, stopped at the code comment.  Apparently the data is just nulled, not removed, the current row descriptor contains those columns with “is dropped” and since this behavior doesn’t change the catalogs in this way the new ones must as well.  We just get the space back.

David J.
В списке pgsql-general по дате отправления
От: David G. Johnston
Дата:
От: sud
Дата:
FAQ