Re: Avoid sorting when doing an array_agg

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Avoid sorting when doing an array_agg
Дата
Msg-id CAH2-Wz=2fLpKNKkUUda4Od0k4bGzoeHZOLNSWzjp4v9VsCk74w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Avoid sorting when doing an array_agg  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Avoid sorting when doing an array_agg
Re: Avoid sorting when doing an array_agg
Список pgsql-general
On Sat, Dec 3, 2016 at 5:20 PM, Tomas Vondra
<tomas.vondra@2ndquadrant.com> wrote:
> So the sort is probably slow because of CPU, as it compares strings. In
> some locales that may be very expensive - not sure which locale is used
> in this case, as it was not mentioned.

I wonder what it would take to teach the optimizer to consider the
possibility of a "collation strength reduction". In other words, for
aggregates that perform a sort (or for aggregates that rely on the
presence of a sort node without there being some other dependency on
the sort node), it should be possible for the optimizer to determine
that it would be just fine to use the C locale, since the user isn't
entitled to assume anything about the exact sort order. There are of
course cases where this can make a huge difference.

--
Peter Geoghegan


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

Предыдущее
От: Paul Ramsey
Дата:
Сообщение: Re: Extensions and privileges in public schema
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Avoid sorting when doing an array_agg