报错信息
Received exception from server (version 21.3.4):
Code: 252. DB::Exception: Received from localhost:9000. DB::Exception: Too many partitions for single INSERT block (more than 100). 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 1000..10000. 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).: While executing SinkToOutputStream.
解决方案:
临时解决方案:
因为partitions的默认值是100,需要加大blick的数量
set max_partitions_per_insert_block=600;
永久解决办法
vim /etc/clickhouse-server/users.xml
增加:
<max_partitions_per_insert_block>600</max_partitions_per_insert_block>
重新插入数据问题解决。