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: Busser, Jim
Subject: Re: [Gnumed-devel] Help menu > About database � size
Date: Fri, 2 Aug 2013 18:09:18 +0000

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 about 707 Mb. Might this be able to be related to some useful concept 
of "how big is my database", which is nearly 3 times as large as a combined 
'database + roles' backup, for example in my case

--> 252 Mb

        
backup-gnumed_v18-GNUmed_Team-MacBook-2.local-2013-07-17-13-48-15-database.sql

--> 530 bytes

        backup…roles.sql

-- Jim


-- Jim

reply via email to

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