26#ifndef TEMPTABLE_INDEX_H
27#define TEMPTABLE_INDEX_H
80 Cursor *insert_position) = 0;
106 Cursor *after_last)
const = 0;
111 const Cursor &target) = 0;
165 Cursor *insert_position)
override;
168 Cursor *first)
const override;
171 Cursor *after_last)
const override;
193 Cursor *insert_position)
override;
196 Cursor *first)
const override;
199 Cursor *after_last)
const override;
220 Cursor *insert_position)
override;
223 Cursor *first)
const override;
226 Cursor *after_last)
const override;
Custom memory allocator.
Definition: allocator.h:353
A cursor for iterating over an Index.
Definition: cursor.h:40
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:212
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:183
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:208
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:168
Hash_duplicates(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:162
Hash_duplicates_container Container
Definition: index.h:187
Container m_hash_table
Definition: index.h:209
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:204
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:210
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:267
Hash_unique_container Container
Definition: index.h:214
Hash_unique(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:214
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:263
Container m_hash_table
Definition: index.h:236
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:271
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:269
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:242
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:220
Index interface.
Definition: index.h:44
virtual Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const =0
Lookup (search) an indexed cells.
size_t m_number_of_indexed_columns
Number of indexed columns.
Definition: index.h:145
const KEY * m_mysql_index
MySQL index.
Definition: index.h:154
Index(const Table &table, const KEY &mysql_index)
Constructor.
Definition: index.cc:40
virtual Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position)=0
Insert a new entry into the index.
Lookup
Index lookup (search) result.
Definition: index.h:47
@ NOT_FOUND_CURSOR_UNDEFINED
The searched for indexed cells were not found and the cursor position is undefined.
@ FOUND
The searched for indexed cells were found and the cursor is positioned on them.
@ NOT_FOUND_CURSOR_POSITIONED_ON_NEXT
The searched for indexed cells were not found and the cursor is positioned on the next indexed cells ...
virtual ~Index()
Destructor.
Definition: index.cc:55
virtual void erase(const Cursor &target)=0
Erase the indexed cells pointer to by a cursor.
const Table & m_table
Table of the index.
Definition: index.h:148
const Indexed_column & indexed_column(size_t i) const
Get the Nth indexed column.
Definition: index.h:245
const KEY & mysql_index() const
Get the MySQL index structure which corresponds to this index.
Definition: index.h:252
virtual void truncate()=0
Truncate the index, deleting all of its entries.
virtual Lookup lookup(const Indexed_cells &search_cells, Cursor *first, Cursor *after_last) const =0
Lookup (search) an indexed cells.
std::array< Indexed_column, MAX_REF_PARTS > m_indexed_columns
Indexed columns metadata, from [0, m_number_of_indexed_columns).
Definition: index.h:151
virtual Cursor begin() const =0
Get a cursor to the first entry.
size_t number_of_indexed_columns() const
Get the number of indexed columns by this index.
Definition: index.h:241
virtual Cursor end() const =0
Get a cursor after the last entry.
const Table & table() const
Get the table of the index.
Definition: index.h:250
Indexed cells represent one or more cells that are covered by an index.
Definition: indexed_cells.h:45
Definition: indexed_column.h:38
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:154
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:158
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:156
Tree_container Container
Definition: index.h:159
Tree(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:62
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:68
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:113
Container m_tree
Definition: index.h:181
bool m_allow_duplicates
Definition: index.h:182
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:160
TempTable index containers declarations.
TempTable Indexed Cells declaration.
TempTable Indexed Column.
Definition: allocator.h:44
Result
Definition: result.h:33
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
TempTable custom allocator.
TempTable auxiliary Result enum.