PostgreSQL and SQL Server

Query Rescue

One slow query. A clear diagnosis. A safer next step.

For a backend engineer or small SaaS team that can name the statement behind a slow request, job or report. I review the query in its execution context and explain which change is worth testing first.

What to prepare

Start with a short description, engine and version, observed latency and frequency. Mention whether the slowdown follows a release, data growth or a different parameter value.

After scope agreement, share redacted SQL, relevant schema and indexes, row counts and a representative plan if available. Keep proprietary code and plan files out of the public form.

What you receive

  • A short written diagnosis with plan evidence and remaining uncertainties
  • SQL or index options ranked by expected impact and risk
  • A before/after validation plan

The report identifies the plan step or wait that best explains the symptom, the limits of the evidence and the comparable inputs to use when testing.

Query Rescue starts from a statement you can already name, so it does not need the full-cluster snapshot. If you don't yet know which statement is responsible, start with the free PostgreSQL snapshot or the Postgres Slowdown Investigation instead.

Which evidence fits your database?

PostgreSQL

An existing plan can show where estimates diverge or a sort spills. If executing the query is costly or changes data, start with plain EXPLAIN or a prior capture. The slow-query profiling guide explains safe collection options.

SQL Server

Query Store can show when a different plan appeared and how its runtime statistics changed. An existing actual execution plan adds runtime row counts. Include representative parameter types and whether latency varies by value. See the parameter-sensitivity lab.

When the bottleneck spans queries

If several endpoints slow down together, locks move between sessions or the dominant statement is unknown, scope a PostgreSQL Performance Investigation or SQL Server Performance Review.

Agree the scope before sharing evidence

One query and its directly relevant execution context. One written review and one clarification round. I confirm the fixed fee and delivery window before paid work begins.

The scope excludes unlimited rewrites, production deployment, incident response and 24/7 coverage. Runtime improvement depends on your data and workload.