Skip to content
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

planner: do not choose point get when exists read from tiflash hint. #17046

Closed
6 changes: 5 additions & 1 deletion planner/core/point_get_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,13 @@ func newBatchPointGetPlan(
}.Init(ctx, statsInfo, schema, names, 0)
}

func isHintReadFromTiFlash(hint *ast.TableOptimizerHint) bool {
return hint.HintName.L == "read_from_storage" && hint.HintData.(model.CIStr).L == "tiflash"
lzmhhh123 marked this conversation as resolved.
Show resolved Hide resolved
}

func selStmtHasTiFlashHint(selStmt *ast.SelectStmt) bool {
for _, hint := range selStmt.TableHints {
if hint.HintName.L == "read_from_storage" && hint.HintData.(model.CIStr).L == "tiflash" {
if isHintReadFromTiFlash(hint) {
return true
}
}
Expand Down