Tobias Brox <tobias@nordicbet.com> writes:
> We're using 8.1 - I thought such a construct was safe in pg 8.1:
>  select max(indexed_value) from huge_table;
> while earlier we had to use:
>  select indexed_value from huge_table order by indexed_value desc limit 1;
These are not actually exactly the same thing.  In particular, I suppose
your table contains a lot of nulls?
            regards, tom lane