Phase A covers dBASE III+/IV NTX (single-tag) and MDX (multi-tag) index families with memo integration. Phase B extends to FoxPro CDX.
- Index Catalog —
IndexDescriptormodels logical tags (expression, filter, sort order, collation) and binds to physical files. - Reader Pipeline —
IndexCursorexposes seek/scan primitives backed byBTreeNavigatorwith lazy page loading and cache-aware readahead. - Writer Pipeline — Mutation journal buffers delta pages, flushed through
IndexRebuilderwith crash-safe checkpoints. Deferred maintenance hooks coordinate withTransactionScopeto avoid torn updates.
| Operation | CLI Command | Provider API | Notes |
|---|---|---|---|
| Rebuild single index | xbase dbfreindex --table <path> --tag <name> |
IndexMaintenance.RebuildAsync |
Uses shadow file then swap |
| Pack deleted records | xbase dbfpack --table <path> |
TableMaintenance.PackAsync |
Triggers index vacuum afterwards |
| Diagnose stats | xbase dbfinfo --detail indexes |
IndexDiagnostics.GetUsageAsync |
Reports selectivity + fragmentation |
- Primary data writes land in WAL before index updates.
- Index delta pages are idempotent; recovery replays operations until tag root LSN matches journal checkpoint.
- Online DDL leverages
IndexDefinitionChangedevents so providers can rebuild or discard tags without blocking readers.
- Unit:
BTreeNavigatorTests,IndexExpressionCompilerTests. - Integration:
IndexMaintenanceTestsacross NTX/MDX fixtures with concurrent mutation scenarios. - Performance: Benchmark harness (
XBase.Benchmarks) to validate seek latency, index hit ratio (>70%) for M5 acceptance.
- Extend collation support for FoxPro CDX (compound and descending indexes).
- Introduce structural compression for large tag trees.
End of INDEXES.md