gpt-6-luna · medium on D21pgaibench(1) / cells/gpt-6-luna/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 7, 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": "The existing orders_customer_created_idx has recorded index scans and should not be dropped as part of this change.",
"verify_sql": "SELECT indexrelname, idx_scan FROM pg_stat_user_indexes WHERE schemaname = 'public' AND relname = 'orders' AND indexrelname = 'orders_customer_created_idx'",
"expect": "orders_customer_created_idx has idx_scan > 0"
},
{
"text": "A btree index on orders.external_ref supports q07's equality lookup.",
"verify_sql": "SELECT indexdef FROM pg_indexes WHERE schemaname = 'public' AND tablename = 'orders' AND indexname = 'orders_external_ref_idx'",
"expect": "index definition is CREATE INDEX orders_external_ref_idx ON public.orders USING btree (external_ref)"
}
],
"steps": [
{
"sql": "DO $check$ BEGIN IF to_regclass('public.orders_external_ref_idx') IS NOT NULL THEN RAISE EXCEPTION 'orders_external_ref_idx already exists; inspect before proceeding'; END IF; END $check$",
"expect": {
"lockmanager_count": ">=0"
}
},
{
"sql": "CREATE INDEX CONCURRENTLY orders_external_ref_idx ON public.orders USING btree (external_ref)",
"expect": {
"index_valid:orders_external_ref_idx": "==1"
}
}
],
"rehearsal": {
"workload": "W_prod",
"minutes": 2,
"metrics": [
"shape_p50_ms:q07",
"p99_rel",
"tps",
"max_lock_wait_s",
"io_util_pct",
"oom_kills",
"index_valid:orders_external_ref_idx"
],
"thresholds": {
"shape_p50_ms:q07": "<674.2",
"p99_rel": "<1.2x",
"max_lock_wait_s": "<5",
"oom_kills": "==0",
"index_valid:orders_external_ref_idx": "==1"
}
},
"rollback": [
"DROP INDEX CONCURRENTLY IF EXISTS public.orders_external_ref_idx"
],
"postconditions": [
"orders_external_ref_idx is valid and indexes orders.external_ref.",
"q07 median latency is no more than half its baseline median.",
"orders_customer_created_idx remains present; it was not dropped.",
"No table rows are changed."
],
"risk": {
"class_guess": "moderate",
"blast_radius": "Concurrent index build reads the 5-million-row orders table and generates WAL and I/O; it avoids blocking ordinary writes but can affect latency and replication. The forwarded request to drop orders_customer_created_idx is not included: the catalog reports 15,211 scans, so dropping it is unsupported and could harm other queries."
}
}