Re: vacuum full - Mailing list pgsql-performance

From Tom Lane
Subject Re: vacuum full
Date
Msg-id 13677.1037906484@sss.pgh.pa.us
Whole thread Raw
In response to Re: vacuum full  (george young <gry@ll.mit.edu>)
List pgsql-performance
george young <gry@ll.mit.edu> writes:
> Does someone know the right way to map from database name to
> data directory name?

pg_database.oid column.

However, that's definitely the hard way.  I'd just look at the relpages
column of pg_class, which should be reasonably accurate if you've done
a VACUUM or ANALYZE recently.  For example:

regression=# select relname, relkind, relpages from pg_class where
regression-# relname like 'tenk1%';
    relname    | relkind | relpages
---------------+---------+----------
 tenk1         | r       |      358
 tenk1_hundred | i       |       30
 tenk1_unique1 | i       |       30
 tenk1_unique2 | i       |       30
(4 rows)

Here we have a table and its three indexes, and the index sizes look
reasonable.  If the index sizes approach or exceed the table size,
you are probably suffering from index bloat --- try a reindex.

            regards, tom lane

pgsql-performance by date:

Previous
From:
Date:
Subject: Re: Query Analysis
Next
From: "Bjoern Metzdorf"
Date:
Subject: Re: [ADMIN] H/W RAID 5 on slower disks versus no raid on faster HDDs