Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id E36749FB20F for ; Thu, 19 Oct 2006 08:43:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 18925-06 for ; Thu, 19 Oct 2006 11:43:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web55911.mail.re3.yahoo.com (web55911.mail.re3.yahoo.com [216.252.110.72]) by postgresql.org (Postfix) with SMTP id 65EEC9FB1FE for ; Thu, 19 Oct 2006 08:43:56 -0300 (ADT) Received: (qmail 40673 invoked by uid 60001); 19 Oct 2006 11:43:55 -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=ZrcHpdQormo6Y+dvJuPfVwUl4CJf+qWLaCzUBdcLmne0A/PStM+TPbbaAvZZs0ffSsAGvePHd7xfXFhBqNz3iBqjz59jc2xTI64aJhltrV60CWo4nGsPsWlWdUAbd07BmLacE0MPQnaO4VEs4m316RvfAowqgCwUTHo+hiUy5Iw= ; Message-ID: <20061019114355.40671.qmail@web55911.mail.re3.yahoo.com> Received: from [70.29.94.36] by web55911.mail.re3.yahoo.com via HTTP; Thu, 19 Oct 2006 07:43:55 EDT Date: Thu, 19 Oct 2006 07:43:55 -0400 (EDT) From: Ioana Danes Subject: Re: Postgresql 8.1.4 - performance issues for select on To: Tom Lane , Jeff Davis Cc: "Jim C. Nasby" , Dimitri Fontaine , pgsql-performance@postgresql.org In-Reply-To: <2694.1161212717@sss.pgh.pa.us> 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/394 X-Sequence-Number: 21523 Hello, It looks like some of you missed my first email but my problem is not to find a replacement for this select: select max(transid) from someunionview Thare are plenty of solutions for doing this... My point is to split a tale in two and to make this transparent for the developers as a first step. On the second step they will improve some of the queries but that is another story. So I would like to know if there is any plan to improve this type of query for views in the near future, or maybe it is alredy improved in 8.2 version? I have the same problem and question for: select transid from someunionview order by transid desc limit 1; Thank you for your time, Ioana Danes --- Tom Lane wrote: > Jeff Davis writes: > > 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? > > It's something on the wish-list. Personally I'd be > inclined to try to > rewrite the query as a plain MAX() across rewritten > per-table indexed > queries, rather than worry about mergesort or > anything like that. > There wasn't any very good way to incorporate that > idea when planagg.c > was first written, but now that the planner has an > explicit notion of > "append relations" it might be relatively > straightforward. > > regards, tom lane > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: explain analyze is your friend > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com