Skip to main content

Sentinel-Encoded Schema

The persistent backend (SQLiteGMPBackend) avoids NULL in indexed columns, because NULL defeats composite B-tree index usage and slows retrieval.

Instead it uses sentinel values:

  • DEFAULT_NAMESPACE instead of a NULL tenant (single-tenant rows still index cleanly)
  • MAX_DATETIME instead of a NULL valid_until (open-ended validity is a concrete upper bound)

Combined with a composite B-tree index over the query columns and WAL mode (concurrent reads alongside a writer), this keeps point-in-time and tenant-scoped queries on the fast path.

Naming

"Sentinel" here means sentinel value (a placeholder standing in for absence) — unrelated to Sentinel-2 satellite imagery in the GEIANT project.

Source: src/aml/backends/sqlite_gmp.py