Обсуждение: database size question

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

database size question

От
Mija Lee
Дата:
Hi:

I have a discrepancy in database size that I don't quite understand. I'm
using postgres 8.1.3 on solaris 10. I have two databases on the same
machine - the production database and a staging database. The production
database is 9 GB, and growing fairly rapidly. Recently I did a dump and
restore of the production database to the staging database. The
recreated staging database was only 2 GB (approximately). There were no
errors in the reload.

I compared the two databases in terms of number of records, and then
actual table size. At first I thought that there was a problem with the
connection pool in the application which in turn was keeping large
temporary tables around. This was part of the problem but only accounted
for less than 1 GB of the difference. The real tables are different
sizes. The ones that seem to show the most difference are tables that
have the most churn: much of the data is deleted and reinserted nightly.

The database server has autovacuuming turned on, although the
application also vacuums on a schedule.

Anyone have ideas about why this might be, and what the solution is?

Mija



Re: database size question

От
"Sean Davis"
Дата:


On Dec 19, 2007 11:53 AM, Mija Lee <mija@scharp.org> wrote:
Hi:

I have a discrepancy in database size that I don't quite understand. I'm
using postgres 8.1.3 on solaris 10. I have two databases on the same
machine - the production database and a staging database. The production
database is 9 GB, and growing fairly rapidly. Recently I did a dump and
restore of the production database to the staging database. The
recreated staging database was only 2 GB (approximately). There were no
errors in the reload.

I compared the two databases in terms of number of records, and then
actual table size. At first I thought that there was a problem with the
connection pool in the application which in turn was keeping large
temporary tables around. This was part of the problem but only accounted
for less than 1 GB of the difference. The real tables are different
sizes. The ones that seem to show the most difference are tables that
have the most churn: much of the data is deleted and reinserted nightly.

The database server has autovacuuming turned on, although the
application also vacuums on a schedule.

You might want to do a vacuum verbose on some of the suspect tables to see how many dead tuples there actually are. 

Sean