SQL queries to estimate statistical bloat in PostgreSQL tables and btree indexes.
pgsql-bloat-estimation is a collection of SQL queries designed to estimate statistical bloat in PostgreSQL tables and btree indexes. It helps database administrators identify unused space caused by alignment padding, fillfactor settings, and actual bloat, enabling better storage management and maintenance planning. The tool provides metrics like extra size, bloat size, and percentages to assess database efficiency.
PostgreSQL database administrators and developers responsible for database performance, storage optimization, and maintenance tasks who need to monitor and reduce bloat.
It offers a lightweight, query-based approach to bloat estimation directly within PostgreSQL, without external dependencies, and includes accuracy flags to filter unreliable stats, making it a trusted tool for informed database upkeep.
Queries to mesure statistical bloat in indexes and tables for PostgreSQL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes an is_na column to filter out unreliable statistics, such as for 'name' types or missing stats, ensuring users know when to distrust the data, as noted in the caveats section.
Provides comprehensive fields like real_size, extra_size, bloat_size, and percentages, helping pinpoint exact storage inefficiencies in tables and btree indexes, with clear documentation on each metric.
Offers a faster query for index bloat analysis when executed by a superuser, improving performance for large databases, as specified in the btree bloat section.
Clearly documents limitations, such as issues with toasted fields and alignment padding, allowing informed interpretation of results, which is emphasized in the README's caveats.
Cannot accurately estimate bloat for toasted fields, as statistics don't account for compressed or sliced data, potentially leading to negative or underestimated bloat, a limitation admitted in the README.
Bloat estimates always include alignment padding, which is necessary CPU optimization space, not true bloat, requiring manual adjustment for accurate analysis, as warned in the caveats.
Requires running SQL queries manually without built-in automation or scheduling, making it less suitable for continuous monitoring compared to integrated tools.