Re: select max(column) not using index

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Thomas Zehetbauer <thomasz(at)hostmaster(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: select max(column) not using index
Date: 2002-03-13 16:35:00
Message-ID: 20020313082734.W81426-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 7 Mar 2002, Thomas Zehetbauer wrote:

> I think you all should really buy the book 'Database Development for Dummies'.
> Postgresql is for sure the only database on this planet that cannot optimize a
> select(max) using an index. Not even Microsoft has implemented such a design
> deficiency yet and even MySQL which you like to talk so bad about uses an
> index to optimize select max() queries. Some of you should really consider
> attending a programming course and all of you should consider to stop working
> on this totally screwed up monster!

I'm not sure why I'm bothering to respond, but...

Given that postgres allows user defined aggregates and I guess it'd be
possible for a user to redefine max into some form where the optimization
isn't valid (I'm not sure why mind you, but...) that'd mean that the
optimization is not always available. Personally, I'd generally prefer
correct and slow over incorrect and fast. I'm fairly sure that if you made
a patch that cleanly dealt with the issue without programming in special
knowledge of min and max it'd be considered for inclusion.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2002-03-13 17:12:36 Re: Update 6.5 database files to 7.0
Previous Message mlw 2002-03-13 16:22:12 Re: a vacuum thread is not the answer