`

mysql分区报错:Too many partitions (including subpartitions) 处理

阅读更多

某日,某项目,单表过大,需要作partition, 根据计算,打算按天分区,一天一个区,写了个脚本,生成了上10年的分区SQL脚本,共分了几千个区,执行,报如下错:

ERROR 1499 (HY000) at line 1: Too many partitions (including subpartitions) were defined

 

google了baidu了良久,照方案说的修改open_files_limit的大小,show 了一下,open_files_limit = 1000000,已经很大了,再改大些。 操作, 结果还是报同样的错误。

 

想找到partitions 极限是多少,于是一个一个地减少。后来发现,真正的原因是:一个SQL脚本里PARTITION语句太多才执行失败。 找到了原因,按年分成不同的脚本,每个单独执行。 问题得到了解决。

分享到:
评论
1 楼 healer_kx 2014-04-02  
partitions的限制是1024,文档说的,不知道open_files_limit对这个有影响吗?

Prior to MySQL 5.6.7, the maximum possible number of partitions for a given table not using the NDB storage engine was 1024. Beginning with MySQL 5.6.7, this limit is increased to 8192 partitions. Regardless of the MySQL Server version, this maximum includes subpartitions.

相关推荐

Global site tag (gtag.js) - Google Analytics