RE: [HACKERS] Upgrades for 6.4.1

Поиск
Список
Период
Сортировка
От Stupor Genius
Тема RE: [HACKERS] Upgrades for 6.4.1
Дата
Msg-id 000801be2bca$b0bfcaa0$ce98accf@darren
обсуждение исходный текст
Ответ на Re: [HACKERS] Upgrades for 6.4.1  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
> > >> * SELECT DISTINCT i FROM dtest ORDER BY j generates strange output
> > 
> > > In my simple test case, it orders by j, then only shows i. Is that
> > > strange?
> > 
> > The thing that is "strange" is that you get nonunique values of i,
> > which is definitely a bit unexpected for "SELECT DISTINCT":
> > I don't know whether the SQL standard defines how this combination of
> > features ought to work ... but our current behavior seems fairly
> > surprising...
> 
> Re-added to TODO list.

I don't know if I would necessarily call it "strange", more like
"understandable" if you consider the fact that the ORDER BY is being
done first on the data set rather than the distinct.

It would seem to me that the distinct should apply first though.
I would expect the ORDER BY clause to order whatever tuples are
returned by the SELECT, and that would imply doing DISTINCT first.

Just my two cents...
darrenk


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Upgrades for 6.4.1
Следующее
От: Clark Evans
Дата:
Сообщение: Re: [HACKERS] Upgrades for 6.4.1