Suboptimal code in row_search_for_mysql()

Bug #1130655 reported by Alexey Kopytov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Alexey Kopytov
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Released
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

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1318

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.