Performanceversion 1.5.3
pg_repack
Remove table and index bloat without long locks.
What it is for
pg_repack rebuilds a bloated table or index online, holding an exclusive lock only briefly at the start and end, where VACUUM FULL locks the table for the whole rebuild.
Enable it
create extension if not exists pg_repack with schema extensions;Example
create extension if not exists pg_repack;
-- then, from a machine with the pg_repack client:
-- pg_repack --table=public.events --dbname="$DATABASE_URL"Notes
- The rebuild is driven by the pg_repack command-line client over a direct Postgres connection. Direct connections from the internet are not open on hosted projects yet, so today the extension can be turned on but not driven from outside.
Questions
How do I enable pg_repack?
Run create extension if not exists pg_repack with schema extensions; in the SQL editor, or switch it on from the Extensions page in the console. You do not need superuser access.
Which version of pg_repack is installed?
1.5.3, on Postgres 17.6, as read from the running engine on 2026-10-08. Check yours with: select extversion from pg_extension where extname = 'pg_repack';
Upstream project: github.com/reorg/pg_repack
More performance extensions
- pg_stat_statements Timing and call counts for every query shape (Insights reads it).
- hypopg Try an index without building it, to see if the planner would use it.
- index_advisor Suggest the indexes that would speed up a query.