1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-17 06:42:17 +03:00

MDEV-26664 Store UUIDs in a more efficient manner

UUID values

  llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn

are now stored as

  nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll

inside the record:

- the groups (segments separated by dash) are reordered right-to-left.
- the bytes inside the groups are not reordered (stored as before,
  in big-endian format).

This provides a better sorting order: the earlier UUID was generated,
the higher it appears in the ORDER BY output.

Also, this change enables a good key prefix compression,
because the constant part is now in the beginning, while
the non-constant part (the timestamp) is in the end.
This commit is contained in:
Alexander Barkov
2021-10-19 13:17:11 +04:00
committed by Sergei Golubchik
parent 50bcda010f
commit b9f19f7eae
15 changed files with 3601 additions and 36 deletions

View File

@@ -484,6 +484,11 @@ public:
if (str.Alloced_length)
Alloced_length= (uint32) (str.Alloced_length - offset);
}
LEX_CSTRING to_lex_cstring() const
{
LEX_CSTRING tmp= {Ptr, str_length};
return tmp;
}
inline LEX_CSTRING *get_value(LEX_CSTRING *res)
{
res->str= Ptr;