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

Re: vacuum full

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gry(at)ll(dot)mit(dot)edu
Cc: "Henrik Steffen" <steffen(at)city-map(dot)de>,pgsql-performance(at)postgresql(dot)org
Subject: Re: vacuum full
Date: 2002-11-21 19:21:24
Message-ID: 13677.1037906484@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
george young <gry(at)ll(dot)mit(dot)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

In response to

pgsql-performance by date

Next:From: typeaDate: 2002-11-21 19:21:26
Subject: Re: Query Analysis
Previous:From: scott.marloweDate: 2002-11-21 19:12:35
Subject: Re: vacuum full

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