Commit a1b23361 authored by Sergey Vojtovich's avatar Sergey Vojtovich Committed by Marko Mäkelä

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.
parent f867a695
......@@ -2957,6 +2957,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;
......@@ -2993,11 +2994,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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment