How to pass very large ID sets (500K–5M) to ClickHouse queries using clickhouse-cs (.NET)? any industry guidlines? #249
Replies: 2 comments 2 replies
-
|
Hi, For the session affinity issue there's work being done right now to create a mechanism that'll give users the ability to ensure that requests land on the same replica. Don't have an exact timeline for this atm though. The |
Beta Was this translation helpful? Give feedback.
-
|
@alex-clickhouse , Also , I understand the staging table approach looks good, but for that I will check how good it supports concurrency insertions to staging table. Also, I have 2 nodes cluster then in how much time the data will be replicated as I am passing params to staging and immediately accesing them in subsequent query. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the official clickhouse-cs .NET driver with a ClickHouse cluster that has two nodes behind a network load balancer.
My use case requires filtering a query using a very large set of IDs (around 500K to 5M integers).
Using a large
INclause is not practical because the query is sent over HTTP and the request can become too large.To maintain session affinity for operations like temporary tables, I am currently creating connections like this:
However, since there is a load balancer in front of the ClickHouse nodes, relying on temporary tables may still be risky if queries land on different nodes.
I am trying to design a generic ClickHouse access library layer that multiple internal projects can use, so I am looking for a robust and scalable pattern that works well in production environments.
One approach I see often suggested is inserting IDs into a staging table and performing a JOIN, but before standardizing on that pattern, I wanted to ask:
Any insights from real-world deployments would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions