Pg_index
Audit Single vs Multi-Column Indexes in PostgreSQL
Apr 16, 2026 / · 4 min read · postgresql administration indexing database pg_index pg_class pg_namespace ·Audit Single vs Multi-Column Indexes in PostgreSQL Not all indexes are created equal. A single-column index covers one column and is simple to reason about. A multi-column (composite) index covers two or more columns and can serve a wider range of queries — but only when the leading columns match the query filter. As a …
Read MoreList PostgreSQL Object Comments with SQL
Apr 4, 2026 / · 6 min read · postgresql administration schema database pg_description pg_statio_all_tables information_schema pg_class pg_index pg_namespace pg_proc ·List PostgreSQL Object Comments with SQL pg_description is where PostgreSQL keeps every comment attached with COMMENT ON, whether the target is a table, a column, an index, or a function. Psql shows these comments, and so does any tool that reads the catalog, which makes them a cheap way to keep a schema …
Read MoreFind PostgreSQL Index Bloat and Wasted Space
Mar 31, 2026 / · 5 min read · postgresql performance indexing optimization database pg_class pg_index pg_namespace pg_stats pg_am pg_attribute pg_stat_user_indexes ·How to Find Index Bloat and Wasted Space in PostgreSQL Just like tables, PostgreSQL indexes can become bloated over time. When rows are updated or deleted, the old index entries are not removed immediately. They stay in the index as dead entries, wasting space and slowing down index scans. B-tree indexes are the most …
Read MoreFind Unused PostgreSQL Indexes with pg_stat_all_indexes
Apr 10, 2024 / · 7 min read · postgresql performance indexing index maintenance pg_stat_all_indexes pg_index pg_stat_database ·Find Unused PostgreSQL Indexes Before They Cost You Which indexes have gone unused since the statistics were last reset? pg_stat_all_indexes counts every index scan per index, and an index whose idx_scan is still zero after weeks of normal traffic is a candidate to drop. The query below lists those indexes, largest …
Read MoreIdentify Large PostgreSQL Indexes for Optimization
Mar 17, 2024 / · 9 min read · indexes storage optimization performance pg_index pg_class pg_namespace pg_tablespace pg_stat_user_indexes ·Find the Largest PostgreSQL Indexes by Size Which indexes are taking up the most disk in this database? pg_index joined to pg_class answers that in one query: every index with its table, schema, tablespace, size, and the command that would recreate it, sorted with the biggest first. It is the inventory step before any …
Read More