перестает использовать индекс
такие два запроса:
SELECT
events.user_id AS "userId"
FROM remote('host1,host2,host3', local.users_local) u
JOIN events ON events.user_id = u.user_id
WHERE events.user_id = 123456
GROUP BY events.user_id;
1 rows in set. Elapsed: 0.035 sec. Processed 1.88 million rows, 15.02 MB (52.89 million rows/s., 423.12 MB/s.)
SELECT
events.user_id AS "userId"
FROM remote('host1,host2,host3', local.users_local) u
JOIN events as e ON events.user_id = u.user_id
WHERE events.user_id = 123456
GROUP BY events.user_id;
1 rows in set. Elapsed: 2.768 sec. Processed 213.94 million rows, 1.71 GB (77.29 million rows/s., 618.33 MB/s.)
разница только в as e после JOIN
чому так?
ClickHouse client version 20.9.2.20 (official build).
Ну бага видимо, пишите на гитхаб
Обсуждают сегодня