MySQL 8.3.0
Source Code Documentation
containers.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify it under
4the terms of the GNU General Public License, version 2.0, as published by the
5Free Software Foundation.
6
7This program is also distributed with certain software (including but not
8limited to OpenSSL) that is licensed under separate terms, as designated in a
9particular file or component or in included license documentation. The authors
10of MySQL hereby grant you an additional permission to link the program and
11your derivative works with the separately licensed software that they have
12included with MySQL.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
17for more details.
18
19You should have received a copy of the GNU General Public License along with
20this program; if not, write to the Free Software Foundation, Inc.,
2151 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23/** @file storage/temptable/include/temptable/containers.h
24TempTable index containers declarations. */
25
26#ifndef TEMPTABLE_CONTAINERS_H
27#define TEMPTABLE_CONTAINERS_H
28
29#include <set> /* std::multiset */
30#include <type_traits> /* std::is_same */
31#include <unordered_set> /* std::unordered_set, std::unordered_multiset */
32
33#include "storage/temptable/include/temptable/allocator.h" /* temptable::Allocator */
34#include "storage/temptable/include/temptable/indexed_cells.h" /* temptable::Indexed_cells */
35
36namespace temptable {
37
38/** The container used by tree unique and non-unique indexes. */
39typedef std::multiset<Indexed_cells, Indexed_cells_less,
40 Allocator<Indexed_cells>>
42
43/** The container used by hash non-unique indexes. */
44typedef std::unordered_multiset<Indexed_cells, Indexed_cells_hash,
48
49/** The container used by hash unique indexes. */
53
54static_assert(
55 std::is_same<Hash_duplicates_container::const_iterator,
56 Hash_unique_container::const_iterator>::value,
57 "Duplicates and unique hash tables must have the same iterator type.");
58
59} /* namespace temptable */
60
61#endif /* TEMPTABLE_CONTAINERS_H */
Custom memory allocator.
Definition: allocator.h:353
Indexed cells comparator (a == b).
Definition: indexed_cells.h:217
Indexed cells hasher.
Definition: indexed_cells.h:206
Indexed cells represent one or more cells that are covered by an index.
Definition: indexed_cells.h:45
TempTable Indexed Cells declaration.
Definition: allocator.h:44
std::multiset< Indexed_cells, Indexed_cells_less, Allocator< Indexed_cells > > Tree_container
The container used by tree unique and non-unique indexes.
Definition: containers.h:41
std::unordered_set< Indexed_cells, Indexed_cells_hash, Indexed_cells_equal_to, Allocator< Indexed_cells > > Hash_unique_container
The container used by hash unique indexes.
Definition: containers.h:52
std::unordered_multiset< Indexed_cells, Indexed_cells_hash, Indexed_cells_equal_to, Allocator< Indexed_cells > > Hash_duplicates_container
The container used by hash non-unique indexes.
Definition: containers.h:47
std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > > unordered_set
Definition: ut0new.h:2886
TempTable custom allocator.