warmVectorIndexes method

Future<void> warmVectorIndexes()

Build every registered vector index that hasn't been warmed yet and, if a persistence path is configured, flush the built state to disk. Callers typically invoke this after bulk-loading rows so the built graph / centroids survive a subsequent reopen.

Paged tables are warmed here too (via async pt.scan()), which is the only way to build indexes on the paged backend — the sync SELECT executor can't drive the scan itself.

Implementation

Future<void> warmVectorIndexes() async {
  for (final e in _vectorIndexes.entries) {
    if (e.value.index != null) continue;
    final spec = e.value.spec;
    final pt = _pagedTable(spec.table);
    if (pt != null) {
      await _buildPagedVectorIndex(e.value, pt);
    } else {
      _vectorIndexFor(spec.table, spec.column);
    }
  }
  if (path != null && _vectorIndexes.isNotEmpty) {
    await _persist();
  }
}