Skip to content

Commit 223aa98

Browse files
authored
Add a new load balance to improve the vector search performance when tiflash replica >1 (pingcap#295)
1 parent 91b4285 commit 223aa98

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: dbms/src/Storages/StorageDisaggregated.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ std::vector<pingcap::coprocessor::BatchCopTask> StorageDisaggregated::buildBatch
168168
physical_table_ids.emplace_back(remote_table_range.first);
169169
ranges_for_each_physical_table.emplace_back(remote_table_range.second);
170170
}
171-
171+
bool has_ann_query = table_scan.getANNQueryInfo().query_type() != tipb::ANNQueryType::InvalidQueryType;
172172
pingcap::kv::Cluster * cluster = context.getTMTContext().getKVCluster();
173173
pingcap::kv::Backoffer bo(pingcap::kv::copBuildTaskMaxBackoff);
174174
pingcap::kv::StoreType store_type = pingcap::kv::StoreType::TiFlash;
@@ -181,7 +181,8 @@ std::vector<pingcap::coprocessor::BatchCopTask> StorageDisaggregated::buildBatch
181181
ranges_for_each_physical_table,
182182
store_type,
183183
label_filter,
184-
&Poco::Logger::get("pingcap/coprocessor"));
184+
&Poco::Logger::get("pingcap/coprocessor"),
185+
has_ann_query);
185186
LOG_DEBUG(log, "batch cop tasks(nums: {}) build finish for tiflash_storage node", batch_cop_tasks.size());
186187
return batch_cop_tasks;
187188
}

0 commit comments

Comments
 (0)