innodb乐观插入因空间不够导致失败,进入悲观插入阶 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    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+分裂

最新文章