Re: *sigh* - Mailing list pgsql-hackers

From Greg Stark
Subject Re: *sigh*
Date
Msg-id 87ekx9vg8w.fsf@stark.dyndns.tv
Whole thread Raw
In response to *sigh*  (Thomas Zehetbauer <thomasz@hostmaster.org>)
Responses Re: *sigh*  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
Thomas Zehetbauer <thomasz@hostmaster.org> writes:

> Also will the BUG which causes postgresql to execute a sequential scan
> when using min()/max()/count() ever be fixed? min()/max() can be
> rewritten as SELECT $column ORDER BY $column ASC/DESC LIMIT 1 but this
> should be done by the database, NOT by the user!

First of all, you should take COUNT() out of that list. While MIN/MAX could be
implemented to take advantage of indexes like "DISTINCT ON" (however it's much
more complex than your rewrite indicates), COUNT() *cannot* be done that way.

Nobody is currently working on this or planning to work on this soon. So no,
at least currently it appears this issue will not be changed. Postgresql is
open source and this is the hackers mailing list. Feel free to contribute a
patch.

-- 
greg



pgsql-hackers by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Dreaming About Redesigning SQL
Next
From: Michael Meskes
Date:
Subject: Debian bug report about multibyte in 7.3.3