warmVectorIndex method

Future<void> warmVectorIndex(
  1. String tableName,
  2. String columnName
)

V49: targeted async warm for a single binding — same async cost as warmVectorIndexes but confined to one (table, column). Idempotent; a no-op when the binding is already built.

Implementation

Future<void> warmVectorIndex(String tableName, String columnName) async {
  final key = '${tableName.toLowerCase()}:${columnName.toLowerCase()}';
  final binding = _vectorIndexes[key];
  if (binding == null) {
    throw StateError(
      'warmVectorIndex: no vector index on $tableName.$columnName',
    );
  }
  if (binding.index != null) return;
  final pt = _pagedTable(binding.spec.table);
  if (pt != null) {
    await _buildPagedVectorIndex(binding, pt);
  } else {
    _vectorIndexFor(binding.spec.table, binding.spec.column);
  }
  if (path != null) await _persist();
}