innodb 乐观插入因空间不够导致失败,进入悲观插入阶段,这个空间的限制大小

来源:互联网 发布:微软office软件 编辑:程序博客网 时间:2024/05/19 20:56

btr_cur_optimistic_insert{

...

/*检查分裂页时是否有足够的空间预留给未来记录的update*/

if (leaf && !zip_size && dict_index_is_clust(index)

             && page_get_n_recs(page) >= 2

             && dict_index_get_space_reserve()+ rec_size > max_size

             &&(btr_page_get_split_rec_to_right(cursor, &dummy)

                   ||btr_page_get_split_rec_to_left(cursor, &dummy))) {

                   gotofail;

         }

...

}


dict_index_get_space_reserve()+ rec_size > max_size

dict_index_get_space_reserve()=1024,即当1024+记录大小rec_size大于当前page空闲空间max_size时,乐观插入失败,进入悲观插入阶段,发生B+分裂

0 0
原创粉丝点击