Re: Slow performance on MAX(primary_key) - Mailing list pgsql-sql

From Keith Gray
Subject Re: Slow performance on MAX(primary_key)
Date
Msg-id 3DAE0883.6090709@heart.com.au
Whole thread Raw
In response to Re: Slow performance on MAX(primary_key)  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Responses Re: Slow performance on MAX(primary_key)
List pgsql-sql
Richard Huxton wrote:

>>>  As of now, Max() doesn't utilizes the indices hence
>>>it always do a sequential scan.


>>Is this likely to be sorted in 7.2 ?
>>Is anyone looking at this?


> As I understand, the problem is that the optimisation only applies for simple 
> cases...


Getting MIN() adn MAX() seems fairly trivial to me.

When is on an index or more importantly Primary
Key it must be a common SQL.

Would it be possible in the code to look at
the field in MIN() or MAX() and if it is
indexed use a similar method to the suggested
SQL work around?

Can I help this to happen?



-- 

Keith Gray
Technical Services Manager
Heart Consulting Services



pgsql-sql by date:

Previous
From: "Eric L. Blevins"
Date:
Subject: Re: Help with SQL
Next
From: "Charles H. Woloszynski"
Date:
Subject: Re: Slow performance on MAX(primary_key)