Re: serious problems with vacuuming databases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: serious problems with vacuuming databases
Date: 2006-04-09 18:53:57
Message-ID: 12734.1144608837@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tomas Vondra <tv(at)fuzzy(dot)cz> writes:
> 1) drop, create and fill table B (aggregated data from A, C, D)
> 2) copy 'old' data from A, C and D to A_old, C_old a D_old
> 3) delete old data from A, C, D
> 4) dump data from A_old, C_old and D_old
> 5) truncate tables A, C, D
> 6) vacuum full analyze tables A, C, D, A_old, C_old and D_old

Steps 3/5/6 make no sense at all to me: why bother deleting data retail
when you are about to truncate the tables, and why bother vacuuming a
table you just truncated? Is the above *really* what you did?

> The problem is this - today, we run a scheduled VACUUM FULL ANALYZE for
> the whole database, and it runs for about 10 hours already, which is
> much more than usual (and it is still running).

Is it actually grinding the disk, or is it just blocked waiting for
someone's lock? If it's actually doing work, which table is it working
on? (You should be able to figure that out by looking in pg_locks,
or by strace'ing the process to see which files it's touching.)

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2006-04-09 20:24:44 Re: Scaling up PostgreSQL in Multiple CPU / Dual Core
Previous Message Alvaro Herrera 2006-04-09 18:37:47 Re: serious problems with vacuuming databases