Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6CD8E9FB20F for ; Thu, 19 Oct 2006 08:33:02 -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 77414-08 for ; Thu, 19 Oct 2006 08:32:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web55915.mail.re3.yahoo.com (web55915.mail.re3.yahoo.com [216.252.110.76]) by postgresql.org (Postfix) with SMTP id 9CD3B9FB1FE for ; Thu, 19 Oct 2006 08:32:58 -0300 (ADT) Received: (qmail 59573 invoked by uid 60001); 19 Oct 2006 11:32:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.ca; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=xIbDcxKi/U/Z1p7/WHWTnSAFPjuhKyeFtFOAMk6x3hvm9dbSbUeLl0mjMy3WcknUNFgXGW8HVc1jZJYgXtC6Nsn1PvZ4+fhSxmh+mX85X8eL8HRV8GY6f4B3T07a2sPgRICUf/ErfGhUq48HCvJKoSkVgCo+oUQjqbJwksYczXM= ; Message-ID: <20061019113256.59571.qmail@web55915.mail.re3.yahoo.com> Received: from [70.29.94.36] by web55915.mail.re3.yahoo.com via HTTP; Thu, 19 Oct 2006 07:32:56 EDT Date: Thu, 19 Oct 2006 07:32:56 -0400 (EDT) From: Ioana Danes Subject: Re: Postgresql 8.1.4 - performance issues for select on To: "Jim C. Nasby" , Jeff Davis Cc: Dimitri Fontaine , pgsql-performance@postgresql.org In-Reply-To: <20061018223551.GD56874@nasby.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200610/393 X-Sequence-Number: 21522 Hi, I tried and this does does not work either. Thank you, Ioana --- "Jim C. Nasby" wrote: > On Wed, Oct 18, 2006 at 03:32:15PM -0700, Jeff Davis > wrote: > > On Wed, 2006-10-18 at 17:10 -0500, Jim C. Nasby > wrote: > > > Sorry, don't have the earlier part of this > thread, but what about... > > > > > > SELECT greatest(max(a), max(b)) ... > > > > > > ? > > > > To fill you in, we're trying to get the max of a > union (a view across > > two physical tables). > > UNION or UNION ALL? You definitely don't want to do > a plain UNION if you > can possibly avoid it. > > > It can be done if you're creative with the query; > I suggested a query > > that selected the max of the max()es of the > individual tables. Your > > query could work too. However, the trick would be > getting postgresql to > > recognize that it can transform "SELECT max(x) > FROM foo" into that, > > where foo is a view of a union. > > > > If PostgreSQL could sort the result of a union by > merging the results of > > two index scans, I think the problem would be > solved. Is there something > > preventing this, or is it just something that > needs to be added to the > > planner? > > Hrm... it'd be worth trying the old ORDER BY ... > LIMIT 1 trick just to > see if that worked in this case, but I don't have > much hope for that. > -- > Jim Nasby > jim@nasby.net > EnterpriseDB http://enterprisedb.com > 512.569.9461 (cell) > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com