Bug #81814 | InnoDB adaptive hash index uses a bad partitioning algorithm for the real world | ||
---|---|---|---|
Submitted: | 11 Jun 2016 16:25 | Modified: | 6 Apr 2022 20:59 |
Reporter: | Jeremy Cole (Basic Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.7.11 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | adaptive hash index, ahi, innodb_adaptive_hash_index_parts |
[11 Jun 2016 16:25]
Jeremy Cole
[11 Jun 2016 17:03]
Jeremy Cole
Oops, I accidentally copied the wrong one of the ut_fold_ulint_pair functions (heh, there's more than one), but it's the same implementation, anyway: /*************************************************************//** Folds a pair of ulints. @return folded value */ UNIV_INLINE ulint ut_fold_ulint_pair( /*===============*/ ulint n1, /*!< in: ulint */ ulint n2) /*!< in: ulint */ { return(((((n1 ^ n2 ^ UT_HASH_RANDOM_MASK2) << 8) + n1) ^ UT_HASH_RANDOM_MASK) + n2); }
[14 Jun 2016 13:55]
MySQL Verification Team
Jeremy, I agree with you on the entire matter. I think that a better hash algorithm should be used and have division based on the prime number. Traditionally, in MySQL, it was 7 ...... :-) Verified as a feature request.
[14 Jun 2016 14:57]
Mark Callaghan
Traditional hash function was also a source of fun a few years back: http://bugs.mysql.com/bug.php?id=66473
[15 Jun 2016 2:37]
Sunny Bains
I think this should be treated like a normal bug and not a feature request. It is an in memory data structure, should be an easy change and easy to test. I recommend that we push it in the next release.
[2 Mar 2017 15:56]
OCA Admin
Contribution submitted via Github - Bug #81814: InnoDB adaptive hash index uses a bad partitioning algorithm for the (*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/122#issuecomment-283647748): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_108539733.txt (text/plain), 2.33 KiB.
[29 May 2018 16:07]
OCA Admin
Contribution submitted via Github - Bug #81814: InnoDB adaptive hash index uses a bad partitioning algorithm (*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/210#issuecomment-392573374): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_190803597.txt (text/plain), 2.28 KiB.
[28 Dec 2020 19:01]
Justin Swanhart
Was this fixed? This bug is still in verified state.
[6 Apr 2022 20:59]
Marcin Babij
Posted by developer: This will be fixed in MySQL Server 8.0.30. The fix bases on changing the InnoDB's hash function to much stronger one. Unit tests are added to assure the reporter's test case and other similar sequences are handled correctly, that is are distributed quite uniformly.