v.24.5Improvement

Progress bar functionality enhancement for trivial queries with LIMIT and earlier exception handling for row limits

The progress bar will work for trivial queries with LIMIT from system.zeros, system.zeros_mt (it already works for system.numbers and system.numbers_mt), and the generateRandom table function. As a bonus, if the total number of records is greater than the max_rows_to_read limit, it will throw an exception earlier. This closes #58183. #61823 (Alexey Milovidov).
The progress bar now supports trivial queries with LIMIT on system.zeros, system.zeros_mt, and the generateRandom table function, in addition to system.numbers and system.numbers_mt. It also provides earlier exceptions when the total records exceed the max_rows_to_read limit.

Why it matters

This feature improves user experience by enabling progress feedback for more trivial query cases where previously it was unavailable, helping users better understand query execution progress. Additionally, by throwing exceptions earlier when the max_rows_to_read limit is exceeded, it prevents unnecessary resource consumption and reduces wait times.

How to use it

Simply run queries with LIMIT on system.zeros, system.zeros_mt, or the generateRandom table function as before. The progress bar will automatically display during execution. If the query reads more rows than allowed by max_rows_to_read, an exception will be raised automatically.