pg_rowcount a script to see rows and size of tables

Here is a little perl script that I use to give me a list of tables in a schema, a rowcount and the pg_relation_size of a table.

The usage is just:

pg_rowcount <database> <schema>

The output looks like this:

./pg_rowcount.pl david.kerr pg_catalog
Table                                Rows                 Size
--------------------------------------------------------------
pg_statistic                         1853              1672 kB
pg_type                               910               168 kB
pg_attribute                         9569              1488 kB
pg_class                             1371               416 kB
pg_authid                              52                16 kB
pg_index                              766               112 kB
pg_operator                           705               104 kB
pg_database                            44                16 kB
[...]

You can download the script here


0 Responses to pg_rowcount a script to see rows and size of tables

  1. There are currently no comments.

Leave a Reply



About

Random Database, OS or otherwise interesting tips and tricks.

User


Clicky Web Analytics