#include "univ.i"
#include "data0data.h"
#include "dict0types.h"
#include "trx0types.h"
#include "que0types.h"
#include "mtr0mtr.h"
#include "rem0types.h"
#include "rem0rec.h"
#include "read0types.h"
#include "btr0types.h"
#include "row0mysql.h"
#include "lock0types.h"
Go to the source code of this file.
Classes | |
struct | merge_index_field_struct |
struct | merge_index_def_struct |
Typedefs | |
typedef struct merge_index_field_struct | merge_index_field_t |
typedef struct merge_index_def_struct | merge_index_def_t |
Functions | |
UNIV_INTERN ulint | row_merge_lock_table (trx_t *trx, dict_table_t *table, enum lock_mode mode) |
UNIV_INTERN void | row_merge_drop_index (dict_index_t *index, dict_table_t *table, trx_t *trx) |
UNIV_INTERN void | row_merge_drop_indexes (trx_t *trx, dict_table_t *table, dict_index_t **index, ulint num_created) |
UNIV_INTERN void | row_merge_drop_temp_indexes (void) |
UNIV_INTERN ulint | row_merge_rename_tables (dict_table_t *old_table, dict_table_t *new_table, const char *tmp_name, trx_t *trx) |
UNIV_INTERN dict_table_t * | row_merge_create_temporary_table (const char *table_name, const merge_index_def_t *index_def, const dict_table_t *table, trx_t *trx) |
UNIV_INTERN ulint | row_merge_rename_indexes (trx_t *trx, dict_table_t *table) |
UNIV_INTERN dict_index_t * | row_merge_create_index (trx_t *trx, dict_table_t *table, const merge_index_def_t *index_def) |
UNIV_INTERN ibool | row_merge_is_index_usable (const trx_t *trx, const dict_index_t *index) |
UNIV_INTERN ulint | row_merge_drop_table (trx_t *trx, dict_table_t *table) |
UNIV_INTERN ulint | row_merge_build_indexes (trx_t *trx, dict_table_t *old_table, dict_table_t *new_table, dict_index_t **indexes, ulint n_indexes, TABLE *table) |
Index build routines using a merge sort
Created 13/06/2005 Jan Lindstrom
Definition in file row0merge.h.
typedef struct merge_index_def_struct merge_index_def_t |
Definition of an index being created
Definition at line 64 of file row0merge.h.
typedef struct merge_index_field_struct merge_index_field_t |
Index field definition
Definition at line 51 of file row0merge.h.
UNIV_INTERN ulint row_merge_build_indexes | ( | trx_t * | trx, |
dict_table_t * | old_table, | ||
dict_table_t * | new_table, | ||
dict_index_t ** | indexes, | ||
ulint | n_indexes, | ||
TABLE * | table | ||
) |
Build indexes on a table by reading a clustered index, creating a temporary file containing index entries, merge sorting these index entries and inserting sorted index entries to indexes.
trx | in: transaction |
old_table | in: table where rows are read from |
new_table | in: table where indexes are created; identical to old_table unless creating a PRIMARY KEY |
indexes | in: indexes to be created |
n_indexes | in: size of indexes[] |
UNIV_INTERN dict_index_t* row_merge_create_index | ( | trx_t * | trx, |
dict_table_t * | table, | ||
const merge_index_def_t * | index_def | ||
) |
Create the index and load in to the dictionary.
trx | in/out: trx (sets error_state) |
table | in: the index is on this table |
UNIV_INTERN dict_table_t* row_merge_create_temporary_table | ( | const char * | table_name, |
const merge_index_def_t * | index_def, | ||
const dict_table_t * | table, | ||
trx_t * | trx | ||
) |
Create a temporary table for creating a primary key, using the definition of an existing table.
table_name | in: new table name |
index_def | in: the index definition of the primary key |
table | in: old table definition |
UNIV_INTERN void row_merge_drop_index | ( | dict_index_t * | index, |
dict_table_t * | table, | ||
trx_t * | trx | ||
) |
Drop an index from the InnoDB system tables. The data dictionary must have been locked exclusively by the caller, because the transaction will not be committed. in: transaction handle
index | in: index to be removed |
table | in: table |
UNIV_INTERN void row_merge_drop_indexes | ( | trx_t * | trx, |
dict_table_t * | table, | ||
dict_index_t ** | index, | ||
ulint | num_created | ||
) |
Drop those indexes which were created before an error occurred when building an index. The data dictionary must have been locked exclusively by the caller, because the transaction will not be committed. in: number of elements in index[]
trx | in: transaction |
table | in: table containing the indexes |
index | in: indexes to drop |
UNIV_INTERN ulint row_merge_drop_table | ( | trx_t * | trx, |
dict_table_t * | table | ||
) |
If there are views that refer to the old table name then we "attach" to the new instance of the table else we drop it immediately.
trx | in: transaction |
UNIV_INTERN void row_merge_drop_temp_indexes | ( | void | ) |
Drop all partially created indexes during crash recovery.
Referenced by recv_recovery_rollback_active().
UNIV_INTERN ibool row_merge_is_index_usable | ( | const trx_t * | trx, |
const dict_index_t * | index | ||
) |
Check if a transaction can use an index.
trx | in: transaction |
Referenced by ha_innobase::change_active_index(), ha_innobase::check(), and ha_innobase::records_in_range().
UNIV_INTERN ulint row_merge_lock_table | ( | trx_t * | trx, |
dict_table_t * | table, | ||
enum lock_mode | mode | ||
) |
Sets an exclusive lock on a table, for the duration of creating indexes.
trx | in/out: transaction |
table | in: table to lock |
UNIV_INTERN ulint row_merge_rename_indexes | ( | trx_t * | trx, |
dict_table_t * | table | ||
) |
Rename the temporary indexes in the dictionary to permanent ones. The data dictionary must have been locked exclusively by the caller, because the transaction will not be committed.
trx | in/out: transaction |
UNIV_INTERN ulint row_merge_rename_tables | ( | dict_table_t * | old_table, |
dict_table_t * | new_table, | ||
const char * | tmp_name, | ||
trx_t * | trx | ||
) |
Rename the tables in the data dictionary. The data dictionary must have been locked exclusively by the caller, because the transaction will not be committed.
old_table | in/out: old table, renamed to tmp_name |
new_table | in/out: new table, renamed to old_table->name |
tmp_name | in: new name for old_table |