Seed an inbox where one tenant owns most of the closed history
The existing fixture spreads rows evenly across tenants. It cannot reproduce the large account whose open-work view is slow.
- Focused work estimate
- 1h 15m + prerequisites
- Priority in the scenario
- Medium
- Engineering practice
- Synthetic datasets · SQL
Estimated field mix
- Data engineering50%
- Quality 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.
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
No earlier ticket is required. Complete the project setup above.
Acceptance criteria
- Seed 200,000 rows across 100 tenants with one tenant owning 60% of rows and documented open/closed ratios.
- Include tied creation times, unassigned work and tenants with no matching rows.
- Generate deterministic expected inbox IDs for named filter and ordering cases.
Implementation constraints
- Keep tenant identities fictitious and use a manifest so row counts and skew are explicit.
Verification to include
- Rebuild from the same seed and compare per-tenant counts and expected inbox results.
- Run the empty-tenant and timestamp-tie cases and verify a deterministic order.
Deliverables
- Seed generator, distribution summary and expected-result fixtures
Rollout and recovery
Load only a disposable development database; make the rebuild command reject an unrecognized database target.
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.