# Composite-index demonstration

Five queries over 400 constructed rows, followed by a UNIQUE(region, seq)
control. The two regions each contain seq=0..199. IDs and complete ordered
answers have explicit expectations in replay.py.

Run with Python 3.11+ and its standard SQLite module, in this directory:

    python3 -B replay.py --check results.json
    python3 -B -m unittest -v test_replay
    python3 -B -O -m unittest -v test_replay

To record your own runtime, use --write with a new filename. Existing files
are refused. All database work uses an isolated in-memory database.

The saved plans are observations on the recorded SQLite build, not stable
EXPLAIN QUERY PLAN API promises. Replay compares complete answers and unique
constraint behavior independently of plan wording. Checks validate known
answers and required provenance, not the authenticity of arbitrary records.
No elapsed-time, storage-I/O, concurrency, crash or PostgreSQL measurement.
No newly discovered engine defect or independent paper replication is claimed.

Sources:
- https://www.sqlite.org/queryplanner.html
- https://www.sqlite.org/optoverview.html#the_skip_scan_optimization
- https://www.sqlite.org/lang_createindex.html
- https://www.sqlite.org/eqp.html

Hesela original demonstration, 2026-11-18.
