27#ifndef TEMPTABLE_INDEX_H
28#define TEMPTABLE_INDEX_H
81 Cursor *insert_position) = 0;
107 Cursor *after_last)
const = 0;
112 const Cursor &target) = 0;
166 Cursor *insert_position)
override;
169 Cursor *first)
const override;
172 Cursor *after_last)
const override;
194 Cursor *insert_position)
override;
197 Cursor *first)
const override;
200 Cursor *after_last)
const override;
221 Cursor *insert_position)
override;
224 Cursor *first)
const override;
227 Cursor *after_last)
const override;
Custom memory allocator.
Definition: allocator.h:445
A cursor for iterating over an Index.
Definition: cursor.h:41
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:223
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:184
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:209
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:169
Hash_duplicates(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:163
Hash_duplicates_container Container
Definition: index.h:188
Container m_hash_table
Definition: index.h:210
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:205
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:221
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:278
Hash_unique_container Container
Definition: index.h:215
Hash_unique(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:225
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:274
Container m_hash_table
Definition: index.h:237
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:292
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:290
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:253
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:231
Index interface.
Definition: index.h:45
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:146
const KEY * m_mysql_index
MySQL index.
Definition: index.h:155
Index(const Table &table, const KEY &mysql_index)
Constructor.
Definition: index.cc:41
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:48
@ 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:56
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:149
const Indexed_column & indexed_column(size_t i) const
Get the Nth indexed column.
Definition: index.h:246
const KEY & mysql_index() const
Get the MySQL index structure which corresponds to this index.
Definition: index.h:253
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:152
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:242
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:251
Indexed cells represent one or more cells that are covered by an index.
Definition: indexed_cells.h:46
Definition: indexed_column.h:39
void erase(const Cursor &target) override
Erase the indexed cells pointer to by a cursor.
Definition: index.cc:155
Cursor begin() const override
Get a cursor to the first entry.
Definition: index.cc:159
void truncate() override
Truncate the index, deleting all of its entries.
Definition: index.cc:157
Tree_container Container
Definition: index.h:160
Tree(const Table &table, const KEY &mysql_index, const Allocator< Indexed_cells > &allocator)
Definition: index.cc:63
Result insert(const Indexed_cells &indexed_cells, Cursor *insert_position) override
Insert a new entry into the index.
Definition: index.cc:69
Lookup lookup(const Indexed_cells &search_cells, Cursor *first) const override
Lookup (search) an indexed cells.
Definition: index.cc:114
Container m_tree
Definition: index.h:182
bool m_allow_duplicates
Definition: index.h:183
Cursor end() const override
Get a cursor after the last entry.
Definition: index.cc:161
TempTable index containers declarations.
TempTable Indexed Cells declaration.
TempTable Indexed Column.
Definition: allocator.h:48
Result
Definition: result.h:34
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:42
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:53
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:48
TempTable custom allocator.
TempTable auxiliary Result enum.