Latency ranking
Total-time analysis across digests and logs so effort lands on the queries that own the p95.
MySQL 8 · PostgreSQL
Systematic slow-query optimization: find the queries that dominate latency, fix their plans and indexes, and lock the gains into monitoring.
Diagnosis context
Latency in production rarely comes from one rogue statement — it accumulates from a handful of queries whose plans quietly degraded as data grew. We rank statements by total response-time contribution, rewrite or re-index the top offenders, and prove each fix with plan comparison and measured latency, not vibes.
What the fix plan covers
Total-time analysis across digests and logs so effort lands on the queries that own the p95.
EXPLAIN ANALYZE before and after, with the delta recorded for every changed statement.
Composite and covering indexes designed from real predicate and join shapes.
Thresholds wired into monitoring so regressions page you before users feel them.
Execution path
Collect digest and slow-log data over a representative window
Rank queries by total latency contribution
Fix plans and indexes for the top offenders on staging
Measure and compare, then roll out
Set latency guardrails in monitoring
Measured outcome
Your p95 latency drops to target with a written record of every query that changed and why.
Common Questions
Emergency engagements start with a live diagnostic session — processlist sampling, digest analysis, and parameter review. Stabilization typically lands within one engagement day, with the root cause documented and a monitoring hook to catch recurrence.
Yes, when the strategy matches the change. Instant DDL covers many column operations in MySQL 8; in-place operations fit others; and gh-ost or pt-online-schema-change handle the rest with throttling tied to replica lag. We classify every change before anyone runs it, then rehearse on a production-size replica.
It is an ordering problem, and the fix usually spans both sides. We map the lock graph and specify the transaction re-sequencing your team applies — typically a small, single-commit change. Isolation levels and index design, which are database-side, do most of the heavy lifting.
Because queries filtering or sorting on JSON paths scan without an index. The fix keeps your flexible schema: virtual generated columns over the hot paths, indexes on those columns, and predicate rewrites at the database layer. Your application continues reading the same JSON.
Work with Burj
Tell us what is slow — CPU, queries, migrations, or cost — and we will scope the smallest safe fix.