The list of all the queries

Percentage of the total index storage size from the total database storage size (system catalog included)

Query goal: Get overview of disk usage.
Query type: Sofware measure (Numeric values (software measures) about the database)
Query license: MIT License
Data source: system catalog only
SQL query: Click on query to copy it

WITH database_size AS (SELECT pg_database_size(current_database()) AS database_total_size),
index_size AS (SELECT Sum(pg_total_relation_size(c.oid)) AS index_total_size
FROM pg_class c
WHERE c.relkind IN ('i','I'))
SELECT pg_size_pretty(database_total_size) AS database_total_size, 
pg_size_pretty(index_total_size) AS index_total_size,
Round(index_total_size*100/database_total_size, 1)  AS percentage_of_index_size_from_total_size
FROM database_size, index_size;

Collections where the query belongs to

Collection nameCollection description
Find problems by overviewQueries that results point to different aspects of database that might have problems. A human reviewer has to decide based on the results as to whether there are problems or not .

Categories where the query belongs to

Category nameCategory description
Data at the database physical levelQueries of this category provide information about the disk usage.

The list of all the queries