v.20.7Improvement

Added current_database info to system.query_log

Added current_database information to system.query_log. #12652 (Amos Bird).
Added current_database information to system.query_log table.

Why it matters

This feature provides the database context in which each query was executed by including the current_database field in the system.query_log. It helps users better understand and analyze queries by knowing the database scope, which is essential for troubleshooting, auditing, and optimizing queries across multiple databases.

How to use it

Users can query the system.query_log table and inspect the new current_database column to see the database used for each logged query. No configuration is required to enable this feature as the field is added directly to the existing system table.