Skip to content
Start free

Read-only demo.One recorded hour of Querywake's lab: PostgreSQL 17 under pgbench, where the index behind a customer lookup was dropped and later restored. Nothing here comes from a customer database.

Slower executionsCriticalExpired

Mean execution time went from 0.318 ms to 21.8 ms.

Each execution of the statement takes longer than its baseline. Detection rule met: added 526.6 ms/s ≥ 250 ms/s. Closed as expired (baseline adapted): frozen baseline reached its maximum age while the change persisted; the new level was accepted as normal.

select count(*), sum(amount) from bench.orders where customer_id = $1Opened
Mean execution time×68.60.318 ms → 21.8 ms
Execution time per second×66.68.0 ms/s → 534.4 ms/s
Leading explanationIndex no longer usedLikely · 3 observations of 2 kinds support it; none against.
Expired after11 mintime spent active

Impact

Detection window against the frozen baseline.

MetricBaselineDuringChange
Mean execution time0.318 ms21.8 ms×68.6 (adverse)
Calls per second25.24/s24.51/s×0.97
Execution time per second8.0 ms/s534.4 ms/s×66.6 (adverse)
Rows per call1 row1 row×1.00
Shared blocks read per call0 blocks0 blocks—
Shared blocks hit per call18 blocks4919 blocks×273
Temp blocks written per call0 blocks0 blocks—

Mean execution time around the incident

One hour before to 30 minutes after; shaded while active.

Explanation

Fixed rules over the collected evidence, not probabilities. Several mechanisms can contribute to one incident.

  • Index no longer used

    AssessmentLikely
    Observed
    • index indexrelid 16447 on relid 16440 present at the start of the window and no longer reported at its end
    • sequential scans on relid 16440 rose from 0.000/s to 72.986/s
    • shared blocks hit per call ×273
    Againstnone
    Not observable
    • Statements are not linked to the relations they access in telemetry; only plans establish that link.
  • Execution plan change

    AssessmentPossible
    Observed
    • shared blocks hit per call ×273
    Againstnone
    Not observable
    • No plan for this statement was supplied (plans are never captured automatically).
  • Lock contention

    AssessmentUnlikely
    Observednone
    Against
    • no session waited on a heavyweight lock in any of 9 lock samples
    Not observable
    • Lightweight-lock (LWLock) and buffer-pin waits are not sampled.
  • Cache pressure

    AssessmentUnlikely
    Observednone
    Against
    • more buffer hits per call without more reads: more pages touched, not fewer cached
    Not observable
    • Shared-buffer misses may still be served by the OS page cache; track_io_timing shows actual read time.
  • Sorts or hashes spilling to disk

    AssessmentUnlikely
    Observednone
    Against
    • temporary blocks written per call did not increase
    Not observablenone
  • Parameter or data distribution shift

    AssessmentNot assessable
    Observednone
    Againstnone
    Not observable
    • Parameter values are never collected; a shift to more expensive parameters cannot be observed directly.
  • Shared resource contention

    AssessmentNot assessable
    Observednone
    Againstnone
    Not observable
    • Host CPU, I/O and wait-event time series are not part of the analyzed telemetry.

Next checks

Querywake never changes your database; every step is for a person to review and apply.

  1. 1

    Check whether the index still exists and is valid (pg_index.indisvalid) and whether it was dropped or rebuilt recently (DDL/audit logs, deploy history).

    Investigate · Index no longer used

    Done whenIndex presence and validity confirmed.

    No risk recorded for this check.

  2. 2

    If an index was removed unintentionally, evaluate recreating it with CREATE INDEX CONCURRENTLY in a maintenance window after testing on a copy.

    Review schema · Index no longer used

    Done whenThe statement's plan uses the index and its mean execution time returns to baseline.

    RiskIndex builds consume I/O and CPU; CONCURRENTLY takes longer and can leave an invalid index on failure; additional indexes slow writes.

  3. 3

    Compare the current plan with a known-good plan (querywake plan compare). Check whether ANALYZE/autoanalyze ran on the involved tables just before the change and whether row estimates diverge from actual rows.

    Investigate · Execution plan change

    Done whenThe new plan's structural fingerprint matches the known-good plan and the latency returns to baseline.

    RiskEXPLAIN ANALYZE executes the statement; run it only where that is acceptable (read-only statement, replica, or rolled-back transaction).

  4. 4

    If estimates are wrong because of stale or insufficient statistics, consider a manual ANALYZE of the affected table or extended statistics (CREATE STATISTICS) for correlated columns.

    Review configuration · Execution plan change

    Done whenEstimated and actual row counts agree within an order of magnitude in a new plan.

    RiskANALYZE takes a SHARE UPDATE EXCLUSIVE lock and reads a sample; extended statistics change plans for other statements too.

Timeline

State changes, cause assessments and notifications, oldest first. Order in time is not cause.

  1. Candidate (not yet confirmed)Derived · first detection
  2. Candidate (not yet confirmed) → ActiveDerived · 4 of the last 4 evaluations detected the change, persisting 60 s (≥ 45 s); current evaluation clean
  3. Active → ExpiredDerived · frozen baseline reached its maximum age while the change persisted; the new level was accepted as normal

Evidence

Every observation the assessment used, and where it was measured.

  • shared blocks hit per call ×273statement shape
  • index indexrelid 16447 on relid 16440 present at the start of the window and no longer reported at its endrelation statistics
  • sequential scans on relid 16440 rose from 0.000/s to 72.986/srelation statistics
  • no session waited on a heavyweight lock in any of 9 lock sampleslock samples

Grouped with this incident because they overlap in time; causes are analysed once for the group.

  • CriticalMore execution timeselect count(*), sum(amount) from bench.orders where customer_id = $1

Querywake lab: PostgreSQL 17 under pgbench (benchmarks/scenarios/lookup.sql, point.sql); index bench.orders_customer_idx dropped and restored. Recorded 2026-12-01.