Re: db size and tables size difference

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: isabella(dot)ghiurea(at)nrc-cnrc(dot)gc(dot)ca
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: db size and tables size difference
Date: 2009-09-23 15:55:39
Message-ID: 2305.1253721339@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Isabella Ghiurea <isabella(dot)ghiurea(at)nrc-cnrc(dot)gc(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Isabella Ghiurea 2009-09-23 16:24:21 Re: db size and tables size difference
Previous Message Isabella Ghiurea 2009-09-23 15:47:10 Re: db size and tables size difference