diff options
author | unknown <marko@hundin.mysql.fi> | 2005-01-14 13:54:23 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-01-14 13:54:23 +0200 |
commit | 4db9aaeea7e8ffce21740913071d58793340af3d (patch) | |
tree | d120530f84497dffd33fe530b9a42f36fe657b37 /innobase/row/row0mysql.c | |
parent | c277421d06a7442aa7e25bf85b5b918fec1c45c0 (diff) | |
download | mariadb-git-4db9aaeea7e8ffce21740913071d58793340af3d.tar.gz |
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
Diffstat (limited to 'innobase/row/row0mysql.c')
-rw-r--r-- | innobase/row/row0mysql.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index a9b9d096e6b..6aaa0cbcf1b 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2455,12 +2455,20 @@ queries on the table. 2) Purge and rollback: we assign a new table id for the table. Since purge and rollback look for the table based on the table id, they see the table as 'dropped' and discard their operations. -3) Insert buffer: we remove all entries for the table in the insert -buffer tree; ... TODO +3) Insert buffer: TRUNCATE TABLE is analogous to DROP TABLE, so we do not +have to remove insert buffer records, as the insert buffer works at a low +level. If a freed page is later reallocated, the allocator will remove +the ibuf entries for it. + +TODO: when we truncate *.ibd files (analogous to DISCARD TABLESPACE), we +will have to remove we remove all entries for the table in the insert +buffer tree! + 4) Linear readahead and random readahead: we use the same method as in 3) to -discard ongoing operations. +discard ongoing operations. (This will only be relevant for TRUNCATE TABLE +by DISCARD TABLESPACE.) 5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we -do not allow the discard. We also reserve the data dictionary latch. */ +do not allow the TRUNCATE. We also reserve the data dictionary latch. */ static const char renumber_tablespace_proc[] = "PROCEDURE RENUMBER_TABLESPACE_PROC () IS\n" |