How to reclaim disk space after delete without rebuilding table?
-
02-11-2019 - |
Frage
Our PostgreSQL 9.0 Windows production server is running low on space.
In our 100GB database, we have a large table containing TOASTed binary data. We have deleted some rows and need to return the space to the O/S.
We do not have enough space to do a full rewrite of the table, and all my reading of CLUSTER
, VACUUM FULL
and pg_repack
is that they need to rewrite the table. My google-fu has been insufficient so far to find anything else.
Some downtime is acceptable (~2 hours), however the backup/restoration is too slow for our purposes, nor am I keen on dropping the database in between steps.
QUESTION: How can I return the disk space to the O/S without doing a full table rewrite?
(This is a production server so any solutions must be reputable/recommended/supported etc).
(P.S. A separate much larger disk is available which could be used, if the table could be rebuilt on it somehow. Tablespaces?)
Keine korrekte Lösung