MDEV-5675 - Performance: my_hash_sort_bin is called too often

Reduced number of my_hash_sort_bin() calls from 4 to 1 per query.
Reduced number of memory accesses done by my_hash_sort_bin().

Details:
- let MDL subsystem use pre-calculated hash value for hash
  inserts and deletes
- let table cache use pre-calculated MDL hash value
- MDL namespace is excluded from hash value calculation, so that
  hash value can be used by table cache as is
- hash value for MDL is calculated as resulting hash value + MDL
  namespace
- extended hash implementation to accept user defined hash function
This commit is contained in:
Sergey Vojtovich 2014-03-06 16:19:12 +04:00
commit b95c8ce530
13 changed files with 99 additions and 69 deletions

View file

@ -301,7 +301,7 @@ get_one_option(int optid __attribute__((unused)),
if (!my_hash_inited(&tables_to_redo))
{
my_hash_init2(&tables_to_redo, 16, &my_charset_bin,
16, 0, 0, my_hash_get_string, 0, HASH_UNIQUE);
16, 0, 0, my_hash_get_string, 0, 0, HASH_UNIQUE);
}
do
{