前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >写clickhouse报错:Too many partitions for single INSERT block

写clickhouse报错:Too many partitions for single INSERT block

原创
作者头像
TDSQL-A助手
发布2021-07-23 15:07:27
5K0
发布2021-07-23 15:07:27
举报
文章被收录于专栏:clickhouse-Aclickhouse-A

在写入Clickhouse时, clickhouse报错如下:

代码语言:javascript
复制
 message: Too many partitions for single INSERT block (more than xxx). 
 The limit is controlled by 'max_partitions_per_insert_block' setting. 
 Large number of partitions is a common misconception.
 It will lead to severe negative performance impact, including slow server startup, 
 slow INSERT queries and slow SELECT queries. Recommended total number of partitions 
 for a table is under xxx..xxx. Please note, that partitioning is not intended to 
 speed up SELECT queries (ORDER BY key is sufficient to make range queries fast).
 Partitions are intended for data manipulation (DROP PARTITION, etc)

原因

clickhouse要求每次写入的数据不能跨越特别多的partitions, 具体受max_partitions_per_insert_block控制。

处理办法

一般调大该配置即可。修改users.xml,按照如下添加配置:

思考

一次写入太多的分区应该对clickhouse本身不友好, 所以调整的时候注意不要特别大。至于max_partitions_per_insert_block特别大对clickhouse有哪些坏处大家可以留言评论。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档