Innodb optimistic insertion fails due to insufficient space and enters the pessimistic insertion stage. The size of this space is limited in innodb stage.
Btr_cur_optimistic_insert {
...
/* Check whether there is sufficient space for future record update during split page */
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, that is, when the rec_size of the 1024 + record is greater than the max_size of the current page's free space, optimistic insertion fails, enters the pessimistic insertion stage, and B + split occurs.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.