SQLLens.AI Docs
Pillar

Performance Monitor (PM)

Live MySQL/MariaDB monitoring in one panel: health dashboards, Profiler (Live) with batch optimize, running queries and locks, replication, index hygiene, config recommendations, and a diagnostic query palette — all tied to a single connection session.

Overview

Performance Monitor (PM) opens as a webview panel scoped to one database connection. After you click ▶ Start, it polls the server on a schedule you choose and keeps a rolling in-memory history (up to ~2 hours at the current interval).

Demo part 1 — live workload

Performance Monitor demo part 1: running queries, thread activity, locks, deadlocks.
Session workflow part 1 — live workload, thread activity, client connections, lock waits, and deadlocks (same GIF as Marketplace performance-monitor-v2-part1.gif).

Demo part 2 — configuration

Performance Monitor demo part 2: MySQL and PostgreSQL configuration recommendations.
Part 2 — MySQL and PostgreSQL configuration recommendation tabs.

Demo part 3 — indexes & outro

Performance Monitor demo part 3: unused indexes, table insights, session outro.
Part 3 — unused/redundant indexes, table insights, and session outro card.
MySQL / MariaDB

PM is built for MySQL and MariaDB. PostgreSQL connections use other tools (Query Log Optimizer, PostgreSQL Query Optimizer) instead of this panel.

How to open

Click ▶ Start to begin polling. The connection badge shows your schema context; after Start, the session database comes from SELECT DATABASE().

Header bar — session controls

ControlWhat it does
Connection badgeActive schema / database and host. Tooltip explains session vs. tree context.
Session statusStopped, Running for …, or paused state with elapsed duration.
Poll countdownProgress bar until the next automatic refresh (hidden when stopped).
HEALTH scoreComposite grade (A–F) and numeric score updated each poll.
Alert badgeCount of unacknowledged alerts (click ⚠️ tab).
Polling interval15s · 30s · 60s · 2m · 5m · 10m — controls profiler + metrics cadence.
▶ StartBegin monitoring (disabled while loading).
⏸ Pause / ▶ ResumePause stops automatic polls but keeps data; Resume runs one immediate sample then continues.
⟳ RefreshManual full refresh (profiler + metrics) while session is running.
🗑️ Clear Old DataReset rolling history buffers in the panel (does not change server state).

Tab bar

Tabs show badge counts when relevant. Dashboard and Alerts use icon-only tabs (hover for label).

TabBadgePurpose
📊 Dashboard—At-a-glance health, workload charts, clickable summary tiles.
⚡ Profiler (Live)Active Query commandsLatency timeline + query template grid; batch optimize workflow.
▶ Running QueriesFiltered active sessionsLive PROCESSLIST (non-idle); kill / optimize / explain.
⏱ Long TransactionsOpen InnoDB trxinformation_schema.innodb_trx with age tiers.
🔒 DB LocksActive lock waitsLock waits + deadlock history sub-tabs.
🔌 Connections—Host and user connection breakdown + pie charts.
⚙️ DB workload—Questions/Com_* rates and command counter table.
💡 MySQL config recommendationsCritical + high findingsHeuristic audit of global variables + engine signals.
🔁 ReplicationChannels needing attentionReplica status, lag, errors, AI assist hooks.
🐢 Slow QueriesSlow digest countEmbedded query digest + link to Query Log Optimizer.
📇 Unused indexesUnused + redundant rowsIndex hygiene grids with copy/run DROP.
📋 Table insights—NF/datatype/index heuristics on sampled rows.
⚠️ AlertsUnacknowledgedSession alerts with acknowledge / kill actions.

Dashboard tab

The default view when PM opens. Requires Start for live numbers; tiles link to detail tabs when clicked.

Status strip

DB health signals (18 tiles)

Color-coded grid at the top of Dashboard. Single-click a tile opens its related tab; double-click anywhere on the section opens MySQL config recommendations.

SignalTypical greenOpens tab
Buffer Pool Hit RateHigh hit %MySQL config
Buffer Pool Used<95% usedMySQL config
Active Transactions0–5Long Transactions
History List Length<1000Long Transactions
Pending Reads0MySQL config
Pending Writes0MySQL config
Connections used % (peak)<70%MySQL config
Threads Running %Low vs connectedConnections
Key Buffer UsedWithin rangeMySQL config
Temp Sort Table %LowMySQL config
Joins Without Indexes0Profiler (Live)
Avg Row Lock WaitLow msDB Locks
Table Cache Hit RateHighMySQL config
Temp Disk %LowMySQL config
Redo Log / BPBalanced ratioMySQL config
Thread Cache Hit RateHighConnections
Immediate Table LocksHigh %DB Locks
Files Open %LowMySQL config

Tiles show the internal metric key (e.g. pct_temp_sort_table) in small type. Orange/red borders match severity thresholds documented in each tile tooltip.

Summary tiles (click-through)

TileShowsClick opens
ConnectionsOpen / max, Threads_running, sparklines, % of maxConnections tab
Active AlertsUnacknowledged alert countAlerts tab
Query executionQPS gauge, read/write split, 30-minute line charts (Questions, slow share)Running Queries (running count zone)
Locks / deadlocksWait count, recent deadlock flagDB Locks tab
Long transactionsUNDO / ACTIVE / Not started countsLong Transactions tab
Unused / redundant index size% of total InnoDB index bytesUnused indexes tab
MySQL configAudit summary (critical/high/medium)MySQL config recommendations tab
Engine resource signalsQPS, buffer pool, InnoDB I/O proxiesMySQL config (engine signals section)
ReplicationLag, IO/SQL thread state, error flagReplication tab

Analytics chart (bottom of Dashboard)

Top tables cumulative chart with toggle between views. Refresh Analytics recomputes from the server. Requires an active monitoring session with enough samples.

Profiler (Live) tab

Two-panel layout: latency timeline on top, query template grid below. Resizable divider; either panel can collapse.

Query Latency chart controls

ControlAction
📈 Metrics overlayToggle QPS / connections lines on the chart.
🔍+ / 🔍−Zoom in / out on time range.
Zoom %200% … 10% preset levels.
📅 Custom rangePresets (5m, 15m, 30m, 1h, All) + slider; Apply / Cancel.
🔄 ResetClear custom zoom (also ESC / double-click chart).
Display intervalAuto · 15s · 30s · 1m · 2m · 5m aggregation.
▲ / ▼Collapse / expand chart panel.

Template grid

Sortable columns: rank, impact, rating, fingerprint, response time, usage %, calls, avg time, actions, database, table, query score, rows examined, type, recommended indexes. Filter box searches template / sample SQL / schema.

Sub-tabs (same as Query Log Optimizer): Query Fingerprints · Table Usage · Database Usage · User Usage.

Profiler action bar

ButtonAction
⚡ Optimize all QueriesBatch-analyze top templates; fills index recommendations.
Create Indexes + Validate ▼Validate (before/after EXPLAIN) or create only — opens Create Indexes overlay.
Export Index DDL ▼Export script file or copy to clipboard.
Row 📊 EXPLAIN / ⚡ Optimize / 📋 CopySingle-query workbench or clipboard.
Refresh AnalyticsRecompute profiler analytics when session has data.
Start New SessionReset profiler capture (when stopped or to clear templates).

See Create Indexes overlay for validation charts and drop actions.

Running Queries tab

Live information_schema.PROCESSLIST — idle Sleep/Daemon hidden by default.

Toolbar controlPurpose
FilterAll · Time > … (with comparator + seconds) · With SQL only.
Show replication threadsInclude replica I/O/SQL long-lived threads.
Filter textSearch user, host, DB, query text.
🔄 RefreshImmediate processlist snapshot.

Duration color tiers use configurable thresholds (white → green → amber → red). Columns: #, Time, Query, State, Reason, Actions, Id, Database, Command, User, Host — all sortable.

Row actions: ⏹ Kill · ⚡ Query Optimizer · 📊 EXPLAIN (when SQL is optimizable).

Long Transactions tab

InnoDB transactions from information_schema.innodb_trx. Summary line: UNDO · ACTIVE · Not started counts.

Columns: #, Status, Time, Undo log, Lock struct, Query, State, Reason, Actions, Thread Id, Database, Table, User, Isolation. Row tint by age band. Actions: Kill · Optimize · EXPLAIN. Double-click a cell to copy.

DB Locks tab

Sub-tabs: Active Lock Waits (count badge) · Deadlocks. 🔄 Refresh runs lock-wait queries only (not full PM poll).

Wait severity legend: <5s · 5–14s · 15–59s · 60s+ (row = blocked time).

Column groupContents
Lock metadataFamily, Source, Locked object, Lock type, Lock mode, Recommendation
WaiterWaiting PID, Waiting SQL, Blocked time, Waiter actions (⚡ / 📊)
BlockerBlocker PID, Blocking SQL, Blocker actions, Kill

Connections tab

Two side-by-side grids — By client host and By DB user — plus pie charts when data exists.

Columns: Name, Conns, ActiveConns, SleepConns, Active(%), Sleep(%), Total(%). Bar colors: red >80%, orange 50–80%. 🔄 Refresh re-queries PROCESSLIST.

DB workload tab

Gauge cards (when interval rates available): Total · Write · Read (select) · Insert · Update · Delete · Commits · Start transactions — each shows per sec and per min with relative bar fill.

Com_* counters table columns: Variable name, Value, Value %, Last increment, Increment % share.

MySQL config recommendations tab

Heuristic audit of SHOW GLOBAL VARIABLES + status-derived calculations (mysqltuner-style rows).

Control / sectionPurpose
SearchLook up a variable in loaded globals.
RefreshRe-fetch global variables and re-run audit.
Findings tableSeverity, variable, current vs recommended, rationale.
Engine signalsQPS, buffer pool hit %, InnoDB page I/O — session proxies (not OS CPU/RAM).
Variable search panelJump to a specific global variable value.

Replication tab

For replicas: channel grid (lag, IO/SQL threads, last error, binlog positions), guidance cards, applier thread SQL, lag history table, raw JSON details.

ButtonAction
🔄 RefreshRe-query SHOW REPLICA / SLAVE STATUS.
Copy context for AICopy replica diagnostics text for external review.
Open AI AssistSkyline AI Assist with replication context pre-loaded.
Fix with AI (per field)AI help for a specific replica status field.

Slow Queries tab

Embedded Query Digest from Performance Schema (filters: time window, limit, sort). Expand rows for full digest text.

⚡ Open Query Log Optimizer — opens the full Slow Query Log Analyzer panel (slow log file, mysql.slow_log, Optimize All, Create Indexes).

Unused indexes tab

Two grids: Unused indexes and Redundant indexes (sys.schema_redundant_indexes when available). Summary strip shows total InnoDB index bytes and hygiene percentages.

Unused columnsRedundant columns
Schema, Schema size, Table, Index, Size, DROP SQL, ActionsSchema, Schema size, Table, Redundant index + cols, Dominant index + cols, Reason, Size, DROP SQL, Actions

Actions: copy DROP statement · run DROP (with confirmation). 🔄 Refresh reloads from sys / Performance Schema. Expandable details explain computation and full report SQL.

Table insights tab

Sub-tabs: Top used tables (cached per connection) · All tables (on-demand, up to 24 non-empty tables).

All tables mode: Schema filter, table name contains, Run analysis. Grid columns include Rating, Table, DB design score, 1NF/2NF/3NF signals, datatype score, index score, index list, unused/redundant counts — sortable headers.

Alerts tab

Summary counts: Critical · Warning · Info (unacknowledged). Each alert card shows title, message, time.

ButtonWhen
AcknowledgeDismiss active alert (moves to acknowledged list).
KillWhen alert includes a process id — sends KILL to server (privilege required).

Diagnostic query palette

From PM or Command Palette (mysql.diagnostics.show): pick curated diagnostic SQL — wait events, bloat, missing indexes, etc. Results open in the normal SQL Results panel. See advanced diagnostics.

Data retention & maintenance

Tips