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

Backport12.0: Use decoded hex string when calculating the keyspace ID #9293

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Nov 29, 2021

Description

This is a backport of #9277, please see there for details.

The combination of #9118 and #9277 add more complete support for hex values of the form x'e19a' and 0xe19a in queries within vitess, specifically:

  1. The hex predicates/input values are normalized in the query -- without this the query planner cache is unused and each query is seen as unique, which has a very large impact on performance when some of your primary queries use hex values
  2. The columns where you insert these hex values can (still) be used in primary vindexes as the keyspace ID is calculated using the bytes stored for the column in MySQL rather than the "raw" BindVar value which is the string literal representation used in the query

Related Issue(s)

Backports: #9277

Checklist

  • Should this PR be backported? No, not beyond 12.0
  • Tests were added
  • Documentation is not required

@mattlord mattlord changed the title Merge pull request #9277 from planetscale/BinaryVindexHexVal Backport12.0: Use decoded hex string when calculating the keyspace ID Nov 29, 2021
@mattlord mattlord self-assigned this Nov 29, 2021
Use decoded hex string when calculating the keyspace ID

Signed-off-by: Matt Lord <[email protected]>
Copy link
Member

@frouioui frouioui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the original pull request (#9277), this back port looks good to me

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the backport.

@deepthi deepthi merged commit 5bc98f5 into vitessio:release-12.0 Dec 1, 2021
@deepthi deepthi deleted the backport9277to12.0 branch December 1, 2021 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants