-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Do not send field query when using reserved connection #10163
Conversation
Signed-off-by: Florent Poinsard <[email protected]>
I think we should benchmark this change to see the impact of not catching fields. |
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
@harshit-gangal I added a benchmark in 2434d48. The results without the change are:
And here are the results with the change:
And here is the
The average delta is |
I think we should block those sql_modes or system variables that can lead to different fields (with and without reserved connection) so that we can cache it. |
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
@harshit-gangal, the micro-benchmark comparison between A and B, with A being this PR without the reusable reserved connections (f38bc2a) and the unsupported sql_mode check (a67b92d), and B being this PR's HEAD, are as follows:
Overall there is not a lot of difference, the results are pretty similar. |
I re-ran another set of benchmarks on a more stable hardware (rather than on my MacBook). Comparison between: before the feature and after the feature:
Comparison between: with the feature and with feature + unauthorized sql_mode and reusable reserved connections:
The p-value that we got for both comparisons seems low enough to me to confirm that this change is not negatively impacting the performance of Vitess. |
This is good work Florent! |
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.
one nit, otherwise looks good.
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Any reason not to merge this? I'm waiting on #10139, which depends on this PR |
Thanks! |
* Do not send field query when using reserved connection Signed-off-by: Florent Poinsard <[email protected]> * Fixed the expected output of tabletserver unit tests Signed-off-by: Florent Poinsard <[email protected]> * Addition of an end-to-end benchmark for a select in a reserved connectio Signed-off-by: Florent Poinsard <[email protected]> * Reuse reserved connection hen sending field query Signed-off-by: Florent Poinsard <[email protected]> * Fail queries when setting unsupported sql_mode Signed-off-by: Florent Poinsard <[email protected]> * error out for unsupported sql mode only when the mode is changed Signed-off-by: Florent Poinsard <[email protected]>
Description
This Pull Request changes the query engine so it does not send the field query for
SELECT
statement when we are in a reserved connection. This is done so we can use the same reserved connection as the actual query when sending the field query, and thus, use the same system variables, likesql_mode
for instance.Checklist