Sphere
Log in Join
☆ 8

VACUUM is not freeing disk space

Deleted about 40 GB of rows from a Postgres table. VACUUM ran, but the table file is the same size. Is something wrong?

⚑ Report

3 replies

☆ 0
Y Yuki ·2026-11-01#1

VACUUM marks space reusable inside the table, it does not return it to the OS. Check pg_total_relation_size before and after by inserting new data.

⚑ Report
☆ 0
N Nate ·2026-11-01#2

We need the disk space back now. Is VACUUM FULL safe?

⚑ Report
☆ 0
E Emma ·2026-11-01#3

It rewrites the table and takes an exclusive lock. Schedule it. pg_repack is the usual online alternative.

⚑ Report
Log in to reply.