Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DEC7C9FB295 for ; Thu, 19 Oct 2006 15:00:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 23272-03 for ; Thu, 19 Oct 2006 15:00:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id CCDCD9FB2BE for ; Thu, 19 Oct 2006 15:00:17 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 9715E739D0; Thu, 19 Oct 2006 19:00:07 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id ABE654DB39; Thu, 19 Oct 2006 19:00:05 +0100 (BST) Message-ID: <4537BD3C.7090402@archonet.com> Date: Thu, 19 Oct 2006 19:00:28 +0100 From: Richard Huxton User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: "Jim C. Nasby" Cc: Jens Schipkowski , pgsql-performance@postgresql.org Subject: Re: DB Performance decreases due to often written/accessed References: <453791E6.4020600@archonet.com> <4537B394.9000205@archonet.com> <20061019172249.GT71084@nasby.net> In-Reply-To: <20061019172249.GT71084@nasby.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.427 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/417 X-Sequence-Number: 21546 Jim C. Nasby wrote: > On Thu, Oct 19, 2006 at 06:19:16PM +0100, Richard Huxton wrote: >> OK - these plans look about the same, but the time is greatly different. >> Both have rows=140247 as the estimated number of rows in tbl_reg. Either >> you have many more rows in the second case (in which case you're not >> running ANALYSE enough) or you have lots of gaps in the table (you're >> not running VACUUM enough). > > Look closer... the actual stats show that the sorts in the second case > are returning far more rows. And yes, analyze probably needs to happen. The results are different, I agree, but the plans (and estimates) are the same. Given the deletes and inserts I wasn't sure whether this was just lots more rows or a shift in values. >> I'd then try putting an index on (attr1,attr2,attr3...attr6) and see if >> that helps reduce time. > > With bitmap index scans, I think it'd be much better to create 6 indexes > and see which ones actually get used (and then drop the others). Good idea. -- Richard Huxton Archonet Ltd