v.25.11Improvement

Fix incorrect rows_before_limit_at_least

Fix incorrect rows_before_limit_at_least when there are multiple remote shards involved in a distributed merging aggregation, or there are subqueries INs. This fixes #63280. #63511 (Amos Bird).
Fixes incorrect calculation of rows_before_limit_at_least in distributed merging aggregations involving multiple remote shards or subqueries with IN clauses.

Why it matters

The feature addresses a bug where the rows_before_limit_at_least metric was inaccurately computed during distributed merging aggregation queries, especially when multiple remote shards are involved or when subqueries use IN clauses. Correcting this ensures accurate execution statistics and query behavior.

How to use it

This fix is applied automatically in the updated ClickHouse version. Users benefit from the accurate internal metric rows_before_limit_at_least in distributed aggregation queries without requiring any configuration changes.