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

From Richard Huxton
Subject Re: Slow performance on MAX(primary_key)
Date
Msg-id 200210150923.15822.dev@archonet.com
Whole thread Raw
In response to Re: Slow performance on MAX(primary_key)  (Keith Gray <keith@heart.com.au>)
List pgsql-sql
On Tuesday 15 Oct 2002 8:47 am, Keith Gray wrote:
> Ludwig Lim wrote:
> >   As of now, Max() doesn't utilizes the indices hence
> > it always do a sequential scan.
>
> Thanks Ludwig,
>
> That does help performance, but I was using a "standard"
> SQL command wrapped in a VB6 ADO ODBC program.
>
> 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, and for certain aggregate functions (e.g. not sum()). This means that
the parser would need special-case code to spot these cases, along with tags
for those functions that can be optimised. Thinking further, it might also
vary from type to type. Given that there is a simple workaround and the need
for the optimisation to be added cleanly to the code I believe this has a
fairly low priority.

There is a todo list on the developers' side of the website which has a list
of changes in upcoming releases, you could check there for details.

--  Richard Huxton


pgsql-sql by date:

Previous
From: Keith Gray
Date:
Subject: Re: Slow performance on MAX(primary_key)
Next
From: "Peter Galbavy"
Date:
Subject: how do i insert an empty string ?