I have two tables
event
params
This table have relation 1-1 by id. If execute query
select count(*)
from
(select id from event where os like 'Android%')
inner join
(select id from params where sx >= 1024)
using id
they very slow
But if all data contains in one table
select count(*) from event where sx >= 1024 and os like 'Android%'
Query executed very fast.
Please, tell me how use join in ClickHouse DB effective? Keep all data in one table is not convenient.
You may rewrite query like this:
select count(*)
from event
where os like 'Android%'
AND id IN (select id from params where sx >= 1024)