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

Standardized fingerprint of a query #37

Open
debeando opened this issue Aug 29, 2018 · 0 comments
Open

Standardized fingerprint of a query #37

debeando opened this issue Aug 29, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@debeando
Copy link
Collaborator

debeando commented Aug 29, 2018

Reported by: Joffrey MICHAIE <@db_cat_twitter>

Related issues: #42

The tools pt-query-digest, percona / go-mysql and proxysql calculate different fingerprint for the same query, maybe is possible to use a standard. The idea of this issue is open thread to discuss about it.

Percona rules:

  • Shorten multi-value INSERT statements to a single VALUES() list.
  • Strip comments.
  • Replace all literals, such as quoted strings. For efficiency, the code that replaces literal numbers is somewhat non-selective, and might replace some things as numbers when they really are not. Hexadecimal literals are also replaced. NULL is treated as a literal. Numbers embedded in identifiers are also replaced, so tables named similarly will be fingerprinted to the same values (e.g. users_2009 and users_2010 will fingerprint identically).
  • Collapse all whitespace into a single space.
  • Lowercase the entire query.
  • Replace all literals inside of IN() and VALUES() lists with a single placeholder, regardless of cardinality.
@debeando debeando added the enhancement New feature or request label Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants