ProofDevs
Specialists for this

Database performance incident

Find out why your database is slow or timing out

Free analysisNo commitment2 min

What is actually going on

Database incidents usually combine query shape, missing or ineffective indexes, lock contention, connection-pool pressure and workload changes. Performance tuning starts with measurement in a safe environment and protects data correctness while reducing the bottleneck.

How the work runs

Step 01

Capture the expensive work

Inspect query statistics, traces, locks, connection counts, execution plans and the time window when the problem appears.

Step 02

Test one change at a time

Compare query plans and response times for indexes, query rewrites, batching or pool settings without guessing in production.

Step 03

Release with a rollback

Apply the smallest safe change, monitor the workload and document what should trigger a rollback or a second investigation.

100% CPU is a symptom, not a diagnosis

A busy database may be executing a query repeatedly, waiting on locks, creating a bad plan, exhausting connections or processing a legitimate workload that has outgrown the current design. Each cause needs a different intervention.

The useful first response is to capture what the database is doing while the problem occurs. Restarting the database may restore service temporarily but removes evidence and leaves the workload unchanged.

What a performance review checks

A developer should connect application traces to database evidence instead of optimising an isolated query in a vacuum.

  • Slow-query statistics and execution plans for the actual parameters.
  • Indexes that match filters, joins and sort order without unnecessary write cost.
  • Locks, long transactions and code paths that keep connections open.
  • Connection-pool size compared with database limits and application concurrency.
  • Pagination, batching and data access patterns that load more rows than needed.
  • Backups, replicas and migration safety before a structural change.

Do not trade correctness for a faster response

A query that returns quickly but skips tenant filters, changes ordering or reads uncommitted data is not a safe performance fix. The acceptance check must include correctness, permissions and the business result as well as latency.

Once the bottleneck is measured, the fix may be a query or index change, a pool adjustment, a cache, an asynchronous job or a data-model decision. Hardware can be part of the answer, but it should not replace understanding the workload.

Safe tuning rule

Capture the before plan, test the change with representative data, and keep a rollback path for every production database modification.

Information that speeds up a database investigation

  • Database engine and version, hosting plan and approximate dataset size.
  • The endpoint, job or report that is slow, with an example request.
  • CPU, memory, connection and lock graphs around the incident.
  • Recent migrations, releases, traffic changes or new reporting queries.
  • A staging copy or a safe way to inspect plans without changing production data.

Common questions

Can you fix a database timeout without changing the application?

Sometimes an index, plan or configuration change is enough. The correct fix depends on evidence; query shape, connection behaviour and workload often need a small application change as well.

Should I add an index when a query is slow?

Only after checking the execution plan and write cost. An index helps when it matches the access pattern, but an unnecessary or poorly ordered index can increase storage and write work without fixing the real bottleneck.

Is database performance work safe on production?

It can be, with backups, measurements, a rollback plan and changes selected for the specific workload. Structural migrations and large index operations need an appropriate maintenance strategy.

Related