tenant-adminUpdated 2026-05-18

Query Log

What this covers

The query log records every SQL, DAX, and MDX query that flows through the Tessallite gateway and query-router. This page explains what information is captured, how to filter and search the log, how to export it as CSV, and how to configure retention.

Why query logging matters

The query log serves three audiences:

Without a query log, diagnosing a slow PivotTable refresh or an unexpected data access means searching raw service logs. The query log gives every stakeholder a single, filterable, exportable view.

What is captured

FieldDescription
TimestampWhen the query was received.
User identityThe authenticated user or JDBC/XMLA session identity.
Protocoljdbc, xmla, rest, or internal.
Raw queryThe original SQL, DAX, or MDX text.
Route typeHow the query was served: source (direct to database), aggregate (hit a pre-built aggregate), or pocket (hit a pocket table).
Statussuccess or error.
Error typeIf the query failed: timeout, result_too_large, parse_error, auth_error, etc.
Execution timeWall-clock milliseconds from receive to response.
Rows returnedNumber of result rows.
Rewritten queryIf the query-router rewrote the SQL (e.g., to target an aggregate), the rewritten version.
Query fingerprintA normalised hash of the query structure, used to group similar queries.

Accessing the query log

Open any model in the Explorer. The Diagnostics panel appears in the lower section. Select the Query Log tab.

The query log is scoped to the current project. All models in the project share a single log view.

Filtering

Six filters narrow the results. All filters combine with AND logic.

FilterBehaviour
From / ToDate-time range. Only queries within this window are shown.
UserPartial text match against the user identity field.
StatusDropdown: All, Success, Error.
RouteDropdown: All, Source, Aggregate, Pocket.
Error typeAvailable via the API: exact match against the error type field.
ModelAvailable via the API: filter to a single model within the project.

Type a date range and press Enter or click away to apply. Text filters apply as you type with a short debounce.

Viewing query details

Click any row to open the detail dialog. The dialog shows:

CSV export

Click the download icon in the toolbar to export the current filtered view as a CSV file. The export includes all matching rows (not just the current page) with these columns:

created_at, user_identity, protocol, raw_query, route_type, status, error_type, execution_ms, rows_returned, query_fingerprint

Use the filters to narrow the export before downloading. For large tenants with millions of queries, apply a date range to keep the export manageable.

Retention

The query_log.retention_days tenant setting controls how long query logs are kept:

A daily scheduler job (query_log_purge) deletes query log entries and their associated route log entries older than the retention threshold. The job runs once per day per tenant at 05:30 UTC.

Configure retention in Admin > Settings by adding or updating the query_log.retention_days key.

API reference

MethodEndpointPurpose
GET/api/v1/projects/{project_id}/logs/queriesList query logs (paginated). Params: model_id, status, error_type, route_type, user_identity, date_from, date_to, page, page_size.
GET/api/v1/projects/{project_id}/logs/queries/exportCSV download with the same filter parameters.
GET/api/v1/projects/{project_id}/logs/missesList query miss logs (cache misses tracked by the optimizer).

All endpoints require authentication and project membership.

Best practices

Related