postgres table and index bloat - ghdrako/doc_snipets GitHub Wiki
- https://github.com/ioguix/pgsql-bloat-estimation/blob/master/table/table_bloat.sql
- https://github.com/ioguix/pgsql-bloat-estimation/blob/master/btree/btree_bloat.sql
- https://github.com/reorg/pg_repack
- https://hakibenita.com/postgresql-unused-index-size
- https://github.com/ioguix/pgsql-bloat-estimation
- https://www.percona.com/blog/pg_repack-rebuild-postgresql-database-objects-online
- https://www.percona.com/blog/pg_repack-rebuild-postgresql-database-objects-online
- https://github.com/andyatkinson/pg_scripts/blob/main/top_updated_tables.sql
- https://docs.crunchybridge.com/insights-metrics/bloat-and-vacuum#
pgcompacttable
- https://github.com/dataegret/pgcompacttable It works by reordering tuples from the end of a table towards the front of a table, which allows the table size to shrink.
reindex
In PostgreSQL 12, REINDEX
gained support for the CONCURRENTLY
option. This works similarly to how pg_repack
does, but itโs native to PostgreSQL. By being native, it continues to receive improvements in newer versions.
REINDEX (VERBOSE) INDEX CONCURRENTLY index_trips_on_driver_id;
Providing a table name as an option to REINDEX performs a reindex for all indexes that are on the specified table.
REINDEX (VERBOSE) TABLE CONCURRENTLY trips;