ankane / pghero

A performance dashboard for Postgres
MIT License
8.16k stars 452 forks source link

Show space usage for materialized views #485

Closed fatkodima closed 8 months ago

fatkodima commented 10 months ago

Currently, the "Space" section contains space info only about tables and indexes, but not materialized views, even though that indexes for materialized views are already shown. This PR fixes that.

I have a few other improvement ideas to this gem:

  1. Add some info about indexes on columns having a very high NULL fraction (pg_stats.null_frac), or indexes on columns with a high % of the same value (pg_stats.most_common_freqs), or indexes on boolean columns? These indexes should be made partial or removed.
  2. Show also space occupied by partitioned tables.
  3. Add to the "Space" section for tables a column showing its size with all its indexes. Or this can be a clickable link from the "Space" section for tables that show a new view with this info and some other details

Can help with PRs.

ankane commented 8 months ago

Thanks @fatkodima! Happy to include 2 as well.