-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
prepared statement doesn't work on 'insert into t1 select from t2 where id = ?' #26868
Comments
/assign |
In the latest master, the plan cache can be hit. Please confirm the issue @tiancaiamao . Note: Enable the config
|
@Reminiscent OK, I can confirm those steps and get the same result using the latest master. |
You can try this one to test it on a local tidb:
|
If I comment this condition tidb/planner/core/common_plans.go Line 483 in 8219011
The prepared plan cache can be used. |
Enhancement
The query is 'insert into t1 select from t2 where id = ?', it inserts a single line each time, repeat 1000 times with 200 concurrency.
The plan cache doesn't take effect, and it seems to be very inefficient.
Even worse, I suspect in this case it's even slower than the non-prepared statement.
As you can see, most of the time are spend on rebuild of the plan,
The text was updated successfully, but these errors were encountered: