gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Help menu > About database � size


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Help menu > About database � size
Date: Fri, 2 Aug 2013 22:08:21 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Aug 02, 2013 at 06:09:18PM +0000, Jim Busser wrote:

> On 2013-08-02, at 10:56 AM, Jim Busser <address@hidden> wrote:
> 
> > Given the limitations you describe, maybe better is pg_total_relation_size 
> > which
> > 
> >     'sums total disk space used by the table including indexes and toasted 
> > data'
> > 
> > which can be gained from the following adapted from 
> > http://stackoverflow.com/a/2596678
> > 
> >     SELECT pg_size_pretty(CAST(SUM(size) AS bigint)) FROM (SELECT 
> > table_schema || '.' || table_name AS table_full_name,
> >     pg_total_relation_size('"' || table_schema || '"."' || table_name || 
> > '"') AS size
> >     FROM information_schema.tables
> >     ORDER BY pg_total_relation_size ('"' || table_schema || '"."' || 
> > table_name || '"') DESC
> >     ) AS foo2 ;
> 
> … but which, in the end, gives me the same result as the original
> 
>       SELECT pg_size_pretty(pg_database_size('gnumed_v18'));

Which is what the bootstrapper already does :-)

> which is about 707 Mb. Might this be able to be related to
> some useful concept of "how big is my database",

Sure, but not to "how big will a backup be" :-)

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]