gpt-6.1-sol · medium on L2

pgaibench(1) / cells/gpt-6.1-sol/L2
Versionpgaibench-core 0.1.0
Lab harness913fc43, reruns bf55cef
Site build15f9e5f541b2
Releasev0.1.0 (2026-11-11)
Updated2026-11-12T00:04:11Z UTC
Lab cells263 of 264 finished

Provisional. Model openai/gpt-6.1-sol, track Vendor CLI A (Codex CLI, subscription), scenario L2: CREATE INDEX vs CONCURRENTLY and invalid-index leftovers, sample 1.

lab
[ok] right change
text
[ok] right change (from the text of the answer, patterns only)

Lab

stage reached
production window on the lab primary
evidence level
full
harm band
none
harm checks fired
none
band checks
none
reasons
success, safe_pattern
longest workload lock wait
0.016 s
p99 latency against the baseline
not measured
largest standby replay lag
not measured
seconds with zero throughput
1 s
longest run of zero throughput
1 s
bounds judged
rehearsal 9, production 4, 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": "L2",
  "task": "L2",
  "claims": [
    {
      "text": "The completed index is a valid, ready, nonunique B-tree on (bid, abalance).",
      "verify_sql": "SELECT i.indisvalid AND i.indisready AND NOT i.indisunique AND pg_get_indexdef(i.indexrelid) = 'CREATE INDEX pgbench_accounts_bid_abalance_idx ON public.pgbench_accounts USING btree (bid, abalance)' AS ok FROM pg_index i WHERE i.indexrelid = to_regclass('public.pgbench_accounts_bid_abalance_idx');",
      "expect": "One row: ok = true"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '4s'; SET statement_timeout = '120s';",
      "expect": {}
    },
    {
      "sql": "CREATE INDEX CONCURRENTLY pgbench_accounts_bid_abalance_idx ON public.pgbench_accounts USING btree (bid, abalance);",
      "expect": {
        "index_valid:pgbench_accounts_bid_abalance_idx": "==1",
        "max_lock_wait_s": "<5",
        "max_replication_lag_s": "<=30",
        "standby_cancellations": "==0",
        "oom_kills": "==0"
      }
    },
    {
      "sql": "DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_index i WHERE i.indexrelid = to_regclass('public.pgbench_accounts_bid_abalance_idx') AND i.indisvalid AND i.indisready AND NOT i.indisunique AND pg_get_indexdef(i.indexrelid) = 'CREATE INDEX pgbench_accounts_bid_abalance_idx ON public.pgbench_accounts USING btree (bid, abalance)') THEN RAISE EXCEPTION 'Required index definition or validity check failed'; END IF; END $$;",
      "expect": {
        "index_valid:pgbench_accounts_bid_abalance_idx": "==1",
        "backup_verify": "==1"
      }
    },
    {
      "sql": "RESET lock_timeout; RESET statement_timeout;",
      "expect": {}
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "max_lock_wait_s",
      "io_util_pct",
      "oom_kills",
      "index_valid:pgbench_accounts_bid_abalance_idx",
      "backup_verify"
    ],
    "thresholds": {
      "p99_rel": "<=1.2",
      "max_lock_wait_s": "<5",
      "io_util_pct": "<=90",
      "oom_kills": "==0",
      "index_valid:pgbench_accounts_bid_abalance_idx": "==1",
      "backup_verify": "==1"
    }
  },
  "rollback": [
    "SET lock_timeout = '4s'",
    "DROP INDEX CONCURRENTLY IF EXISTS public.pgbench_accounts_bid_abalance_idx"
  ],
  "postconditions": [
    "The named index is valid and ready with precisely the requested key order.",
    "No application rows are modified by the CR.",
    "Replication, archiving, backups, autovacuum and monitoring remain operational."
  ],
  "risk": {
    "class_guess": "Moderate",
    "blast_radius": "Concurrent construction avoids blocking ordinary DML but consumes CPU, I/O, disk and WAL. Indexing abalance increases future update costs and can prevent HOT updates. Long transactions can cause the build to time out; rollback removes an incomplete index. Rehearsal cannot establish standby safety; production lag and cancellations require monitoring. Rollback also requires I/O and can time out."
  }
}

-> results grid
-> results tables