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 BB27FD1B8BD for ; Fri, 29 Aug 2003 16:07:04 +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 34680-07 for ; Fri, 29 Aug 2003 13:06:34 -0300 (ADT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by svr1.postgresql.org (Postfix) with ESMTP id 1BE0CD1B8E0 for ; Fri, 29 Aug 2003 13:06:33 -0300 (ADT) Received: (qmail 1736 invoked from network); 29 Aug 2003 16:06:32 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 16:06:32 -0000 Message-ID: <3F4F7A07.30404@speakeasy.org> Date: Fri, 29 Aug 2003 09:06:31 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates 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> In-Reply-To: <20030829040519.GA5746@wolff.to> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/501 X-Sequence-Number: 3317 Bruno Wolff III wrote: > 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? Ken