noCV
PQUERY-109 · Check write cost and deployment behavior

Keep performance fixtures useful after the inbox schema changes

Practice briefChoreIntermediate

A new nullable column changed the seed loader. The benchmark still completes, but most rows now take a cheap fallback path that users rarely see.

Focused work estimate
2h + prerequisites
Priority in the scenario
Medium
Engineering practice
Regression fixtures · Data validation

Estimated field mix

  • Quality engineering50%
  • Data engineering30%
  • Performance engineering20%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional maintenance service lists open work orders beside years of closed history. A query that was cheap in a small demo now scans far more rows than it returns. Recreate the schema and synthetic workload locally; no customer database or supplied fixture is assumed.

Setup prerequisites

  • Create an isolated local database with tenants, work orders and assignment history.
  • Seed 200,000 synthetic work orders with documented skew and a repeatable random seed; record PostgreSQL version, settings and resource limits.

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Validate row counts, state distributions, null ratios and assignment fan-out before a run.
  • Reject fixtures whose version or invariants do not match the query comparison manifest.
  • Retain representative expected responses so a faster wrong query cannot pass.

Implementation constraints

  • Express fixture invariants separately from the query implementation; avoid asserting only that SQL returns some rows.

Verification to include

  • Deliberately skew null ratios and remove assignment history; the fixture gate must report both changes.
  • Regenerate the approved fixture and run the same checks successfully without hand-edited counts.

Deliverables

  • Fixture-validation command and schema-change procedure

Rollout and recovery

Run validation before every benchmark; invalid data stops comparison and is rebuilt in the disposable database.

Value of the work

For the engineer: Practice reading execution plans, balancing read and write cost, and validating performance without weakening tenant boundaries.

For the team: Create reproducible query diagnostics and reversible index or query proposals for an operational application.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.