Re: Index not being used in MAX function (7.2.3)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index not being used in MAX function (7.2.3)
Дата
Msg-id 21379.1055457311@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Index not being used in MAX function (7.2.3)  ("Jim C. Nasby" <jim@nasby.net>)
Список pgsql-general
"Jim C. Nasby" <jim@nasby.net> writes:
> Am I just being naive, or couldn't this be solved by adding min/max
> boolean flags to pg_aggregates and the appropriate syntax to CREATE
> AGGREGATE?

I'd prefer to see a direct link to the associated sort operator
('<' for MIN or '>' for MAX).  But yeah, some addition to the system
catalogs seems essential if you don't want the code to be full of
unsupportable assumptions about aggregate and operator names.

> So it seems the ORDER/LIMIT hack doesn't work well at all except in
> limited situations.

No kidding.  This is one reason there hasn't been a huge push to get it
implemented: the actual usefulness of the hack is quite limited.  In
your example, I suspect the presence of the unrelated WHERE clause is
what makes it unhelpful.

            regards, tom lane

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Index not being used in MAX function (7.2.3)
Следующее
От: "Octavio Alvarez"
Дата:
Сообщение: Re: LC_COLLATE=es_MX in PgSQL 7.3.2