Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2DB5AB5DBE6 for ; Wed, 22 Jun 2011 14:01:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 80976-08 for ; Wed, 22 Jun 2011 17:01:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id A33ACB5DBE1 for ; Wed, 22 Jun 2011 14:01:45 -0300 (ADT) Received: from [192.168.1.7] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0McnL7-1QrNAP3Jnl-00Htwb; Wed, 22 Jun 2011 19:01:45 +0200 Message-ID: <4E021FF7.7@2ndQuadrant.com> Date: Wed, 22 Jun 2011 13:01:43 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110505 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: seq scan in the case of max() on the primary key column References: <4DFA4D2F.8020101@peak6.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:PSJ/IkkEkEv00WWav2SiUq4dqndEa54vyb7iOhk7llS EVK2PqlpXeq70uWIu1w84Y31xE8RqnjJRTvKbZrXdcWBTyD88a ZqHoxqy156O0emaGow4r/41Al3niB/cyACVprGtdG3tG6+Tr+c iwBTGqRVEitWLcUglN+ND3e7AhGOyWtMSdGpWbmBEE6czuixhP +jqI57nBqDfAdbrlB9Igga/sLsSeuyRZP4e2silNbc= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201106/211 X-Sequence-Number: 44144 On 06/22/2011 05:55 AM, Marti Raudsepp wrote: > Now I created a wiki snippet page for this handy > feature here: > https://wiki.postgresql.org/wiki/Efficient_min/max_over_partitioned_table > I just tweaked this a bit to document the version compatibility issues around it and make it easier to follow. I think that's now the page we should point people toward when this pops up again. Between that and my blog post I reference in it, they can find all the details and a workaround in one place. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books