Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A98A69FA2F5 for ; Thu, 19 Oct 2006 14:23:04 -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 11974-04 for ; Thu, 19 Oct 2006 14:22:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 83B489FA5D8 for ; Thu, 19 Oct 2006 14:22:53 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id D736A56435; Thu, 19 Oct 2006 12:22:52 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 19 Oct 2006 12:22:50 -0500 Date: Thu, 19 Oct 2006 12:22:50 -0500 From: "Jim C. Nasby" To: Richard Huxton Cc: Jens Schipkowski , pgsql-performance@postgresql.org Subject: Re: DB Performance decreases due to often written/accessed Message-ID: <20061019172249.GT71084@nasby.net> References: <453791E6.4020600@archonet.com> <4537B394.9000205@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4537B394.9000205@archonet.com> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061019:dev@archonet.com::Rb8kAthEXDnH9T81:03m6g X-Hashcash: 1:20:061019:jens.schipkowski@apus.co.at::0wU3KMh+UEmR1FeQ:0000000000 0000000000000000000000001Qv6 X-Hashcash: 1:20:061019:pgsql-performance@postgresql.org::42gwWuyBBmL8PTcB:00000 0000000000000000000000000lqS X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.044 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/415 X-Sequence-Number: 21544 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. > 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). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)