X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C7D5E11F61CF for ; Sun, 9 Apr 2006 15:54:03 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.126 X-Spam-Level: X-Spam-Status: No, score=0.126 required=5 tests=[AWL=0.126] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id tZodDwCCek4V for ; Sun, 9 Apr 2006 15:53:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D4F1811F65E2 for ; Sun, 9 Apr 2006 15:53:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k39Irv76012735; Sun, 9 Apr 2006 14:53:57 -0400 (EDT) To: Tomas Vondra cc: pgsql-performance@postgresql.org Subject: Re: serious problems with vacuuming databases In-reply-to: <443950FB.4050707@fuzzy.cz> References: <443950FB.4050707@fuzzy.cz> Comments: In-reply-to Tomas Vondra message dated "Sun, 09 Apr 2006 20:22:51 +0200" Date: Sun, 09 Apr 2006 14:53:57 -0400 Message-ID: <12734.1144608837@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/179 X-Sequence-Number: 18263 Tomas Vondra 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