Re: max/min and index usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tobias Brox <tobias(at)nordicbet(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: max/min and index usage
Date: 2006-12-06 03:29:53
Message-ID: 17474.1165375793@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tobias Brox <tobias(at)nordicbet(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tobias Brox 2006-12-06 03:35:50 Re: max/min and index usage
Previous Message Tobias Brox 2006-12-06 03:17:13 Re: max/min and index usage