summaryrefslogtreecommitdiff
path: root/storage/innobase/include/hash0hash.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-18 12:17:37 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-18 14:16:01 +0300
commitbf3c862faa8efed4a662725ec27586cd69e9228e (patch)
tree85acdff0c73a376fa5cdd15a6d8f92bff3efe303 /storage/innobase/include/hash0hash.h
parent9159b8976f7dfe9c956608f23df42d49ba1fcbbc (diff)
downloadmariadb-git-bf3c862faa8efed4a662725ec27586cd69e9228e.tar.gz
MDEV-22871: Clean up btr_search_sys
btr_search_sys::parts[]: A single structure for the partitions of the adaptive hash index. Replaces the 3 separate arrays: btr_search_latches[], btr_search_sys->hash_tables, btr_search_sys->hash_tables[i]->heap. hash_table_t::heap, hash_table_t::adaptive: Remove. ha0ha.cc: Remove. Move all code to btr0sea.cc.
Diffstat (limited to 'storage/innobase/include/hash0hash.h')
-rw-r--r--storage/innobase/include/hash0hash.h36
1 files changed, 13 insertions, 23 deletions
diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h
index 29e242a540d..8d84e6e976c 100644
--- a/storage/innobase/include/hash0hash.h
+++ b/storage/innobase/include/hash0hash.h
@@ -24,11 +24,8 @@ The simple hash table utility
Created 5/20/1997 Heikki Tuuri
*******************************************************/
-#ifndef hash0hash_h
-#define hash0hash_h
-
-#include "mem0mem.h"
-#include "sync0rw.h"
+#pragma once
+#include "ut0rnd.h"
struct hash_table_t;
struct hash_cell_t{
@@ -259,26 +256,19 @@ do {\
}\
} while (0)
-/* The hash table structure */
-struct hash_table_t {
-#ifdef BTR_CUR_HASH_ADAPT
-# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
- ibool adaptive;/* TRUE if this is the hash
- table of the adaptive hash
- index */
-# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
-#endif /* BTR_CUR_HASH_ADAPT */
- ulint n_cells;/* number of cells in the hash table */
- hash_cell_t* array; /*!< pointer to cell array */
- mem_heap_t* heap;
-#ifdef UNIV_DEBUG
- ulint magic_n;
-# define HASH_TABLE_MAGIC_N 76561114
-#endif /* UNIV_DEBUG */
+/** Hash table with singly-linkde overflow lists */
+struct hash_table_t
+{
+ /** number of elements in array (a prime number) */
+ ulint n_cells;
+ /** the hash array */
+ hash_cell_t *array;
+
+ /** Create the hash table.
+ @param n the lower bound of n_cells */
+ void create(ulint n);
ulint calc_hash(ulint fold) const { return ut_hash_ulint(fold, n_cells); }
};
#include "hash0hash.ic"
-
-#endif