Slightly refactor varstr_sortsupport() to improve readability.
Author: Andreas Karlsson Discussion: https://postgr.es/m/69c2a864-846f-4309-bd5a-aaa1c34f9a11@proxel.se
This commit is contained in:
parent
15c1abd977
commit
a95ff1fe2e
@ -1917,25 +1917,25 @@ varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
ssup->comparator = varlenafastcmp_locale;
|
ssup->comparator = varlenafastcmp_locale;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unfortunately, it seems that abbreviation for non-C collations is
|
* Unfortunately, it seems that abbreviation for non-C collations is
|
||||||
* broken on many common platforms; see pg_strxfrm_enabled().
|
* broken on many common platforms; see pg_strxfrm_enabled().
|
||||||
*
|
*
|
||||||
* Even apart from the risk of broken locales, it's possible that there
|
* Even apart from the risk of broken locales, it's possible that there
|
||||||
* are platforms where the use of abbreviated keys should be disabled at
|
* are platforms where the use of abbreviated keys should be disabled at
|
||||||
* compile time. Having only 4 byte datums could make worst-case
|
* compile time. Having only 4 byte datums could make worst-case
|
||||||
* performance drastically more likely, for example. Moreover, macOS's
|
* performance drastically more likely, for example. Moreover, macOS's
|
||||||
* strxfrm() implementation is known to not effectively concentrate a
|
* strxfrm() implementation is known to not effectively concentrate a
|
||||||
* significant amount of entropy from the original string in earlier
|
* significant amount of entropy from the original string in earlier
|
||||||
* transformed blobs. It's possible that other supported platforms are
|
* transformed blobs. It's possible that other supported platforms are
|
||||||
* similarly encumbered. So, if we ever get past disabling this
|
* similarly encumbered. So, if we ever get past disabling this
|
||||||
* categorically, we may still want or need to disable it for particular
|
* categorically, we may still want or need to disable it for particular
|
||||||
* platforms.
|
* platforms.
|
||||||
*/
|
*/
|
||||||
if (!collate_c && !pg_strxfrm_enabled(locale))
|
if (!pg_strxfrm_enabled(locale))
|
||||||
abbreviate = false;
|
abbreviate = false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we're using abbreviated keys, or if we're using a locale-aware
|
* If we're using abbreviated keys, or if we're using a locale-aware
|
||||||
|
Loading…
x
Reference in New Issue
Block a user