> 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@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026