If you’re using MySQL’s Performance Schema you may use “query digests” as IDs to identify specific query patterns in the events_statements_summary_by_digest Performance Schema Table.
You might assume these hashes are stable between different versions, so, for example, when upgrading from MySQL 5.7 to MySQL 8, you can compare the query response time and other execution details for the same hashes as part of your upgrade process and have confidence that queries run the same (or better) after the upgrade. Unfortunately, you can’t.
For some reason, the hashing algorithm is different between MySQL 5.6, MySQL 5.7, and MySQL 8 even for the most trivial queries:
MySQL 5.6
mysql> select digest,digest_text from events_statements_summary_by_digest where digest_text='commit'; +----------------------------------+-------------+ | digest | digest_text | …[Read more]