Re: db size and tables size difference - Mailing list pgsql-admin

From Tom Lane
Subject Re: db size and tables size difference
Date
Msg-id 2305.1253721339@sss.pgh.pa.us
Whole thread Raw
In response to Re: db size and tables size difference  (Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>)
List pgsql-admin
Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca> writes:
> SELECT nspname || '.' || relname AS
> "relation",pg_size_pretty(pg_total_relation_size(nspname || '.' ||
> relname)) AS "s
> ize"
>   FROM pg_class C
>   LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
>   ORDER BY pg_relation_size(nspname || '.' || relname) DESC
>   LIMIT 20;

I think maybe you'd better ORDER BY pg_total_relation_size instead.
Also, maybe look further than 20 rows ... maybe the issue is many
thousands of little tables?

            regards, tom lane

pgsql-admin by date:

Previous
From: Isabella Ghiurea
Date:
Subject: Re: db size and tables size difference
Next
From: Isabella Ghiurea
Date:
Subject: Re: db size and tables size difference