> select max(foo) from bar where x = 'y';
>
> How is the index used in this query?
Informix would use an index created on (x, foo) and I guess others too.
But I too usually find the "select first 1 * from y order by x desc" much more
useful than an optimized max, since it can also return other columns from that row
(And is more performant than an optimally optimized subselect for this).
Andreas