Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 833599FCB82 for ; Thu, 8 Nov 2007 10:56:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 73471-05 for ; Thu, 8 Nov 2007 10:56:45 -0400 (AST) Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id EB58B9FCB7A for ; Thu, 8 Nov 2007 10:56:50 -0400 (AST) Received: from alvh.no-ip.org (200-85-205-122.bk3-dsl.surnet.cl [200.85.205.122]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.7) with ESMTP id lA8Eundu009099; Thu, 8 Nov 2007 06:56:50 -0800 Received: by alvh.no-ip.org (Postfix, from userid 1000) id EF673560142; Thu, 8 Nov 2007 11:56:46 -0300 (CLST) Date: Thu, 8 Nov 2007 11:56:46 -0300 From: Alvaro Herrera To: Rafael Martinez Cc: pgsql-performance@postgresql.org Subject: Re: Need to run CLUSTER to keep performance Message-ID: <20071108145646.GI2938@alvh.no-ip.org> Mail-Followup-To: Rafael Martinez , pgsql-performance@postgresql.org References: <4732E6B4.1030907@usit.uio.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4732E6B4.1030907@usit.uio.no> User-Agent: Mutt/1.5.16 (2007-06-11) X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 08 Nov 2007 06:56:51 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/97 X-Sequence-Number: 27512 Rafael Martinez wrote: > Hello > > This is a question about something we have seen sometimes in the last > months. It happens with tables with a large amount of updates/selects > compared with the amount of inserts/deletes. The sizes of these tables > are small and the amount of rows too. > > The 'problem' is that performance decrease during the day and the only > thing that helps is to run CLUSTER on the table with problems. VACUUM > ANALYZE does not help. Probably because all the live tuples are clustered at the end of the table, and the initial pages are polluted with dead tuples. Try vacuuming the table much more often, say every few minutes. Your table is 2536 pages long, but it could probably be in the vicinity of 700 ... -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support