Percona Server with XtraDB

Suboptimal code in row_search_for_mysql()

Reported by Alexey Kopytov on 2013-02-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Medium
Alexey Kopytov
5.1
Undecided
Unassigned
5.5
Medium
Alexey Kopytov

Bug Description

The fix for bug #791030 introduced a suboptimal code in row_search_for_mysql():

 should_release = 0;
 for (i = 0; i < btr_search_index_num; i++) {
  /* we should check all latches (fix Bug#791030) */
  if (rw_lock_get_writer(btr_search_latch_part[i])
      != RW_LOCK_NOT_LOCKED) {
   should_release |= ((ulint)1 << i);
  }
 }

(and a few other similar loops all in the same function).

According to profiling, this causes a rather high amount of branch mispredictions and resource stalls.

Related branches

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers