4 ms·
A vacuum full basically does this for a table, copying the data from location A to location B, cleaning up junk. I think index rebuilding may take a separate co
by brianwawok 6y ago
A vacuum full basically does this for a table, copying the data from location A to location B, cleaning up junk. I think index rebuilding may take a separate command?
- Tostino 6y agoVacuum full does a index rebuild automatically. Since a vacuum full builds an entire new heap table, the old indexs are all pointing to the incorrect locations for all tuples, so it has no choice but to rebuild.
- brianwawok 6y agoExcellent there you go. Is there a way to just do the index build part, short of dropping an index and adding it back?
- jvolkman 6y agoI believe pg_repack can do that.
- Jedd 6y agoThis is described about a quarter the way into TFA. > REINDEX INDEX CONCURRENTLY index_name; (A vanilla REINDEX will lock the table, preventing writes, while it runs. The CONCURRENT creates a new index, replicates any updates to the original while it does so, and then does an atomic switcheroo at the end.)