VACUUM
s, which can either be run manually or automatically by Postgres autovacuum,
are responsible for marking the space occupied by dead segments as “free for reuse” by future INSERT
/UPDATE
/COPY
statements.
A DELETE
statement does not create free space on its own. To control the index size, it is important to either:
postgresql.conf
such that vacuums occur at a frequency that is acceptable for your write patterns. Please refer to the Postgres documentation for guidance.VACUUM
between large INSERT
/UPDATE
/DELETE
/COPY
statements.REINDEX
. Vacuums on their own do not decrease the
index size — they only mark space for reuse.