Featured WorkDeveloper ToolJune 2026Technical Case Study

QueryDoctor

Evidence-based PostgreSQL and MongoDB performance investigator

Interface Gallery (11 Screens)

Use arrows or dots to navigate
Home: "Find out why a query is slow", sample slow queries to try and recent analyses.New analysis: choose PostgreSQL or MongoDB, paste SQL and parameters, pick Explain only or Execute with analysis, or start from one of eight deliberately slow samples.Workload: queries ranked by total time, panels and regressions; import statistics, generate demo traffic or simulate a regression.History by query and all analyses.The recommendation model: what it predicts, how suggestions are ordered, how models compare, training data.What QueryDoctor does to the database, privacy, and how to connect your own databases.Sample "Recent orders for one customer" loaded.The finished analysis: planning and execution time, the plan as a graph (Seq Scan on orders is the slowest step, 93% of the time), the finding "97.2% of visited rows were discarded", and ranked index ideas with a predicted speed-up (about 20x) and the evidence level.The finished analysis: planning and execution time, the plan as a graph (Seq Scan on orders is the slowest step, 93% of the time), the finding "97.2% of visited rows were discarded", and ranked index ideas with a predicted speed-up (about 20x) and the evidence level.Ticking the consent box and running the benchmark builds the index in an isolated copy and measures 7 runs on each side: 95.4% faster (median 6 ms to 0.26 ms), same output, chart of every run, index size and build time.After generating demo traffic.
1/11

Home:Home: "Find out why a query is slow", sample slow queries to try and recent analyses.

System Overview

Give it a slow SELECT (or a MongoDB find/aggregate). It reads the execution plan, finds the bottleneck, tests index ideas with the planner without creating them, benchmarks the promising ones in an isolated copy of the data and recommends only what the measurements support. Every evidence level is labelled: suggested, planner-validated (what-if test) or benchmark-validated (measured). Explanations are generated from measurements; nothing a language model writes can change an evidence level, and the analysed database is never modified.

Infrastructure & Stack

Next.js web app (React Flow plan viewer), FastAPI (Python) API with a worker, PostgreSQL 16 (sample, benchmark and metadata instances), MongoDB 7, Redis, a learned model that ranks index suggestions

FastAPI
Celery
PostgreSQL 16
MongoDB 7
Next.js
Docker Compose

Container Topology & Ports

$ services: web http://localhost:3003, API http://localhost:4002 (OpenAPI at /docs); seven supporting containers (databases, redis, worker, seed)
$ how to run:

From the mydocker dashboard: type "query_doctor" then "up" (it brings up the whole stack, so the first start takes a few minutes), then "open".

Complete Flow & Screen Breakdown

Home
1. Home

Home: "Find out why a query is slow", sample slow queries to try and recent analyses.

Analyses new
2. Analyses new

New analysis: choose PostgreSQL or MongoDB, paste SQL and parameters, pick Explain only or Execute with analysis, or start from one of eight deliberately slow samples.

Workload
3. Workload

Workload: queries ranked by total time, panels and regressions; import statistics, generate demo traffic or simulate a regression.

Projects
4. Projects

History by query and all analyses.

Models
5. Models

The recommendation model: what it predicts, how suggestions are ordered, how models compare, training data.

Settings
6. Settings

What QueryDoctor does to the database, privacy, and how to connect your own databases.

New analysis sample selected
7. New analysis sample selected

Sample "Recent orders for one customer" loaded.

Analysis result
8. Analysis result

The finished analysis: planning and execution time, the plan as a graph (Seq Scan on orders is the slowest step, 93% of the time), the finding "97.2% of visited rows were discarded", and ranked index ideas with a predicted speed-up (about 20x) and the evidence level.

Analysis result full
9. Analysis result full

The finished analysis: planning and execution time, the plan as a graph (Seq Scan on orders is the slowest step, 93% of the time), the finding "97.2% of visited rows were discarded", and ranked index ideas with a predicted speed-up (about 20x) and the evidence level.

Benchmark result full
10. Benchmark result full

Ticking the consent box and running the benchmark builds the index in an isolated copy and measures 7 runs on each side: 95.4% faster (median 6 ms to 0.26 ms), same output, chart of every run, index size and build time.

Workload demo traffic
11. Workload demo traffic

After generating demo traffic.