Обсуждение: Truncating table in PSQL reclaims hard disk?

Поиск
Список
Период
Сортировка

Truncating table in PSQL reclaims hard disk?

От
Freeda Suing
Дата:
Hi,

Does truncating a table automatically re-claim the hard disk or do I need to initiate vacuum after the truncate.

Thanks

Re: Truncating table in PSQL reclaims hard disk?

От
s d
Дата:


On 24 August 2015 at 13:07, Freeda Suing <freeda.suing@gmail.com> wrote:
Hi,

Does truncating a table automatically re-claim the hard disk or do I need to initiate vacuum after the truncate.

Thanks

TRUNCATE quickly removes all rows from a set of tables. It has the same effect as an unqualified DELETE on each table, but since it does not actually scan the tables it is faster. Furthermore, it reclaims disk space immediately, rather than requiring a subsequent VACUUM operation. This is most useful on large tables.

Regards,
Sandor