Details
-
New Feature
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
As of 10.5, MariaDB supports 1 and 2 in the ALGORITHM option of a PARTITION clause:
CREATE TABLE t1 (a VARCHAR(64)) PARTITION BY KEY ALGORITHM=1 (a) PARTITIONS 4;
|
CREATE TABLE t1 (a VARCHAR(64)) PARTITION BY KEY ALGORITHM=2 (a) PARTITIONS 4;
|
where:
- 1 means MySQL 5.1 hash
- 2 means MySQL 5.5 hash
The built-in hash functions are not always good. For example, on BINARY-alike or VARBINARY-alike data types the distribution is not good when the data has many zero bytes.
See MDEV-20791 as an example of a bad distribution.
In order to improve distribution, let's implement more hash options, e.g. crc32, murmur:
CREATE TABLE t1 (a VARCHAR(64)) PARTITION BY KEY ALGORITHM=crc32 (a) PARTITIONS 4;
|
CREATE TABLE t1 (a VARCHAR(64)) PARTITION BY KEY ALGORITHM=murmur (a) PARTITIONS 4;
|
New algorithm options will be identified by textual names instead of numbers. As this is more readable.
The old values of 1 and 2 will remain as numbers (for backward compatibility). Optionally, they can get textual aliases, e.g. mysql51 or mysql55:
ALGORITH=mysql51
|
Attachments
Issue Links
- blocks
-
MDEV-20791 In table partitioned by INET6 all values go into the same partition
- Open