Re: optimisation? collation "C" sorting for GroupAggregate for all deterministic collations

Поиск
Список
Период
Сортировка
Искать
От
Maxim Ivanov
Тема
Re: optimisation? collation "C" sorting for GroupAggregate for all deterministic collations
Дата
Msg-id
Lri2JvSIB54_Xpapqi2i1B_hC4FB6QCOnYv_kQvqSN8EVhoMbI_LMSoM5zDgUIcMxxK6HQBJ7pYjPw9Xzahwd8ZJCRGk8jqqv_O9Zt-yiOc=@yamlcoder.me
Ответ на
Список
Дерево обсуждения
optimisation? collation "C" sorting for GroupAggregate for all deterministic collations Maxim Ivanov <hi@yamlcoder.me>
Re: optimisation? collation "C" sorting for GroupAggregate for alldeterministic collations Pavel Stehule <pavel.stehule@gmail.com>
Re: optimisation? collation "C" sorting for GroupAggregate for alldeterministic collations James Coleman <jtc331@gmail.com>
Re: optimisation? collation "C" sorting for GroupAggregate for alldeterministic collations Corey Huinker <corey.huinker@gmail.com>
Re: optimisation? collation "C" sorting for GroupAggregate for all deterministic collations Maxim Ivanov <hi@yamlcoder.me>

> Perhaps this is what you mean by "deterministic", but isn't it
> possible for some collations to treat multiple byte sequences as equal
> values? And those multiple byte sequences wouldn't necessarily occur
> sequentially in C collation, so it wouldn't be possible to work around
> that by having the grouping node use one collation but the sorting
> node use the C one.
>
> If my memory is incorrect, then this sounds like an intriguing idea.


Yes, as per doc (https://www.postgresql.org/docs/12/collation.html#COLLATION-NONDETERMINISTIC) some collations can result in symbols(chars? codes? runes?) to be equal, while their byte representations is not. This optimisation should check for source table collation and do not change sorting collation if columns being sorted use non deterministic collation.

Luckily in practice it is probably to be very rare, all builtin collations are deterministic.




В списке pgsql-hackers по дате отправления
От: Joel Mariadasan (jomariad)
Дата:
От: Fujii Masao
Дата:
FAQ