Re: Slooooow query question
Posted in 1995
KEVIN CLOSSON — — source: Informix-list mailing list archive (1991-1998)
>> SELECT DISTINCT x FROM y ORDER BY x>
>DISTINCT is evaluated by copying all the relevant tuples to a temporary
>table and then grouping them. The ORDER BY is evaluated last; the engine
>has to sort the rows (writing them to $DBTEMP first), because the temp
>table hasn't got an index on it.
>
>> I've tried this query under Informix OnLine 5.0 and 6.0, with the same
>> results.
Try PDQ.
>
>I don't know of a version that has implemented any short cuts.
>
>> Is there any way to speed up a DISTINCT query? Am I just out of luck?