diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-08-06 15:28:58 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-08-06 15:28:58 +0300 |
commit | 6dad23f04aa5c8a022193cc74b62652a3c1e3057 (patch) | |
tree | 85141ad578749597ba997677bb56d3deddd17b4d /storage/innobase/page | |
parent | e974b564389af8251c2ba51060e6129e45431586 (diff) | |
download | mariadb-git-6dad23f04aa5c8a022193cc74b62652a3c1e3057.tar.gz |
MDEV-5834: Merge Kakao Defragmentation implementation to MariaDB 10.1
Merge https://github.com/kakao/mariadb-10.0 that contains Facebook's
implementation for defragmentation
facebook/mysql-5.6@a2d3a74
facebook/mysql-5.6@def96c8
facebook/mysql-5.6@9c67c5d
facebook/mysql-5.6@921a81b
facebook/mysql-5.6@aa519bd
facebook/mysql-5.6@fea7d13
facebook/mysql-5.6@09b29d3
facebook/mysql-5.6@9284abb
facebook/mysql-5.6@dbd623d
facebook/mysql-5.6@aed55dc
facebook/mysql-5.6@aad5c82
This version does not add new SQL-syntax and new handler API function.
Instead optimize table is mapped to defragment table if
innodb_defragment=ON, by default the feature is off.
Contains changes authored by Sunguck Lee (Kakao).
Diffstat (limited to 'storage/innobase/page')
-rw-r--r-- | storage/innobase/page/page0cur.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index f5f7e1299ce..97405261392 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -1349,6 +1349,21 @@ page_cur_insert_rec_zip( return(insert_rec); } + /* Page compress failed. If this happened on a + leaf page, put the data size into the sample + buffer. */ + if (page_is_leaf(page)) { + ulint occupied = page_get_data_size(page) + + page_dir_calc_reserved_space( + page_get_n_recs(page)); + index->stat_defrag_data_size_sample[ + index->stat_defrag_sample_next_slot] = + occupied; + index->stat_defrag_sample_next_slot = + (index->stat_defrag_sample_next_slot + + 1) % STAT_DEFRAG_DATA_SIZE_N_SAMPLE; + } + ut_ad(cursor->rec == (pos > 1 ? page_rec_get_nth( |