v.21.9Improvement

Add Views Column and Enhance Query Logging in system.query_log

Add views column to system.query_log containing the names of the (materialized or live) views executed by the query. Adds a new log table (system.query_views_log) that contains information about each view executed during a query. Modifies view execution: When an exception is thrown while executing a view, any view that has already startedwill continue running until it finishes. This used to be the behaviour under parallel_view_processing=true and now it's always the same behaviour. - Dependent views now report reading progress to the context. #25714 (Raúl Marín).
Add views column to system.query_log and new system.query_views_log table for tracking executed views during queries.

Why it matters

This feature enhances observability and debugging by logging the names of materialized or live views executed within queries. It also ensures that if an exception occurs during view execution, all already started views continue running until completion, providing consistent behavior regardless of the parallel_view_processing setting. Additionally, dependent views now report reading progress, improving monitoring transparency.

How to use it

Automatically enabled with ClickHouse update. Users can monitor executed views via the new <code>views</code> column in <code>system.query_log</code> and inspect detailed view execution information in the new <code>system.query_views_log</code> system table. No additional configuration is required to enable the improved view execution and logging behavior.