Browse Source

Optimized away excessive condition

trx_set_rw_mode() is never called for read-only transactions, this is guarded
by callers.

Removing this condition from critical section immediately gives 5% scalability
improvement in OLTP index updates benchmark.
bb-10.3-spider
Sergey Vojtovich 8 years ago
parent
commit
e01d788428
  1. 7
      storage/innobase/trx/trx0trx.cc

7
storage/innobase/trx/trx0trx.cc

@ -3039,6 +3039,7 @@ trx_set_rw_mode(
ut_ad(trx->rsegs.m_redo.rseg == 0);
ut_ad(!trx->in_rw_trx_list);
ut_ad(!trx_is_autocommit_non_locking(trx));
ut_ad(!trx->read_only);
if (high_level_read_only) {
return;
@ -3075,11 +3076,9 @@ trx_set_rw_mode(
}
#endif /* UNIV_DEBUG */
if (!trx->read_only) {
UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
ut_d(trx->in_rw_trx_list = true);
}
ut_d(trx->in_rw_trx_list = true);
mutex_exit(&trx_sys->mutex);
}

Loading…
Cancel
Save