Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3695B9FB90F for ; Tue, 19 Jun 2007 10:37:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 28329-04 for ; Tue, 19 Jun 2007 10:37:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from silene.metacarta.com (silene.metacarta.com [65.77.47.18]) by postgresql.org (Postfix) with ESMTP id C59839FB660 for ; Tue, 19 Jun 2007 10:37:15 -0300 (ADT) Received: from localhost (silene.metacarta.com [65.77.47.18]) by silene.metacarta.com (Postfix) with ESMTP id D636E14C8A56; Tue, 19 Jun 2007 09:37:13 -0400 (EDT) Received: from silene.metacarta.com ([65.77.47.18]) by localhost (silene.metacarta.com [65.77.47.18]) (amavisd-new, port 10024) with ESMTP id 10838-07; Tue, 19 Jun 2007 09:37:12 -0400 (EDT) X-Auth-Received: from [65.77.47.195] (dhcp-65-77-47-195.metacarta.com [65.77.47.195]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by silene.metacarta.com (Postfix) with ESMTP id 69CD314C8A63; Tue, 19 Jun 2007 09:37:11 -0400 (EDT) Message-ID: <4677DC06.3000300@metacarta.com> Date: Tue, 19 Jun 2007 09:37:10 -0400 From: Karl Wright User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Alvaro Herrera Cc: Tom Lane , pgsql-performance@postgresql.org Subject: Re: Performance query about large tables, lots of concurrent access References: <4676DD57.7070304@metacarta.com> <14291.1182221811@sss.pgh.pa.us> <4677B831.8060704@metacarta.com> <4677D298.2010109@metacarta.com> <20070619132643.GC4265@alvh.no-ip.org> In-Reply-To: <20070619132643.GC4265@alvh.no-ip.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at metacarta.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/335 X-Sequence-Number: 25368 Alvaro Herrera wrote: > Karl Wright wrote: > >> This particular run lasted four days before a VACUUM became essential. >> The symptom that indicates that VACUUM is needed seems to be that the >> CPU usage of any given postgresql query skyrockets. Is this essentially >> correct? > > Are you saying you weren't used to run VACUUM all the time? If so, > that's where the problem lies. > Postgresql 7.4 VACUUM runs for so long that starting it with a cron job even every 24 hours caused multiple instances of VACUUM to eventually be running in my case. So I tried to find a VACUUM schedule that permitted each individual vacuum to finish before the next one started. A vacuum seemed to require 4-5 days with this particular database - or at least it did for 7.4. So I had the VACUUM schedule set to run every six days. I will be experimenting with 8.1 to see how long it takes to complete a vacuum under load conditions tonight. Karl