Skip site navigation (1) Skip section navigation (2)

Re: psql show dbsize?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: andy <andy(at)squeakycode(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql show dbsize?
Date: 2007-10-31 20:56:38
Message-ID: 4728EC06.80105@hagander.net (view raw or flat)
Thread:
Lists: pgsql-hackers
andy wrote:
> I know its way too late in the game, sorry, but it's a very small patch...
> 
> I was wondering if this could be added to 8.3: it adds the dbsize to \l
> in psql.

8.3 is many months beyond feature-freeze, so no, that's not likely to
happen.


> It looks like this:
> 
>              List of databases
>    Name    |  Owner   | Encoding | Dbsize
> -----------+----------+----------+---------
>  andy      | andy     | LATIN1   | 4255 kB
>  cramd     | andy     | LATIN1   | 526 MB
>  postgres  | postgres | LATIN1   | 4263 kB
>  template0 | postgres | LATIN1   | 4136 kB
>  template1 | postgres | LATIN1   | 4255 kB
> (5 rows)
> 
> 
> pretty nice, huh?

Not sure I like it at all. You've just turned \l from something that's
essentially free (a lookup in pg_database, which is very likely to be
either cached or at least very small) to something that can carry a
significant I/O cost if you have a lot of/large databases.

//Magnus

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2007-10-31 21:15:33
Subject: Re: A small rant about coding style for backend functions
Previous:From: Bruce MomjianDate: 2007-10-31 20:12:51
Subject: Re: AutoVacuum Behaviour Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group