Analyzer
The analyzer is an open-source Docker container that runs on your machine and acts as a bridge between your PostgreSQL database and the Query Doctor browser tooling. Because IndeX-Ray runs in the browser, it cannot connect to an external database directly — the analyzer handles that connection locally, so your data never leaves your machine.
Source code: github.com/query-doctor/analyzer
What it reads
Section titled “What it reads”The analyzer makes read-only queries against your database to collect:
- Schema — tables, columns, indexes, constraints, functions, views, types, triggers, and extensions.
- Query statistics — recent queries and their execution metrics from the
pg_stat_statementsextension. Note thatpg_stat_statementscan contain real query text, including literal parameter values depending on your PostgreSQL configuration. - Table statistics — row estimates and sample rows from your tables, used for query plan analysis. These are real values read from your database.
Running the analyzer
Section titled “Running the analyzer”Docker (recommended)
Section titled “Docker (recommended)”docker run --pull always -t -p 2345:2345 ghcr.io/query-doctor/analyzerBuild from source
Section titled “Build from source”git clone https://github.com/Query-Doctor/analyzer.gitcd analyzerdocker build -t analyzer .docker run -p 2345:2345 analyzerThe analyzer listens on port 2345 by default.
Connecting from IndeX-Ray
Section titled “Connecting from IndeX-Ray”- Start the analyzer.
- Open IndeX-Ray and begin the onboarding flow.
- The default endpoint is
http://localhost:2345. If you’re running the analyzer on a different host or port, expand Advanced settings in the first onboarding step to change it. - Enter your PostgreSQL connection string and sync.
IndeX-Ray checks the analyzer’s health endpoint (GET /health) every 10 seconds and shows a status indicator so you know the connection is live.
The analyzer exposes two endpoints:
GET /health
Section titled “GET /health”Returns { "status": "ok" } when the analyzer is running and ready.
POST /postgres
Section titled “POST /postgres”Syncs schema and query data from the source database.
Request body:
{ "db": "postgresql://user:password@host:5432/database"}Response: a RemoteSyncResponse containing:
| Field | Description |
|---|---|
meta | Analyzer version and inferred statistics strategy |
schema | Full database schema (tables, indexes, constraints, etc.) |
queries | Recent queries from pg_stat_statements with metrics |
disabledIndexes | Indexes that are currently disabled |
Each field is wrapped in { type: "ok", value: ... } or { type: "error", error: "..." } so partial failures (e.g. pg_stat_statements not installed) don’t block the rest of the sync.
Prerequisites on the source database
Section titled “Prerequisites on the source database”-
pg_stat_statementsextension — required for query statistics. Install it with:CREATE EXTENSION IF NOT EXISTS pg_stat_statements;The extension must also be added to
shared_preload_librariesin your PostgreSQL config, which requires a server restart. -
Read access — the database user in your connection string needs read access to the schema and statistics views. No write permissions are required.