basiradocs
Dashboard

Query Performance

Find and fix slow queries with query statistics and EXPLAIN plans.

The Queries page shows aggregated performance statistics for every query your database has executed, powered by pg_stat_statements (PostgreSQL) or system.query_log (ClickHouse).

Query List

Queries are grouped by their normalized fingerprint — parameterized values are replaced with placeholders so that SELECT * FROM users WHERE id = 1 and SELECT * FROM users WHERE id = 2 appear as one entry.

Sorting

Sort by any column to find different types of problems:

Sort byUse case
Total time (default)Queries consuming the most cumulative database time
CallsMost frequently executed queries
Mean timeSlowest average execution time per call
RowsQueries returning or affecting the most rows

Metrics

FieldDescription
Total timeCumulative wall-clock time across all executions
CallsNumber of times the query was executed
Mean timeAverage time per execution (total time / calls)
RowsTotal rows returned or affected
Cache hit ratioPercentage of block reads served from shared buffers (PostgreSQL)

Query Detail

Click a query to see its detail page, which includes:

  • Timeseries — calls, total time, mean time, and rows over time. Use this to spot regressions or correlate with deployments.
  • EXPLAIN plans — captured execution plans showing how the database executes the query.

EXPLAIN Plans

EXPLAIN plans show the query planner's chosen strategy: sequential scans, index scans, join types, sort methods, and estimated vs. actual row counts.

Key fields in each plan:

FieldDescription
Total costPlanner's estimated total cost
Actual timeReal execution time in milliseconds
Seq scansNumber of sequential (full table) scans
Index scansNumber of index scans
Rows estimatedPlanner's row estimate
Rows actualActual rows processed

A large gap between estimated and actual rows indicates stale statistics — run ANALYZE on the affected tables.

Common Patterns

High total time, low mean time, high calls — a lightweight query called too often. Consider caching or batching.

High mean time, low calls — an expensive query. Check the EXPLAIN plan for sequential scans on large tables, missing indexes, or suboptimal joins.

Declining cache hit ratio — working set exceeds available memory. Consider increasing shared_buffers or optimizing queries to read fewer blocks.

Filtering by Time Range

Use the time picker to narrow the window. Query statistics are aggregated within the selected range. Unverified accounts are limited to the most recent 24 hours.

On this page