From 20f579ea162afd751576e9ed6ab8c8a49eb833f1 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 19:25:59 +0200 Subject: Bug#17565888: UP TO 75% INCREASE IN DBT3 QUERY (Q7) EXECUTION TIME Regression from bug#14621190 due to disabled optimistic restoration of cursor, which required full key lookup instead of verifying if previously positioned btree cursor could be reused. Fixed by enable optimistic restore and adjust cursor afterward. rb#3324 approved by Marko. --- storage/innobase/include/btr0pcur.ic | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'storage/innobase/include/btr0pcur.ic') diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 696dfc728dc..5eb8ed0f32d 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -309,7 +309,8 @@ btr_pcur_move_to_next_user_rec( function may release the page latch */ mtr_t* mtr) /*!< in: mtr */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; loop: @@ -379,7 +380,7 @@ btr_pcur_commit_specify_mtr( btr_pcur_t* pcur, /*!< in: persistent cursor */ mtr_t* mtr) /*!< in: mtr to commit */ { - ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); pcur->latch_mode = BTR_NO_LATCHES; -- cgit v1.2.1 From e6a734a7cf1fd678fbc22a9d920efac0bc601123 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 23:39:15 +0200 Subject: post-push fix for bug17565888. Too restrictive assertion, can fail during purge --- storage/innobase/include/btr0pcur.ic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage/innobase/include/btr0pcur.ic') diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 5eb8ed0f32d..f5880e0564a 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -164,7 +164,8 @@ btr_pcur_is_after_last_on_page( /*===========================*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); -- cgit v1.2.1 From a91fcaf460f686b1fb7eb005fa22ab136ff7210d Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 23:49:35 +0200 Subject: post-push fix for bug17565888. Too restrictive assertion, failing during purge --- storage/innobase/include/btr0pcur.ic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage/innobase/include/btr0pcur.ic') diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index f5880e0564a..db3145132af 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -91,7 +91,8 @@ btr_pcur_get_block( /*===============*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); return(btr_cur_get_block(btr_pcur_get_btr_cur(cursor))); } -- cgit v1.2.1 From 7a524cee32e3a7d457fa6a0e86351ddac1c219fb Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Sat, 19 Oct 2013 15:29:51 +0200 Subject: post-push fix for bug17565888. --- storage/innobase/include/btr0pcur.ic | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'storage/innobase/include/btr0pcur.ic') diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index db3145132af..647e8d0cde9 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -91,8 +91,7 @@ btr_pcur_get_block( /*===============*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); return(btr_cur_get_block(btr_pcur_get_btr_cur(cursor))); } @@ -165,8 +164,7 @@ btr_pcur_is_after_last_on_page( /*===========================*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); @@ -311,8 +309,7 @@ btr_pcur_move_to_next_user_rec( function may release the page latch */ mtr_t* mtr) /*!< in: mtr */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; loop: -- cgit v1.2.1