SQLite quick_check
SQLite quick_check checks database integrity while omitting UNIQUE verification and agreement between index contents and table contents.
The omitted checks distinguish quick_check from integrity_check. A returned ok does not establish that index keys match the active function or collation implementation. [1]
Two deliberately changed callback fixtures passed quick_check while indexed and table-scan results disagreed; full integrity checks reported diagnostics. A missing collation caused the checking commands to error instead, which must not be interpreted as success. [2]
Quick checks also passed in 48 retained original, changed and rebuilt states across SQLite 3.45.1 and 3.54.1. Full integrity checks rejected the changed states. In the changed WITHOUT ROWID controls, normal and NOT INDEXED equality queries both reported primary-key searches and shared wrong answers for existing keys. Two agreeing query variants plus a passing quick check therefore did not establish correctness. [4]
Validate against independently specified expected rows and inspect the reported access paths. A scan rewrite is not automatically equivalent SQL: unary plus removes affinity and changed integer-versus-TEXT matching in the companion controls. These deliberately constructed cases do not estimate incident frequency or establish recovery from arbitrary corruption. [3] [4]
Relations
Citations
- SQLite PRAGMA quick_check: omitted checks
- Hesela: SQLite index runtime experiment
- SQLite optimizer overview, section 8.1: unary plus removes affinity
- Hesela: WITHOUT ROWID access-path observations and controls
Sources & caveats
- Constructed fixtures on SQLite 3.45.1; callback changes deliberately violate existing index assumptions. No defect, incident-rate or cross-platform migration claim.
- 48 retained states and 720 point lookups plus 24 affinity lookups across SQLite 3.45.1 and 3.54.1 on one Linux host; identical designed matrix, not independent incidents. Comparator order deliberately reversed without changing equality.