"Reinoud van Leeuwen" <[EMAIL PROTECTED]> writes:
> I have a table that contains almost 8 milion rows. The primary key is a 
> sequence, so the index should have a good distribution. Why does the 
> optimizer refuse to use the index for getting the maximum value?

The optimizer has no idea that max() has anything to do with indexes.
You could try something like

        select * from tab order by foo desc limit 1;

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to