Query analytics
Query analytics (QAN) shows which queries put the most load on a cluster. Jarwis groups executions into digests — the same statement with the literal values replaced by placeholders — and ranks them by how much database time they consume. Open it from Observability → Query Analytics (/observability?tab=qan).
What is collected
The agent on each database node reads the engine's own statistics about once a minute and sends them to the controller (or to Jarwis-hosted storage). Nothing is installed on your database besides what the engine already provides:
| Engine | Source |
|---|---|
| MySQL / MariaDB / Percona / Galera | performance_schema statement digests (enabled by Jarwis installs). |
| PostgreSQL | pg_stat_statements, grouped by queryid. The extension must be preloaded and created — Jarwis does this on install and import where it can; see the cluster's Extensions tab (Databases). |
| MongoDB | Query-shape statistics ($queryStats, MongoDB 7.0 and newer). If sampling is off, Jarwis tries to enable it. |
| ClickHouse | system.query_log. |
Redis, RabbitMQ and Kafka have no query digests. For Redis / Valkey see the Ops Stats tab on the Observability screen.
Single cluster and Compare clusters
Two buttons at the top switch the view:
- Single cluster — pick a Cluster and read its ranked digests.
- Compare clusters — tick two or more clusters to see the same digests side by side, with the query count and time on each cluster. Useful for comparing a staging and a production copy of the same workload.
Filters and ranking
| Filter | Effect |
|---|---|
| Window | Last 1 hour, 6 hours, 24 hours or 7 days. |
| Schema, User | Only digests run in a given schema, or by a given database user. |
| Pattern | A regular expression matched against the digest text, for example SELECT.*. |
| Rank by | Load (total time) (default), Latency or Count. |
| Min avg (ms) | Hide digests whose average time is below this value. |
| Previous window | Show how each digest changed compared with the equal-length window just before this one. |
The summary tiles show Queries, QPS, Load (query-seconds per wall-clock second) and Slow (digests averaging a second or more). In the table, the Load column is a digest's share of the matching query time; QPS, Count, Total and Avg follow. Rows/exec is the average number of rows examined per execution (documents for MongoDB, rows read for ClickHouse; for PostgreSQL it counts shared buffers touched). A digest that examines far more rows than it returns is usually missing an index. If the column is empty, rows-examined data was not collected for that source — for example, older agents or Jarwis-hosted storage.
EXPLAIN and the plan visualizer
Each digest that can produce a plan has two buttons:
- EXPLAIN — runs
EXPLAINon a recent example of the statement and shows the result inline, with highlights for full scans, filesorts and temporary tables. Statements that have no plan (SHOW,SET,CALL, DDL) get no button. - Plan — builds the same plan as a collapsible Plan tree (with a Raw JSON tab). The costliest step is marked, each step shows estimated rows, rows examined and its share of the cost, and warning badges call out Full scan, Filesort, Temporary table, Spills to disk, High row estimate, Estimate off and Low selectivity.
EXPLAIN result opened from a digest.SELECT / WITH statements are explained, and viewers can use EXPLAIN and Plan. Run EXPLAIN ANALYZE… (PostgreSQL only) actually executes the query to measure real row counts and timings, so it is limited to admins and asks you to confirm I understand the query will run on the cluster. For MongoDB, plan analysis uses explain("executionStats") on find and aggregate queries, which also runs the query; update and delete statements are refused.Collect query analytics
In the Single cluster view, the Collect query analytics checkbox turns collection on or off for that cluster. Turn it off to stop the agent from sampling statistics (for example on a very sensitive node). When it is off, the page, the AI Query Advisor and the impact report have nothing to show.
Impact report after schema changes
When you apply an index or run an online schema change from a cluster's Schema tab, Jarwis compares the affected queries' latency and rows examined before and after the change and shows an impact report. If there is not enough query data in the window yet, it says so instead of guessing. See Advisor & optimization.
Local, hosted and on-prem
- Local — digests are stored in the controller's MongoDB log store, so install it first (Actions → Install Logstore, see Central logs).
- Jarwis-hosted and on-prem — digests are stored in a per-organization ClickHouse store and nothing needs installing. Daily row quotas depend on your plan (see Jarwis-hosted observability).