executor: add TiCIVectorQueryInfo for hybrid vector queries#405
Open
kolafish wants to merge 1 commit intopingcap:masterfrom
Open
executor: add TiCIVectorQueryInfo for hybrid vector queries#405kolafish wants to merge 1 commit intopingcap:masterfrom
kolafish wants to merge 1 commit intopingcap:masterfrom
Conversation
Contributor
Author
Add TiCIVectorQueryInfo protobuf message to support TiCI hybrid index vector search. This enables TiDB planner to push down vector top-k queries through the TiCI path instead of the legacy ANN path. Changes: - Add TiCIVectorQueryInfo message with index_id, column_id, distance_metric, top_k, query_vector, dimension, filter_expr, and column_name fields. - Add tici_vector_query_info field to IndexScan (field 8). - Add TiCI vector scan context metrics to TiFlashScanContext (fields 200-205). - Regenerate Go code.
5b61584 to
a25a67b
Compare
winoros
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Add
TiCIVectorQueryInfoprotobuf message to support TiCI hybrid index vector search.Currently, vector search in TiDB uses the legacy ANN/columnar path (
ANNQueryInfo). For hybrid indexes that contain both inverted and vector components, we need a dedicated query payload so the TiDB planner can push down vector top-k queries through the TiCI path, enabling combined vector + filter execution within a single TiCI query.What changed and how does it work?
New message
TiCIVectorQueryInfoinexecutor.proto:index_id— the hybrid index containing the vector componentcolumn_id— vector column ID (TiCI resolves vector sub-index by(column_id, distance_metric))distance_metric— reuses existingVectorDistanceMetricenum (L2, COSINE, INNER_PRODUCT)top_k— number of nearest neighbors to returnquery_vector— query vector serialized as little-endian float32 bytesdimension— dimensionality for validationfilter_expr— optional pushed-down filter expression (reuses tipbExpr)column_name— for debug/explain outputIndexScanfield 8:tici_vector_query_info, used alongside the existingfts_query_info(field 7). Only one should be set per scan.TiFlashScanContextfields 200-205: TiCI vector scan metrics (query count, search time, filter time, candidate count, result count, shard count).Check List
Tests
Side effects
Documentation
Release note