Re: [GENERAL] PG-10 + ICU and abbreviated keys - Mailing list pgsql-general

From Adrien Nayrat
Subject Re: [GENERAL] PG-10 + ICU and abbreviated keys
Date
Msg-id 411d0ed2-6c14-26b4-e7cc-f11f13c997ad@dalibo.com
Whole thread Raw
In response to [GENERAL] PG-10 + ICU and abbreviated keys  (Andreas Joseph Krogh <andreas@visena.com>)
List pgsql-general
On 11/13/2017 09:27 AM, Andreas Joseph Krogh wrote:
>  
> In PG-10, with ICU enabled, is abbreviated keys now enabled?
>  

Hello,


I think yes :

src/backend/utils/adt/varlena.c

1876     /*
1877      * Unfortunately, it seems that abbreviation for non-C collations is
1878      * broken on many common platforms; testing of multiple versions of glibc
1879      * reveals that, for many locales, strcoll() and strxfrm() do not return
1880      * consistent results, which is fatal to this optimization.  While no
1881      * other libc other than Cygwin has so far been shown to have a problem,
1882      * we take the conservative course of action for right now and disable
1883      * this categorically.  (Users who are certain this isn't a problem on
1884      * their system can define TRUST_STRXFRM.)
1885      *
1886      * Even apart from the risk of broken locales, it's possible that there
1887      * are platforms where the use of abbreviated keys should be disabled at
1888      * compile time.  Having only 4 byte datums could make worst-case
1889      * performance drastically more likely, for example.  Moreover, macOS's
1890      * strxfrm() implementation is known to not effectively concentrate a
1891      * significant amount of entropy from the original string in earlier
1892      * transformed blobs.  It's possible that other supported platforms are
1893      * similarly encumbered.  So, if we ever get past disabling this
1894      * categorically, we may still want or need to disable it for particular
1895      * platforms.
1896      */
1897 #ifndef TRUST_STRXFRM
1898     if (!collate_c && !(locale && locale->provider == COLLPROVIDER_ICU))
1899         abbreviate = false;
1900 #endif


But I did not do any test to compare performances.

Regards,

--
Adrien NAYRAT

http://dalibo.com - http://dalibo.org


pgsql-general by date:

Previous
From: Mark Morgan Lloyd
Date:
Subject: Re: [GENERAL] pg on Debian servers
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"