Re: slow plan for min/max

Поиск
Список
Период
Сортировка
От Matt Clark
Тема Re: slow plan for min/max
Дата
Msg-id LFEIJBEOKGPDHCEMDGNFEEGGCAAA.matt@ymogen.net
обсуждение исходный текст
Ответ на Re: slow plan for min/max  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: slow plan for min/max  ("Matt Clark" <matt@ymogen.net>)
Re: slow plan for min/max  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
>This is a Frequently asked question about something that isn't likely to
>change any time soon.

You're right, it is in the FAQ, but pretty well buried.  It is entirely
non-obvious to most people that min() and max() don't/can't use indices.
Something so counterintuitive should be explicitly and prominently
advertised, especially since the "order by X limit 1" workaround is so
simple.

Actually, referring down to later parts of this thread, why can't this
optimisation be performed internally for built-in types?  I understand the
issue with aggregates over user-defined types, but surely optimising max()
for int4, text, etc is safe and easy?

Of course I may be so far out of my depth as to be drowning, in which case
please put me out of my misery.

M


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: slow plan for min/max
Следующее
От: "Matt Clark"
Дата:
Сообщение: Re: slow plan for min/max