v.22.3Improvement

Add distributed_depth to query log for detailed querying

Add distributed_depth to query log. It is like a more detailed variant of is_initial_query #35207 (李扬).
Introduces the distributed_depth field to the query log, providing a detailed measure of query distribution depth, enhancing the existing is_initial_query indicator.

Why it matters

This feature addresses the need for more granular insights into distributed query execution in ClickHouse. By tracking the depth of distributed queries, users and administrators can better understand the query processing layers and diagnose performance or behavior issues more effectively.

How to use it

The distributed_depth field is automatically added to the query log. Users can enable or check this information by querying the system.query_log table and inspecting the distributed_depth field alongside other query metadata.