From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G Johnston <david.g.johnston@gmail.com>
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
Date: Wed, 07 May 2014 20:07:17 -0400
Message-ID: <9043.1399507637@sss.pgh.pa.us> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
David G Johnston <david.g.johnston@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
Subject: Re: BUG #10256: COUNT(*) behaves sort of like RANK() when used over a window containing an ORDER BY
In-Reply-To: <9043.1399507637@sss.pgh.pa.us>
References: <20140507181702.1397.66739@wrigleys.postgresql.org> <5812.1399498939@sss.pgh.pa.us> <1399504103854-5803103.post@n5.nabble.com> <9043.1399507637@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox