How to Partitioning a table using a LIKE criteria

2019-06-10 20:22发布

I've a large table to partition by value of a field of varchar(200) type. I have already read this question but because the size of the field I cannot use this solution.
My question is: Can I use a Like criteria as LIKE 'b%' or LIKE 'o%' and so on?
If not, How can I solve this?

Thanks in advance,
Antonio

2条回答
姐就是有狂的资本
2楼-- · 2019-06-10 21:07

You'd better specify the range as

less than ('c')

It is short and readable.

查看更多
放我归山
3楼-- · 2019-06-10 21:24

It seems that partitioning on varchar is allowed only if partitioning is by key (no duplicate values and no null values allowed).

Here a discussion

I tried to perform partitioning using a function that "converts" to integer values as ASCII(), but it doesn't compare in Mysql supported functions in partitioning expression.

List of supported functions

查看更多
登录 后发表回答