Problem statement
When querying the system.queries table, i.e., the query log, the results returned span the entire system. They are not scoped to a particular database, even though the query is required to be scoped by a database name.
Proposed solution
Add the database name as an attribute on the QueriesTable type.
In the TableProvider::scan implementation for the QueriesTable type, filter the log entries emitted to those with the namespace_name that matches the database name on the QueriesTable.
Alternatives considered
N/A
Additional context
See this slack thread (internal) for where this issue was originally raised.
Problem statement
When querying the
system.queriestable, i.e., the query log, the results returned span the entire system. They are not scoped to a particular database, even though the query is required to be scoped by a database name.Proposed solution
Add the database name as an attribute on the
QueriesTabletype.In the
TableProvider::scanimplementation for theQueriesTabletype, filter the log entries emitted to those with thenamespace_namethat matches the database name on theQueriesTable.Alternatives considered
N/A
Additional context
See this slack thread (internal) for where this issue was originally raised.