size in bytes of a table?

Поиск
Список
Период
Сортировка
Искать

size in bytes of a table?

От:
Mark Harrison <mh@pixar.com>
Дата:
I'd like to present some statistics on our database tables,
showing the number of rows and approximate amount of data
in bytes, e.g. something like this from one of our other
databases:

tasks  (546916 Kb,62018 rows)

Exact numbers don't matter, I just want to present a feel
for the amount of data we have.

Thanks!
Mark

-- 
Mark Harrison
Pixar Animation Studios

Re: size in bytes of a table?

От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Fri, Feb 11, 2005 at 10:20:47AM -0800, Mark Harrison wrote:

> I'd like to present some statistics on our database tables,
> showing the number of rows and approximate amount of data
> in bytes, e.g. something like this from one of our other
> databases:
> 
> tasks  (546916 Kb,62018 rows)

Take a look at contrib/dbsize and contrib/pgstattuple.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: size in bytes of a table?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Mark Harrison  writes:
> I'd like to present some statistics on our database tables,
> showing the number of rows and approximate amount of data
> in bytes, e.g. something like this from one of our other
> databases:

> tasks  (546916 Kb,62018 rows)

> Exact numbers don't matter, I just want to present a feel
> for the amount of data we have.

Do a vacuum and then SELECT relname, relpages * 8K, reltuples FROM pg_class

			regards, tom lane
FAQ