mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
InnoDB: Remove redundant page_no field from dict_index_t.
This completes the patch for fast TRUNCATE TABLE. innobase/dict/dict0boot.c: dict_boot(): Add page_no parameter to dict_index_add_to_cache() innobase/dict/dict0crea.c: Remove dict_index_t:page_no; add ind_node_t:page_no innobase/dict/dict0dict.c: dict_index_add_to_cache(): Add parameter page_no dict_tree_create(): Add parameter page_no innobase/dict/dict0load.c: dict_load_indexes(): Add page_no to dict_index_add_to_cache() call innobase/ibuf/ibuf0ibuf.c: ibuf_data_init_for_space(): Move page_no to dict_index_add_to_cache() innobase/include/dict0crea.h: ind_node_t: Add page_no field innobase/include/dict0dict.h: dict_index_add_to_cache(): Add page_no dict_tree_create(): Add page_no innobase/include/dict0mem.h: dict_index_t: Remove page_no, as dict_tree_t has "page" field innobase/row/row0mysql.c: row_truncate_table_for_mysql(): Improve the comments
This commit is contained in:
parent
c277421d06
commit
4db9aaeea7
9 changed files with 49 additions and 43 deletions
|
|
@ -1374,8 +1374,9 @@ dict_index_add_to_cache(
|
|||
/*====================*/
|
||||
/* out: TRUE if success */
|
||||
dict_table_t* table, /* in: table on which the index is */
|
||||
dict_index_t* index) /* in, own: index; NOTE! The index memory
|
||||
dict_index_t* index, /* in, own: index; NOTE! The index memory
|
||||
object is freed in this function! */
|
||||
ulint page_no)/* in: root page number of the index */
|
||||
{
|
||||
dict_index_t* new_index;
|
||||
dict_tree_t* tree;
|
||||
|
|
@ -1461,10 +1462,9 @@ dict_index_add_to_cache(
|
|||
tree = dict_index_get_tree(
|
||||
UT_LIST_GET_FIRST(cluster->indexes));
|
||||
new_index->tree = tree;
|
||||
new_index->page_no = tree->page;
|
||||
} else {
|
||||
/* Create an index tree memory object for the index */
|
||||
tree = dict_tree_create(new_index);
|
||||
tree = dict_tree_create(new_index, page_no);
|
||||
ut_ad(tree);
|
||||
|
||||
new_index->tree = tree;
|
||||
|
|
@ -1749,7 +1749,6 @@ dict_index_build_internal_clust(
|
|||
new_index->n_user_defined_cols = index->n_fields;
|
||||
|
||||
new_index->id = index->id;
|
||||
new_index->page_no = index->page_no;
|
||||
|
||||
if (table->type != DICT_TABLE_ORDINARY) {
|
||||
/* The index is mixed: copy common key prefix fields */
|
||||
|
|
@ -1928,7 +1927,6 @@ dict_index_build_internal_non_clust(
|
|||
new_index->n_user_defined_cols = index->n_fields;
|
||||
|
||||
new_index->id = index->id;
|
||||
new_index->page_no = index->page_no;
|
||||
|
||||
/* Copy fields from index to new_index */
|
||||
dict_index_copy(new_index, index, 0, index->n_fields);
|
||||
|
|
@ -3565,9 +3563,10 @@ dict_tree_t*
|
|||
dict_tree_create(
|
||||
/*=============*/
|
||||
/* out, own: created tree */
|
||||
dict_index_t* index) /* in: the index for which to create: in the
|
||||
dict_index_t* index, /* in: the index for which to create: in the
|
||||
case of a mixed tree, this should be the
|
||||
index of the cluster object */
|
||||
ulint page_no)/* in: root page number of the index */
|
||||
{
|
||||
dict_tree_t* tree;
|
||||
|
||||
|
|
@ -3577,7 +3576,7 @@ dict_tree_create(
|
|||
|
||||
tree->type = index->type;
|
||||
tree->space = index->space;
|
||||
tree->page = index->page_no;
|
||||
tree->page = page_no;
|
||||
|
||||
tree->id = index->id;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue