clickhouse - ClickHouse - 每个查询插入一百多个条目
问题描述
我不知道如何增加每个查询的最大条目数。我想每个查询插入一千个条目,默认值为 100。
根据doc,该参数max_partitions_per_insert_block
定义了同时条目的限制。
我试图从 ClickHouse 客户端修改它,但我的插入仍然失败:
$ clickhouse-client
my-virtual-machine :) set max_partitions_per_insert_block=1000
*SET* max_partitions_per_insert_block = 1000
Ok.
0 rows in set. Elapsed: 0.001 sec.
此外,这不是文件max_partitions_per_insert_block
中的字段/etc/clickhouse-server/config.xml
。
修改后max_partitions_per_insert_block
,我尝试插入我的数据,但我遇到了这个错误:
infi.clickhouse_orm.database.ServerError: Code: 252, e.displayText() = 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). (version 19.5.3.8 (official build))
编辑:我仍然坚持这一点。我什至无法手动将参数设置为我想要SET max_partitions_per_insert_block = 1000
的值:该值已更改,但在退出并重新打开 clickhouse-client 后会返回 100(即使使用sudo
,所以它看起来不像是权限问题)。
解决方案
我在再次阅读文档时发现了这一点,尤其是这个文档。我已经在表格中web
看到的配置文件设置中识别出来。system.settings
我只是尝试在我的默认配置文件中插入以下内容,重新加载,并且我插入的一千个条目很好:<max_partitions_per_insert_block>1000</max_partitions_per_insert_block>
我想这对某些人来说是显而易见的,但对于没有经验的人来说可能不是。
推荐阅读
- mysql - MYSQL - UNION 第二个数据集不返回结果
- c# - 如何根据小数位数获取整数的动态最大值
- ios - IOS 启用指示与通知
- holoviews - 悬停工具 - 列名中带有空格的数据框在悬停时不起作用?
- excel - 如何提示用户选择工作表和范围?
- .net - 将 FTP 上特定文件夹中的所有文件下载到本地文件夹
- excel-formula - 嵌套的 IF 语句没有给出正确的范围 - Excel
- java - 测试前的 TRACE 级别的 Log4j2 日志,包括解析 xml 配置。如何在记录开始之前更改级别?
- scala - Scala反射可以以分布式方式使用吗?
- python - holoviews - 仅来自聚合数据的箱线图