> The trouble is that if you have several tuples with the same i and
> different j, doing the DISTINCT first implies throwing away all but
> one of those tuples. Which one do you keep? It matters because
> some of those tuples might sort differently than others.
> As far as I can see, this combination of features is not well-defined on
> its surface. You have to make some additional assumptions (about which
> of the possible j values is kept for sorting) in order to define a
> unique result.
That is an interesting argument. It suggests it should not be a TODO
item. I can see cases where you would want to do the DISTINCT before
the ORDER BY, so the current behavior seems correct.
Removing it from TODO list.
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
In response to
pgsql-hackers by date
|Next:||From: Oleg Broytmann||Date: 1998-12-21 10:24:42|
|Subject: PostgreSQL 6.4 like bug(?)|
|Previous:||From: Tom Lane||Date: 1998-12-20 17:53:30|
|Subject: Re: [HACKERS] SELECT DISTINCT i FROM dtest ORDER BY j |