Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiBrv-00022D-DO for pgsql-bugs@arkaria.postgresql.org; Thu, 08 May 2014 00:07:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WiBru-00037R-P0 for pgsql-bugs@arkaria.postgresql.org; Thu, 08 May 2014 00:07:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiBru-00037L-6u for pgsql-bugs@postgresql.org; Thu, 08 May 2014 00:07:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiBrr-0008WG-6n for pgsql-bugs@postgresql.org; Thu, 08 May 2014 00:07:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s4807HpJ009044; Wed, 7 May 2014 20:07:17 -0400 From: Tom Lane To: David G Johnston cc: pgsql-bugs@postgresql.org Subject: Re: Re: BUG #10256: COUNT(*) behaves sort of like RANK() when used over a window containing an ORDER BY In-reply-to: <1399504103854-5803103.post@n5.nabble.com> References: <20140507181702.1397.66739@wrigleys.postgresql.org> <5812.1399498939@sss.pgh.pa.us> <1399504103854-5803103.post@n5.nabble.com> Comments: In-reply-to David G Johnston message dated "Wed, 07 May 2014 16:08:23 -0700" Date: Wed, 07 May 2014 20:07:17 -0400 Message-ID: <9043.1399507637@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David G Johnston writes: > The term "peer" in the first quotation is confusing to me. My understanding > is that "PARTITION BY" defines which rows are "peers" - even if that isn't > the wording used. So now using "peers" in relation to the FRAME clause > confuses the issue. AFAIK we've only used "peers" in this context to mean "rows with equal sort-column values". I don't think we have a specific term for "rows appearing in the same partition", but certainly neither the docs nor the code mean that when they say "peer". [ looks at SQL standard... ] The standard uses "peer" in this way too, so that's where we got the term from. Because of that, I'm unwilling to adopt your suggestion of thinking that "peer" means "member of the same partition". However, it seems like maybe we need to clarify the term some more, eg define what we mean by it in more places. Are there any specific places that you think this should be done? > At minimum the top of 9.3.4 could provide links to, and > descriptions/summaries of, what the other 4 sections cover and why things > are broken out the way they are. The other cross-references could point > back to that section-subsection as a kind of launch point: "Please see > section 3.5.1 for an overview of, and links to, other related sections." No particular objection to doing something like that. > Just some food for thought if anyone is industrious and annoyed enough to > act on it. Not me, at least not in the near future. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs