我有两个关于如何在 clickhouse 中进行分片的问题。
Q1. clickhouse有必要使用分布式引擎进行分片吗?
Q2。我想知道是否可以根据我设置的标准进行分片,而不是根据分片的权重自动分配。
Example.
- If id is 1, it is stored in shard1.
- If id is 2, it is stored in shard2.
- If id is 3, it is stored in shard3.
I understand the sharding through the distribution engine as follows.
- distributed engine use the cluster defined in the config.xml file.
- It is automatically distributed to the shard according to the weight of the shard.
Run Code Online (Sandbox Code Playgroud)
感谢您阅读我的问题。我期待你的回复。
小智 5
Q1. clickhouse有必要使用分布式引擎进行分片吗?
是的。分布式引擎知道如何将查询分发到分布在分片和副本上的本地表。如果没有这个,您将需要在每个分片上运行查询并自行组装结果。
Q2。我想知道是否可以根据我设置的标准进行分片,而不是根据分片的权重自动分配。
是的。有两种方法可以将数据写入分片。
分布式引擎实际上只是通往本地表的网关,这就是#2 起作用的原因。
归档时间: |
|
查看次数: |
2422 次 |
最近记录: |