Scope
- Engines
- PostgreSQL
- Roles
- AdminDBAViewer
- ClusterEye
- ClusterEye 1.6.50 and laterWritten from the product code
- The numbers on the Queries tab (Count, Total time, Avg) come from pg_stat_statements data. The Load columns and the Workload Timeline need the active-session sampler; when it is off the page says 'Load is empty: the active-session sampler is off' and sorting falls back to Total time. Turning the sampler on is under Settings → Agent Runtime Config, an administrator screen (Admin); the agent picks it up within about 60 s, no restart needed. On managed (agentless) PostgreSQL the sampling runs server-side.
- Viewing the page and reading the drawer is open to all monitoring roles (Admin, DBA, Viewer). The 'Capture plan' button in the drawer needs the Query permission (Admin or DBA). 'AI Query Assist' needs an Enterprise licence (the API answers that AI features require one); the daily AI quota is counted.
When this guide helps
- how do I find a slow query in postgresql
- postgresql query got slower, which one
- postgresql query putting the most load on the database
- did the postgresql query plan change
- postgresql query regression slower than yesterday
- where do I get an index suggestion for a postgresql query
- which query is running while postgresql is under load
Steps
Step 1: Observe → Performance Analyzer → PostgreSQL → Queries
DoOn the PostgreSQL Performance Analytics page pick the node and open the Queries tab (the heading is 'Query Intelligence'). In the filter bar at the top right choose the time range (15m ... 30d) and, if needed, a database in the 'All databases' box. Look first at the Workload Timeline chart and the tiles below it.
Look forWorkload Timeline: 'avg active sessions by wait category' (average active sessions stacked by wait category). Tiles: Load, Running now, Blocking, Long Running, Regressions, Lock Pressure, I/O Pressure. A red 'N sessions blocked right now' banner with a 'Show blocking' button when it applies.
How to read itThe Load tile is the average number of active sessions the sampler measured and its bar splits that by wait group; 'Running now' counts sessions running in the latest sample. If you select a time slice on the chart the table below reloads for that slice only (a 'Showing HH:MM–HH:MM · clear' tag appears); for a spike during the night this answers 'what was running then'. Most tiles are shortcuts that put the table into the matching mode (for example Regressions → Regressed). The red banner says sessions are waiting on locks right now; in that case start with 'Show blocking' to see the waiting and the blocking query.
- If you see: The load looks like a lock-wait problem (red 'blocked right now' banner) → Step 5
Step 2: Observe → Performance Analyzer → PostgreSQL → Queries
DoIn the 'All Queries' card pick a mode: Top Impact, Blocking, Long Running, Active, Regressed, Lock Heavy or I/O Heavy (the counts show on the tabs). Sort the table by clicking a column header; the 'Search fingerprint' box searches the query text.
Look forColumns: Severity (badge with the impact score next to it), Query, Count, Total time, Avg; under 'CURRENTLY RUNNING' Sessions and Max duration; under 'ACTIVE CONNECTIONS (LOAD)' Avg and Wait groups; Δ vs 7d. Some rows carry a 'running' or 'sampled' tag and '—' values.
How to read itThe default sort is Load (descending) when the sampler attributed any load, otherwise Total time (descending). The mode rules are fixed in code: Top Impact is an impact score of 60 or more; Long Running is a mean or currently running time of 10 s or more; Regressed is rows with the 'Regression' badge; Lock Heavy is rows with the 'Lock Sensitive' badge; I/O Heavy is class IO_HEAVY. Because Total time = Count × Avg, a row with a high Avg and low Count is a statement that is slow on its own, while a row with a small Avg but a very large Count is a frequent statement that adds up (the badge tip for 'High Frequency' says to tune the path, not the query). Δ vs 7d is the change in mean duration against the 7-day baseline; the tooltip shows the call-count change (calls Δ). A 'sampled' tag means the sampler saw the query but there are no pg_stat_statements figures yet; 'running' means it is running now and Count/Total/Avg arrive once it completes. Hovering the Severity cell opens the impact-score breakdown.
Step 3: Observe → Performance Analyzer → PostgreSQL → Queries
DoClick the suspect row; the query drawer opens on the right (the title reads 'Impact N'). Read it in order: the query text, 'Impact Breakdown', 'Load (avg active sessions)' / 'Running now', the KPI tiles, 'Why this matters' and 'What should I do?'.
Look forIn Impact Breakdown a score and an evidence sentence for Total Time, Frequency, Mean Latency, I/O Pressure, Regression, Blocking and Active Now. KPI tiles: Count, Total time, Avg, Contribution, Rows/call, Class, Regression. Badges under 'Why this matters'. Cards grouped as Safe, Investigate and Risky under 'What should I do?'.
How to read itImpact Breakdown shows which signals the score is made of; the longest slice answers 'why is it Impact 87'. Class labels the time as IO HEAVY, CPU HEAVY or MIXED; Contribution is the query's share of total execution time in the window. The badge tips are in the code: 'Regression' means mean/calls diverged from the 7-day baseline (z-score > 2); 'Burst Detected' means current-window calls are 3× the baseline hourly average or more; 'Plan Risk' means the mean jumped without a matching call-rate change or rows/call drifted; 'Plan Instability' means the plan changed at least 2 times in the last 24 hours; 'Temp Spill Risk' means sorts or hashes spill to disk (the tip says raising work_mem usually helps). The suggestion cards come in the order Safe, Investigate, Risky; a Risky card also carries a risk warning that should be read before applying anything. Where a card has a DDL hint it can be copied; ClusterEye does not run it.
Step 4: Observe → Performance Analyzer → PostgreSQL → Queries
DoClick the 'Plan' button at the top of the drawer (shown only on agent-monitored and managed PostgreSQL nodes) or scroll to the 'Execution plan' section. If there is no plan and you have the permission, press 'Capture plan'. Then read the 'Plan Insights' section.
Look forIn the Execution plan section the plan view (Expand enlarges it) and the 'Captured' time. In Plan Insights 'Plan changed around HH:MM', an 'avg X → Y' tag (red for slower, green for faster), an 'index access lost' tag on table rows, 'missing index' and 'new warning' tags where present; in 'Dependencies' the tables and indexes the query touches. If there is no plan, a sentence giving the reason.
How to read itThe plan shown is an estimated one taken with EXPLAIN GENERIC_PLAN: it is planned, never executed, and the plan chosen for specific parameter values can differ. If none is stored or it is older than an hour the API captures one on demand; 'Capture plan' triggers that by hand and needs the Query permission (Admin/DBA), while a Viewer reads the existing plan. Plan Insights is derived from hourly plan captures, so the change is dated to within an hour. The 'avg X → Y' tag compares the mean before and after the change from pg_stat_statements; a change within ±10% counts as 'no change'. When a slowdown and a plan change appear together the screen tells you to check for data growth or locks before acting; when the plan changed but the duration did not it says the change needs no action on its own. 'index access lost' means a table is no longer read through an index. When there is no plan or no statistics ClusterEye says so; an empty plan does not mean the plan is fine.
Step 5: Observe → Performance Analyzer → PostgreSQL → Queries
DoScroll further down the drawer and read 'Locks' (when present), 'Time Trends' and 'Runtime Behavior'. Change the window with the 'Range' selector in Time Trends.
Look forIn Time Trends the Mean Duration, Executions, Rows / Call, I/O Read and I/O Write charts and a 'baseline' line. In Runtime Behavior the 'Blocking now', 'Waiting on lock', 'Lock events × N / 24h', 'Long-running × N / 24h', 'Anomalies × N / 24h' and 'Plan changes × N' tags and a 'Recent anomalies' list.
How to read itRead Mean Duration and Executions side by side: if the mean rises while the call count is flat the query itself got slower (plan, data volume or waiting); if the call count rose, load rose and each call may have stayed as fast. 'Blocking now' says this session is making another one wait, 'Waiting on lock' that it is waiting on a lock; the 'Locks' section says each in its own sentence. 'Plan changes × N' counts the same changes as Plan Insights. If a lock problem shows here, go to the Blocking mode to find the session that holds the lock; there is no session-terminate action on the Queries tab.
Step 6: Observe → Performance Analyzer → PostgreSQL → Queries
DoIf needed press the 'AI Query Assist' button in the drawer's 'AI Query Assist' section. While the answer streams you can stop it with 'Stop'.
Look forIn the result a 'risk: low/medium/high' tag and a confidence tag, the expected impact, the 'Suggested query' and, for index suggestions, the 'Verified', 'Validated', 'Redundant' and 'Unverified' badges.
How to read itThe hint under the button says the query, the execution plan and the live schema are sent to the AI; the prompt is assembled server-side. The badge tips are in the code: 'Verified' means it was simulated with HypoPG against the live database, the planner uses the index and the estimated cost drops; 'Validated' means the suggestion does not duplicate an existing index; 'Redundant' means an existing index already covers the same key columns (write overhead, no gain); 'Unverified' means live schema metadata was unavailable and the table, columns and existing indexes must be checked by hand before applying. The result is a suggestion: ClusterEye does not apply the query or the index; you make the change in the database yourself.
Outcome
By the end you know the slow or heavy query, why it is (a slow single call, a frequent call, a plan change, lock waits) and the suggested action. These screens only read: the one write-like action is 'Capture plan' (Admin/DBA), which asks the node for an estimated plan and does not run ANALYZE. An index, a query rewrite or a work_mem change is not applied from ClusterEye; you copy the DDL hint and apply it in the database yourself. To work out which alarm relates to this query see the 'Alarm triage: finding, owning, snoozing and resolving an alarm' guide, and to see the previous night on the timeline see the 'What happened last night: reading incidents and root cause on the Timeline' guide.
Related guides
In MSSQL Performance Analytics use the Performance tab for the overall state of the instance, the Plan Changed mode of the Queries tab to find the query that changed plan, read Plan Insights in the drawer, compare the old and new plan with Compare Plans and, if needed, consider Query Store plan forcing.
Availability and replicationOn the Replication tab read the health summary, the replica cards, the send-write-flush-replay pipeline, the lag chart and the replication slots to find at which stage and why lag builds up; on a Patroni cluster also check failover readiness.
Incident responseOn the Alarms page prioritise active alarms, read an alarm's detail, acknowledge and own it, snooze it or silence it with a maintenance window when needed, and close it as resolved.
Incident responseOn the Timeline page narrow the last 24 hours by severity, read an incident's root-cause summary and story, drill into raw events and, if needed, get a plain-language account with AI Explain.