X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5328BD1B8E0 for ; Fri, 29 Aug 2003 16:37:03 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38635-06 for ; Fri, 29 Aug 2003 13:36:31 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id E0E0BD1B8CC for ; Fri, 29 Aug 2003 13:36:28 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id 5209020F01; Fri, 29 Aug 2003 09:36:13 -0700 (PDT) Date: Fri, 29 Aug 2003 09:36:13 -0700 From: Sean Chittenden To: Ken Geis Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030829163613.GA51475@perrin.nxad.com> References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4F7A07.30404@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F7A07.30404@speakeasy.org> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/504 X-Sequence-Number: 3320 > >If you want both the max and the min, then things are going to be a > >bit more work. You are either going to want to do two separate > >selects or join two selects or use subselects. If there aren't > >enough prices per stock, the sequential scan might be fastest since > >you only need to go through the table once and don't have to hit > >the index blocks. > > > >It is still odd that you didn't get a big speed up for just the min though. > > I found I'm suffering from an effect detailed in a previous thread titled > > Does "correlation" mislead the optimizer on large tables? I don't know about large tables, but this is a big problem and something I'm going to spend some time validating later today. I think Manfred's patch is pretty good and certainly better than where we are but I haven't used it yet to see if it's the magic ticket for many of these index problems. -sc -- Sean Chittenden