Quick Answer
pg_repack reorganizes tables and indexes online without holding an exclusive lock for most of the operation. Rebuilds the table in a new heap, migrates data in batches, tracks changes via triggers, then does a brief swap at the end. Reclaims bloat (like VACUUM FULL) without prolonged downtime. Use on bloated tables that you can't afford to lock. Requires the extension installed in the database.
Answer
pg_repack rebuilds tables and indexes without blocking writes, unlike VACUUM FULL, making it ideal for production cleanup.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.