| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера