Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id DD36A9FC076 for ; Wed, 20 Jun 2007 18:30:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 29428-03 for ; Wed, 20 Jun 2007 18:29:48 -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 0EF5D9FC086 for ; Wed, 20 Jun 2007 18:29:46 -0300 (ADT) Received: from localhost (silene.metacarta.com [65.77.47.18]) by silene.metacarta.com (Postfix) with ESMTP id EBD2E14C8743; Wed, 20 Jun 2007 17:29:43 -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 16612-06; Wed, 20 Jun 2007 17:29:42 -0400 (EDT) X-Auth-Received: from [192.168.1.109] (146-115-112-146.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com [146.115.112.146]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by silene.metacarta.com (Postfix) with ESMTP id 0E6CF14C86EF; Wed, 20 Jun 2007 17:29:42 -0400 (EDT) Message-ID: <46799C45.7080805@metacarta.com> Date: Wed, 20 Jun 2007 17:29:41 -0400 From: Karl Wright User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Shaun Thomas Cc: pgsql-performance@postgresql.org Subject: Re: Performance query about large tables, lots of concurrent access References: <4676DD57.7070304@metacarta.com> <20070620175300.GN30369@alvh.no-ip.org> <46796A08.8080601@metacarta.com> <200706201425.28557.sthomas@leapfrogonline.com> In-Reply-To: <200706201425.28557.sthomas@leapfrogonline.com> 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/451 X-Sequence-Number: 25484 Shaun Thomas wrote: > On Wednesday 20 June 2007 12:55:20 pm Karl Wright wrote: > > >>I am afraid that I did answer this. My largest tables >>are the ones continually being updated. The smaller >>ones are updated only infrequently. > > > You know, it actually sounds like you're getting whacked by the same > problem that got us a while back. It sounds like you weren't vacuuming > frequently enough initially, and then tried vacuuming later, only after > you noticed performance degrade. > > Unfortunately what that means, is for several weeks or months, Postgres > has not been reusing rows on your (admittedly) active and large tables; > it just appends at the end, and lets old rows slowly bloat that table > larger and larger. Indexes too, will suffer from dead pages. As > frightening/sickening as this sounds, you may need to dump/restore the > really huge table, or vacuum-full to put it on a crash diet, and then > maintain a strict daily or bi-daily vacuum schedule to keep it under > control. > A nice try, but I had just completed a VACUUM on this database three hours prior to starting the VACUUM that I gave up on after 27 hours. So I don't see how much more frequently I could do it. (The one I did earlier finished in six hours - but to accomplish that I had to shut down EVERYTHING else that machine was doing.) Karl > The reason I think this: even with several 200M row tables, vacuums > shouldn't take over 24 hours. Ever. Do a vacuum verbose and see just > how many pages it's trying to reclaim. I'm willing to wager it's > several orders of magnitude higher than the max_fsm_pages setting > you've stuck in your config file. > > You'll also want to see which rows in your 250M+ table are actually > active, and shunt the stable rows to another (warehouse) table maybe > available only via view or table partition. I mean, your most active > table is also the largest? Seems a bit backward, to me. >