clickhouse-operator
clickhouse-operator copied to clipboard
make `metrics-exporter` queries parallel
All metrics related to system.parts on HDD + Raid0 + ClickHouse 19.16 take long time when we have many system.parts
SELECT COUNT(*)
FROM system.parts
┌─COUNT()─┐
│ 28022 │
└─────────┘
1 rows in set. Elapsed: 3.406 sec.
Actually, it should also be improved on ClickHouse side: https://github.com/ClickHouse/ClickHouse/issues/19570
Why not both?
@Enmk cause most of queries on current metrics exporter use UNION ALL ... and make in parallel on clickhouse side
but queries related to system.parts make a lot of "fstat syscall" for calculate all system.parts columns instead of only requested,
so, system.parts related queries is the slowest part of generating /metrics endpoint