-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: fix that vector index output empty result when pk is non-int type #57629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
38e74df
6c41ea2
ec3fb7b
2ba6fda
eca8aca
ccb08e7
d08472b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1194,15 +1194,19 @@ func getPossibleAccessPaths(ctx base.PlanContext, tableHints *hint.PlanHints, in | |
continue | ||
} | ||
} | ||
path := &util.AccessPath{Index: index} | ||
if index.VectorInfo != nil { | ||
// Because the value of `TiFlashReplica.Available` changes as the user modify replica, it is not ideal if the state of index changes accordingly. | ||
// So the current way to use the vector indexes is to require the TiFlash Replica to be available. | ||
if !tblInfo.TiFlashReplica.Available { | ||
continue | ||
} | ||
path := genTiFlashPath(tblInfo) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel that the original logic is different here set up "tablePath. IsCommonHandlePath = true". What does this setting do? Why is the original logic not needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A normal index will create the index's ranges. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
path.StoreType = kv.TiFlash | ||
path.Index = index | ||
publicPaths = append(publicPaths, path) | ||
continue | ||
} | ||
path := &util.AccessPath{Index: index} | ||
publicPaths = append(publicPaths, path) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to the highest priority.
Because when for the vector index path, the
IsIntHandlePath
can also be true. We need to use a new way to check the real pk path.