gpt4 book ai didi

ClickHouse - 每个查询插入一百多个条目

转载 作者:行者123 更新时间:2023-12-02 00:18:42 24 4
gpt4 key购买 nike

我不知道如何增加每个查询的最大条目数。我想在每个查询中插入一千个条目,默认值为 100。

根据 the 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.

此外,/etc/clickhouse-server/config.xml 文件中没有 max_partitions_per_insert_block 字段。

修改 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,所以它看起来不像是权限问题)。

最佳答案

我在再次阅读文档时弄明白了,尤其是 this document .我在 web 中认出了我在 system.settings 中看到的配置文件设置 table 。我只是尝试在我的默认配置文件中插入以下内容,重新加载,然后我插入了一千个条目:<max_partitions_per_insert_block>1000</max_partitions_per_insert_block>

我想这对某些人来说是显而易见的,但对于没有经验的人来说可能不是。

关于ClickHouse - 每个查询插入一百多个条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56187559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com