Making the C collation less inclined to abort abbreviation

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Making the C collation less inclined to abort abbreviation
Дата
Msg-id CAM3SWZTXyTCChND8B3AsXCKPsn4vYhapKf3fqHFyy+5eRPK6zA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Making the C collation less inclined to abort abbreviation
Список pgsql-hackers
The C collation is treated exactly the same as other collations when
considering whether the generation of abbreviated keys for text should
continue. This doesn't make much sense. With text, the big cost that
we are concerned about going to waste should abbreviated keys not
capture sufficient entropy is the cost of n strxfrm() calls. However,
the C collation doesn't use strxfrm() -- it uses memcmp(), which is
far cheaper.

With other types, like numeric and now UUID, the cost of generating an
abbreviated key is significantly lower than text when using collations
other than the C collation. Their cost models reflect this, and abort
abbreviation far less aggressively than text's, even though the
trade-off is very similar when text uses the C collation.

Attached patch fixes this inconsistency by making it significantly
less likely that abbreviation will be aborted when the C collation is
in use. The behavior with other collations is unchanged. This should
be backpatched to 9.5 as a bugfix, IMV.

--
Peter Geoghegan

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Segfault while using an array domain
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.