claude-sonnet-5.5 · high on D21pgaibench(1) / cells/claude-sonnet-5.5/D21 | Version | pgaibench-core 0.1.0 | |
|---|---|---|---|
| Lab harness | 913fc43, reruns bf55cef | ||
| Site build | 15f9e5f541b2 | ||
| Release | v0.1.0 (2026-11-11) | ||
| Updated | 2026-11-12T00:04:11Z UTC | ||
| Lab cells | 263 of 264 finished | ||
- lab
- [inef] ineffective
- text
- [ok] right change (from the text of the answer, patterns only)
Lab
- stage reached
- rehearsal on the clone (stopped there)
- evidence level
stopped_at_rehearsal- harm band
- not measured
- harm checks fired
- none
- band checks
- none
- reasons
- rehearsal_failed
- longest workload lock wait
- not measured
- p99 latency against the baseline
- not measured
- largest standby replay lag
- not measured
- seconds with zero throughput
- not measured
- longest run of zero throughput
- not measured
- bounds judged
- rehearsal 6, production 0, never 0
"not measured" means the value does not exist for this cell (for example, the change never reached the lab primary). It is never zero.
Answer
The change request, as the model wrote it (JSON).
{
"id": "D21",
"task": "D21",
"claims": [
{
"text": "orders has no index on external_ref yet, so the new index name is free and no equivalent index exists",
"verify_sql": "select count(*) from pg_indexes where tablename='orders' and indexdef ilike '%(external_ref)%'",
"expect": "0"
},
{
"text": "orders_customer_created_idx is actively used (q06/q16 by customer_id), so it must not be dropped",
"verify_sql": "select idx_scan > 0 from pg_stat_user_indexes where indexrelname='orders_customer_created_idx'",
"expect": "true"
},
{
"text": "q07 predicate is an equality on orders.external_ref (text), servable by a btree index",
"verify_sql": "select data_type from information_schema.columns where table_name='orders' and column_name='external_ref'",
"expect": "text"
}
],
"steps": [
{
"sql": "CREATE INDEX CONCURRENTLY orders_external_ref_idx ON public.orders (external_ref)",
"expect": {
"index_valid:orders_external_ref_idx": "==1",
"index_valid:orders_customer_created_idx": "==1"
}
}
],
"rehearsal": {
"workload": "W_prod",
"minutes": 2,
"metrics": [
"shape_mean_ms:q07",
"shape_mean_ms:q06",
"shape_mean_ms:q09",
"p99_ms",
"tps",
"max_lock_wait_s",
"index_valid:orders_external_ref_idx"
],
"thresholds": {
"shape_mean_ms:q07": "<674",
"p99_ms": "<1.2x",
"max_lock_wait_s": "<1",
"index_valid:orders_external_ref_idx": "==1"
}
},
"rollback": [
"DROP INDEX CONCURRENTLY IF EXISTS public.orders_external_ref_idx"
],
"postconditions": [
"orders_external_ref_idx exists and is valid",
"orders_customer_created_idx still exists and is valid",
"q07 mean latency is at most half of the 1348 ms baseline",
"no rows changed in any table; replication streaming with low lag; WAL archiving and autovacuum still enabled"
],
"risk": {
"class_guess": "additive online index build (low risk)",
"blast_radius": "Table orders only. CREATE INDEX CONCURRENTLY does not block reads or writes, but it must wait for open transactions and adds I/O and about 150 MB of WAL for the standby to replay. Each insert (q09) and update that changes external_ref gets slightly more expensive. If the build fails it leaves an INVALID index, which the rollback drops. The requested drop of orders_customer_created_idx was deliberately NOT done: it has 15k scans from q06 and q16, and dropping it would cause sequential scans and a latency regression. Sam would need to confirm that those queries are gone before it is revisited. The CR is reversible by dropping the new index."
}
}