INNER CODE UNIT · C++
field_offset
epsilla-cloud/vectordb · engine/db/table_mvp.cpp:352
int64_t field_offset = table_segment_->vec_field_name_executor_pool_idx_map_[field_name];
// [Note] the following invocation is wrong
// execution::RAIIVecSearchExecutor(executor_pool_[field_offset],
// executor_pool_[field_offset]->acquire);
// because the value of executor_pool_[field_offset] could be different when
// evaluating twice, which will result in memory leak or core dump
std::unique_lock<std::mutex> lock(executor_pool_mutex_);
auto pool = executor_pool_.at(field_offset);
auto executor = execution::RAIIVecSearchExecutor(pool, pool->acquire());
lock.unlock();
// The query dimension needs to match the vector dimension.
if (std::holds_alternative<DenseVectorPtr>(query_data) && query_dimension != executor.exec_->dimension_) {
return Status(DB_UNEXPECTED_ERROR,
"Query dimension doesn't match the vector field dimension.");
}