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

Ensure that hex query predicates are normalized for planner cache #9145

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Nov 4, 2021

ℹ️ This is a backport of #9118

Description

We were not normalizing hex values of either format:

  • 0x01
  • x'73757265'

This had a major performance impact in workloads where hex query predicates are used in common queries as we could not leverage the query planner cache. This work normalizes them.

Note: the only explicitly non-normalized values are now bit types of the format b'1':

mysql> select b'011101110111010101110100' /* wut */;
+----------------------------------------------------------+
| b'011101110111010101110100'                              |
+----------------------------------------------------------+
| 0x777574                                                 |
+----------------------------------------------------------+
1 row in set (0.00 sec)

Related Issue(s)

#9101
#9118

Checklist

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

…nQueries

Ensure that hex query predicates are normalized for planner cache

Signed-off-by: Matt Lord <mattalord@gmail.com>
@mattlord mattlord force-pushed the NormalizeHexValuesInQueries-Backport12.0 branch from 6360b7b to 322ac09 Compare November 5, 2021 18:47
@deepthi deepthi changed the title Backport9118-Release12.0: Ensure that hex query predicates are normalized for planner cache Ensure that hex query predicates are normalized for planner cache Nov 8, 2021
@deepthi
Copy link
Member

deepthi commented Nov 9, 2021

Approving the backport based on a report that this is affecting production for a user.

@deepthi deepthi merged commit 22b2799 into vitessio:release-12.0 Nov 9, 2021
@deepthi deepthi deleted the NormalizeHexValuesInQueries-Backport12.0 branch November 9, 2021 18:15
DeathBorn pushed a commit to vinted/vitess that referenced this pull request Jan 27, 2023
…lizeHexValuesInQueries vitessio@322ac09 using vitessio#9163 as a guide

Merge pull request vitessio#9118 from planetscale/NormalizeHexValuesInQueries

Ensure that hex query predicates are normalized for planner cache

Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Vilius Okockis <vilius.okockis@vinted.com>
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.

4 participants