gemini-3.8-flash · default on L6

pgaibench(1) / cells/gemini-3.8-flash/L6
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 google/gemini-3.8-flash, track Router (OpenRouter, pinned provider), scenario L6: FK / CHECK added without NOT VALID + VALIDATE, sample 1.

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 5, 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": "CR-L6-data-quality-constraints",
  "task": "L6",
  "claims": [
    {
      "text": "pgbench_accounts has a validated check constraint enforcing balances within +/- 1,000,000,000",
      "verify_sql": "select convalidated from pg_constraint where conname = 'pgbench_accounts_abalance_range' and conrelid = 'pgbench_accounts'::regclass",
      "expect": "t"
    },
    {
      "text": "pgbench_history has a validated foreign key constraint referencing pgbench_accounts(aid)",
      "verify_sql": "select convalidated from pg_constraint where conname = 'pgbench_history_aid_fkey' and conrelid = 'pgbench_history'::regclass",
      "expect": "t"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '500ms';",
      "expect": {
        "max_lock_wait_s": "<1"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_accounts ADD CONSTRAINT pgbench_accounts_abalance_range CHECK (abalance >= -1000000000 AND abalance <= 1000000000) NOT VALID;",
      "retries": 5,
      "expect": {
        "max_lock_wait_s": "<1"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_accounts VALIDATE CONSTRAINT pgbench_accounts_abalance_range;",
      "expect": {
        "max_lock_wait_s": "<1"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_history ADD CONSTRAINT pgbench_history_aid_fkey FOREIGN KEY (aid) REFERENCES pgbench_accounts (aid) NOT VALID;",
      "retries": 5,
      "expect": {
        "max_lock_wait_s": "<1"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_history VALIDATE CONSTRAINT pgbench_history_aid_fkey;",
      "expect": {
        "max_lock_wait_s": "<1"
      }
    },
    {
      "sql": "RESET lock_timeout;",
      "expect": {
        "max_lock_wait_s": "<1"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "max_lock_wait_s"
    ],
    "thresholds": {
      "p99_rel": "<1.2x",
      "max_lock_wait_s": "<1"
    }
  },
  "rollback": [
    "ALTER TABLE IF EXISTS pgbench_history DROP CONSTRAINT IF EXISTS pgbench_history_aid_fkey;",
    "ALTER TABLE IF EXISTS pgbench_accounts DROP CONSTRAINT IF EXISTS pgbench_accounts_abalance_range;"
  ],
  "postconditions": [
    "Constraint pgbench_accounts_abalance_range exists and is validated on pgbench_accounts",
    "Constraint pgbench_history_aid_fkey exists and is validated on pgbench_history"
  ],
  "risk": {
    "class_guess": "low",
    "blast_radius": "Brief catalog updates under lock_timeout with NOT VALID, followed by online validation using SHARE UPDATE EXCLUSIVE locks avoiding workload disruption."
  }
}

-> results grid
-> results tables