Bug #95793 Allow more functions in partitions using hash
Submitted: 13 Jun 2019 15:24 Modified: 27 Jun 2019 13:08
Reporter: Vasil Rangelov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Partitions Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: paritioning

[13 Jun 2019 15:24] Vasil Rangelov
Description:
The list of functions allowed for parition hashes:
https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-functions.html

Should be extended to support other deterministic functions that return integers, while allowed inputs should be of any non-nullable column.

This will allow "CHAR" and "VARCHAR" columns to be used to determine partition.

How to repeat:
Try to define a table with paritioning by hash, where the function is one of the following:
CRC32
ASCII
BIT_LENGTH
CHAR_LENGTH
CHARACTER_LENGTH
FIELD
FIND_IN_SET
ORD
POSITION
LOCATE

They fail

Suggested fix:
Those functions should be usable.

The one I would REALLY want to use is CRC32, so that I can basically group records by a string column without anything truly fancy, and then take advantage of partition pruning where the WHERE would just search the partition based on an exactly specified value of that column, or a value within a list.
[27 Jun 2019 13:08] MySQL Verification Team
Thanks for the feature request
Bogdan
[5 Mar 2021 9:36] ZhaoPing Lu
I suggest put this feature request on the top of the todo list.