Re: max/min and index usage - Mailing list pgsql-performance

From Tom Lane
Subject Re: max/min and index usage
Date
Msg-id 17474.1165375793@sss.pgh.pa.us
Whole thread Raw
In response to max/min and index usage  (Tobias Brox <tobias@nordicbet.com>)
Responses Re: max/min and index usage
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tobias Brox
Date:
Subject: Re: max/min and index usage
Next
From: Tobias Brox
Date:
Subject: Re: max/min and index usage