Re: Seqscan in MAX(index_column)

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: Seqscan in MAX(index_column)
Дата
Msg-id Pine.LNX.4.33.0309050954340.30557-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: Seqscan in MAX(index_column)  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Seqscan in MAX(index_column)  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Would it be possible to catch an unconstrained max(id)/min(id) and rewrite 
it as "select id from table order by id [desc] limit1" on the fly in the 
parser somewhere?

That would require fairly little code, and be transparent to the user.  
I.e. low hanging fruit.

On 5 Sep 2003, Greg Stark wrote:

> Note that that only handles min()/max() for the whole table. It doesn't handle
> the GROUP BY case, for that you need DISTINCT ON with an ORDER BY clause.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] Warning for missing createlang
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Seqscan in MAX(index_column)