Need guidance on Low latency lookup redesign at 5B rows, based on order key #95260
Unanswered
arvindeybram
asked this question in
Q&A
Replies: 1 comment
-
|
How small/big is the "another table" and how is the "condition" written in the nested query -> Any reason why the index_granularity is 256? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to perform low latency lookups on clickhouse.
CREATE TABLE example.events_data ( event_time DateTime, user_id UInt64, event_id UUID, lookup_hash UInt64 MATERIALIZED cityHash64(user_id, event_id) ) ENGINE = MergeTree PARTITION BY toYYYYMM(event_time) ORDER BY lookup_hash SETTINGS index_granularity = 256;Now if example.events_data contains 5 billion rows and I want to pull out 500 rows from it on the basis of lookup_hash,
something like
select * from example.events_data where lookup_hash in (select lookup_hash from another table where some condition limit 500)How can we achieve this with low latency?
Beta Was this translation helpful? Give feedback.
All reactions