From 02784a4c7e96db07e86730244ead709ca464da36 Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Tue, 8 Oct 2024 18:58:22 +0800 Subject: [PATCH] storage: Fix vector index not used (#9503) ref pingcap/tiflash#9032 Fix ANNIndexInfo is not utilized when TiDB specifies it Signed-off-by: Wish Co-authored-by: JaySon-Huang --- dbms/src/Storages/DeltaMerge/Filter/RSOperator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dbms/src/Storages/DeltaMerge/Filter/RSOperator.cpp b/dbms/src/Storages/DeltaMerge/Filter/RSOperator.cpp index c727b847573..f9f93510b6d 100644 --- a/dbms/src/Storages/DeltaMerge/Filter/RSOperator.cpp +++ b/dbms/src/Storages/DeltaMerge/Filter/RSOperator.cpp @@ -84,6 +84,13 @@ RSOperatorPtr RSOperator::build( if (likely(rs_operator != DM::EMPTY_RS_OPERATOR)) LOG_DEBUG(tracing_logger, "Rough set filter: {}", rs_operator->toDebugString()); + ANNQueryInfoPtr ann_query_info = nullptr; + if (dag_query->ann_query_info.query_type() != tipb::ANNQueryType::InvalidQueryType) + ann_query_info = std::make_shared(dag_query->ann_query_info); + + if (ann_query_info != nullptr) + rs_operator = wrapWithANNQueryInfo(rs_operator, ann_query_info); + return rs_operator; }