branches/innodb+: Clean up the buffering of purges. Instead of
traversing the index B-tree twice (first in BTR_WATCH_LEAF mode and then in BTR_DELETE mode), let BTR_DELETE take care of checking that the record can be purged, and either buffering or performing the purge. row_purge_poss_sec(): New function, to check if it is possible to purge a secondary index record. Refactored from row_purge_remove_sec_if_poss_low(). row_purge_remove_sec_if_poss_nonbuffered(): Rename to row_purge_remove_sec_if_poss_tree(). Remove the parameter mode (always use BTR_MODIFY_TREE). Use row_purge_poss_sec(). row_purge_remove_sec_if_poss_low(): Rename to row_purge_remove_sec_if_poss_leaf(). Remove the parameter mode (always use BTR_MODIFY_LEAF). Let row_search_index_entry() do all the hard work. btr_cur_t: Add purge_node, which will be needed by btr_cur_search_to_nth_level() for BTR_DELETE. Replace the flag value BTR_CUR_ABORTED with BTR_CUR_DELETE_REF and BTR_CUR_DELETE_FAILED. enum row_search_result, row_search_index_entry(): Replace ROW_NOT_IN_POOL with ROW_NOT_DELETED_REF and ROW_NOT_DELETED. btr_cur_search_to_nth_level(): Remove BTR_WATCH_LEAF. As a side effect, the adaptive hash index can be used in purge as well. If BTR_DELETE cannot be buffered, attempt btr_cur_optimistic_delete(). Either way, check row_purge_poss_sec(). Move the code to set cursor->ibuf_count to get rid of another if (height == 0) check. Eliminate the label loop_end. Do not call ibuf_should_try() twice. ibuf_should_try(): Now that the successful calls to this function will be halved, halve the magic constant that ibuf_flush_count will be compared to, accordingly. The changes regarding ibuf_should_try() were merged from branches/zip r3515. rb://60 approved by Heikki over IM
Showing
Please register or sign in to comment