T
T
tisprk2020-06-15 11:47:51
PostgreSQL
tisprk, 2020-06-15 11:47:51

Is there a difference for autovacuum how the rows were removed from the table?

Good afternoon!
There is a task to periodically clear the table (from 500 thousand lines to one million).
Is there a difference for autovacuum processes, how to clear the table: through delete or through trancate?
Will autovacuum start the same way with both removal methods?
DBMS PostgreSQL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2020-06-15
@tisprk

Autovacuum will not start after truncate. Because why? There's an empty new relfilenode for the table and all indexes, what's there to vacuum?
If all the data is not needed from the table, then truncate (or drop table) is incalculably easier and faster for the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question