-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
sql bind will not be hit if the sql is similar as select * from x limit 0, 1
#13871
Comments
Why the problem occurs:
So the hash of case 3 can not be matched with case 1. |
package main
import "fmt"
import "github.com/pingcap/parser"
func main() {
sql := "select a from t limit 100,10"
normalized := parser.Normalize(sql)
digest := parser.DigestHash(normalized)
fmt.Println(normalized, digest)
normalized, digest = parser.NormalizeDigest(sql)
fmt.Println(normalized, digest)
}
|
I don't think this normalize is extra, "digest"'s definition is fingerprint of two SQL, it's not just MD5 of two unmoralized SQL? does the root cause should be "why we need pass a normalized sql into digest" - -? but for backward compatibility, it seems we need add a new method. |
Yes, agree with you.
|
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
Then run,
During the sleeping, show the execution plan in another client, but it still uses index
ia
What did you see instead?
What version of TiDB are you using (
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: