Commit a0858b2c authored by Alexander Barkov's avatar Alexander Barkov Committed by Oleksandr Byelkin

MDEV-27265 Improve contraction performance in UCA collations

Adding a hash table for contractions.

The old code iterated through all items in MY_CONTRACTIONS,
and was much slower, especially for those contractions
in the end of the list.
parent 13344682
......@@ -141,6 +141,13 @@ const uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c,
my_wc_t wc1, my_wc_t wc2);
typedef struct my_uca_contraction_hash_t
{
size_t nitems_alloced;
MY_CONTRACTION *item;
} MY_UCA_CONTRACTION_HASH;
/* Collation weights on a single level (e.g. primary, secondary, tertiarty) */
typedef struct my_uca_level_info_st
{
......@@ -149,6 +156,7 @@ typedef struct my_uca_level_info_st
uint16 **weights;
MY_CONTRACTIONS contractions;
uint levelno;
MY_UCA_CONTRACTION_HASH contraction_hash;
} MY_UCA_WEIGHT_LEVEL;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment