SQL performance tuning for SQL Server · PostgreSQL · TimescaleDB · YugabyteDB · MySQL · MariaDB · SQLite

Find the slow query that's
dragging your database down.

Culprit reads the statistics your database already keeps and tells you, in one sentence, what's slow, what it costs and how to fix it.

For macOS, Windows, Linux and the CLI · Explore sample diagnoses ↓

Read-onlyNothing leaves your machineFree, MIT licensedmacOS · Windows · Linux

Culprit SQL Studio dashboard for a SQL Server database: database time over five hours with a plan change on its timeline, findings ranked by severity, top queries, wait statistics and a blocked session

What a diagnosis looks like — click to try

High

A read from order_items times out on every run, at about 15 s.

Why
Its plan repeats a read of order_items 1.5M times, once per row: the query forces a loop join, where one hash join over a single pass would do.
Fix
Remove OPTION (LOOP JOIN) and let the optimizer choose.
Verify
Run it with actual rows: a hash join, and far fewer executions of order_items.
  • 70checks for performance and health
  • 27MCP tools for coding agents
  • 0 bytesleave your machine
  • <1 sto open; 10 ms per CLI call

Findings

Slow queries, missing indexes and unsafe migrations, ranked by cost.

Runaway loops in plans, plan regressions, parameter sniffing, missing and unused indexes, N+1 query storms, lock pile-ups, implicit conversions, spills to disk, sequence or XID exhaustion, and migration DDL that would lock a hot table. Each finding comes with the evidence, a production-safe fix and how to verify it.

A finding: a query repeats its read of order_items 1.5 million times because it forces a loop join, with its share of database time, the evidence, the plan's key step, the fix and how to verify it

Plans

Execution plans that explain themselves.

Insights in plain words, a diagram that shows where the cost goes, and every operator's details one click away. Compare any two plans from SSMS, EXPLAIN or MySQL, or test a virtual index with --with-index to prove the planner uses it before building it.

Two PostgreSQL execution plans compared: plan 13 is estimated 3.5 thousand times more expensive because it scans orders where plan 12 seeks an index, with the six changed steps

What changed

Query regressions: drag across a chart, get the why.

Compare two periods and Culprit lists what got slower, what's new and what improved, next to the deploys and statistics updates around them: "Got 293× slower at 5:00 PM, when SQL Server switched from plan 163 to plan 198."

What changed between two periods: one query got 293 times slower after a plan switch, seven new queries, and the deploy and statistics update around them

Live

Blocking and deadlocks: who is blocking whom, right now.

A wall of lock waits becomes one sentence and a tree: which session holds everyone up, why, and who waits behind it. Deadlocks get the same treatment, with the pattern named and the fix spelled out.

A blocking tree: session 71 has been idle in an open transaction for 22 seconds and two sessions wait behind it

Why Culprit

An expert's afternoon of performance tuning, done in seconds.

Answers, not raw numbers

Every finding is ranked by its share of database time and comes with the evidence, a fix that's safe on production and a way to prove it worked.

Fast and light

A 14 MB native app that opens in under a second and shows the last report at once while a fresh scan runs in the background. Nothing to install on the server.

Open and pluggable

MIT licensed. Add your own checks or database engines without forking: the app, the CLI and the agent tools share one Rust core.

Built for coding agents & CI

An MCP server for database performance. You stay in control.

culprit mcp gives Claude Code, Codex and Cursor 27 tools: the dashboard, findings with application file:line call sites, execution plans, virtual index testing, offline migration linting, schema drift, what changed, blocking, waits, index advice and verify. Every CLI command speaks JSON and SARIF 2.1.0 too.

  • Per-connection access. Off, statistics and plans (the default), or read-only queries you approve one by one.
  • Approve the exact statement. You see the SQL and what Culprit guarantees: one read-only statement, rolled back, capped in rows and time.
  • Everything audited. Every tool call lands in a local log you can read with culprit audit.
An approval dialog: claude-code wants to run a SELECT on a development connection; checked as read-only, rolled back, capped at 200 rows and 30 seconds; Deny or Run once
$ claude mcp add culprit -- culprit mcp
$ culprit agent init   # set up this repo's agents
> the order report keeps timing out on staging. why?
● culprit.dashboard staging
● culprit.findings staging · severity ≥ medium
● culprit.plan_insights query 263
It times out on every run (about 15 s, 27% of database time in app/reports/order_summary.rb:84): its plan repeats a read of order_items 1.5M times because the query forces a loop join. Removing OPTION (LOOP JOIN) lets SQL Server hash-join once.

Safe on production

Read-only by design. Careful by default.

Reads statistics only

Scans use catalog and statistics views with short lock timeouts. Estimated plans never run anything.

Production asks first

If Culprit can prove a statement only reads, it runs it read-only. Anything else on production asks you first.

Fixes are suggestions

Every fix is shown and copied, never applied, and uses online or concurrent operations where the server has them.

Your data stays yours

No account, no cloud, no telemetry. Passwords live in your OS keychain; Entra ID uses your az login.

Supported databases

One workflow across your databases.

Compare features in Engine parity, or choose a provider for setup and coverage.

TimescaleDB

PostgreSQL sources plus logical hypertable sizes and managed/compressed chunks.

Coverage and setup →

SQLite

Read-only file/catalog inspection, EXPLAIN QUERY PLAN and optional application query logs.

Coverage and setup →

Download

Download Culprit SQL Studio for macOS, Windows and Linux.

Free and open source under the MIT license.

macOS

Apple silicon and Intel · macOS 11+
Signed and notarized by Apple

Download .dmg

Windows

Windows 10 and 11 · x64
Not code-signed yet: SmartScreen may ask once

Download installer

Just the CLI

One binary for scripts, CI and agents. Download it for macOS, Linux or Windows, then:

$ culprit conn add shop --url 'postgres://app@db.example.com:5432/shop'
$ culprit dashboard shop                                     # the database at a glance
$ culprit lint-sql shop --file migrations/ --format sarif    # catch unsafe DDL in PRs

All releases and checksums: github.com/culpritsql/culprit-sql-studio/releases

Frequently asked questions

What permissions does Culprit need?

Read access to the database's statistics and catalog, or read access to a SQLite file. The required grants and optional sources vary by provider. Culprit explains which source is unavailable and the permission or setting it needs. See Engine parity for each provider's setup.

Do I need to install anything on the database server?

There's no background agent or collector to deploy. Culprit connects like a database client, or opens a SQLite file read-only, and uses the sources already available. Optional extensions or instrumentation can add evidence; each provider's coverage page explains its setup.

Will it change anything in my database?

No. Scans only read statistics and catalog views. The SQL editor runs reads read-only, and anything that could change data on a production connection asks you first. Suggested fixes are shown, never applied.

Is it a monitoring tool?

Culprit SQL Studio works on demand with zero background infrastructure, and when you want 24/7 fleet telemetry without per-seat fees, culprit collect streams bounded root-cause incidents and plans into your own Azure Data Explorer or ClickHouse cluster. Read Microsoft Database Hub vs. Culprit + ADX on the engineering blog.

Does it work with Azure SQL and Amazon RDS?

Yes. Azure SQL Database and Amazon RDS for PostgreSQL are tested, Entra ID sign-in uses your az login, and Culprit can find your Azure and AWS databases with your existing CLI login.

How is it different from the SSMS Query Store reports or pgAdmin?

Those show the numbers. Culprit reads them for you: it ranks what costs the most time, explains it in one sentence, gives the fix and tells you how to verify it, with a shared workflow across supported databases and an explanation when a source cannot supply the evidence.

Which coding agents work with it?

Any agent that speaks the Model Context Protocol, including Claude Code, Codex and Cursor. Agents can also call the CLI directly, since every command has JSON output.

Is it really free?

Yes. Culprit SQL Studio is open source under the MIT license: the app, the CLI and the MCP server.

Your slow query has a name. Find it in a minute.

Download Culprit SQL Studio