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), pocket (hit a pocket table), named_query (a materialised Named Query table), or composite (an answer combined across fact groups or models). A combined answer is logged as its own line plus one line per part, each part with its own route.
ServedShown in Diagnostics: Hit (a ready table served it), Miss (the source served it), Cache (re-served from the short-term cache). A combined answer is Hit when every part was served without the source, Partial when some were, and Miss when none were. Combined-answer lines are left out of Model Health and usage statistics, which count their parts.
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.

The internal execution log

Besides the query log, the query service keeps an internal execution log in the tessallite_runtime database: one record for each answered query, used by the system for its own bookkeeping. It is written on a best-effort basis. An answer is returned whether or not its record could be written, so the log can never stop a query.

There is no screen and no API for reading these records. To see what ran, who ran it and how it was served, use the query log on this page. Query-log retention and CSV export do not touch the internal log; its records are removed after 30 days by default.

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:

Field surface

The Field surface tab in Diagnostics lists the measures, dimensions and hierarchies that the persona and fact group selected in the Model Builder header can use on the deployed model, as the model service binds them. Fields hidden from that persona are not listed; their count is shown instead. Deploy the model first.

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