Skip to content

Scope results of system.queries table to database #26107

Description

@hiltontj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions