Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace
Дата
Msg-id 3.0.1.32.20000124212022.00f70720@mail.pacifier.com
обсуждение исходный текст
Ответ на Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
At 12:01 AM 1/25/00 -0500, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.au> writes:
>> Just a thought, but would I be right in saying that this could be easily
>> done with the addition of a new aggregate function 'FIRST', which simply
>> returns the first value sent to it? Since the aggregates operate a row at
>> a time, you are guaranteed a consistent set of values, I think.
>
>No, because the system doesn't guarantee to deliver tuples to the
>aggregate in any particular order.

In fact, this is a KEY notion behind RDBMS systems...queries return an
unordered set, pure and simple, unless you supply an "order" clause
(though "group by" appears to be implemented by ordering in various 
RDBMS systems, that's an efficiency hack not a given AFAIK).

>SQL in general doesn't believe that tuple ordering has any semantic
>significance --- you can ask for ORDER BY, but that's only honored
>at the end stage of SELECT result delivery, not necessarily anywhere
>in the bowels of a query.

Yep...



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Don Baccus
Дата:
Сообщение: Re: [HACKERS] Happy column dropping
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Happy column dropping