How to Partitioning a table using a LIKE criteria in Mysql

被刻印的时光 ゝ 提交于 2019-12-08 11:28:05

问题


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


回答1:


You'd better specify the range as

less than ('c')

It is short and readable.




回答2:


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



来源:https://stackoverflow.com/questions/5442449/how-to-partitioning-a-table-using-a-like-criteria-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!