List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:March 9 2011 7:16pm
Subject:bzr commit into mysql-trunk branch (alexander.nozdrin:3730) Bug#11765850
View as plain text  
#At file:///home/alik/MySQL/bzr/mysql-5.6.2-m5-release/ based on revid:alexander.nozdrin@stripped

 3730 Alexander Nozdrin	2011-03-09
      Cherry-picking merge from mysql-trunk-innodb.
      Original revision:
      ######################################################
      revno: 3528
      revision-id: sunny.bains@stripped
      parent: vasil.dimov@stripped
      committer: Sunny Bains <Sunny.Bains@stripped>
      branch nick: trunk
      timestamp: Thu 2011-03-03 10:09:09 +1100
      message:
        Bug# 11765850 - 58854: HIGH CONCURRENCY SYSTEM TEST SHOWS SIGNIFICANT PERFORMANCE DROP
        
        The bug is that the InnoDB pre-fetch cache was not being used in
        row_search_for_mysql().  Secondly the changeset that planted the
        bug also introduced some inefficient code. It would read an extra
        row, convert it to MySQL row format (for ICP==off), copy the row
        to the pre-fetch cache row buffer, then check for cache overflow
        and dequeue the row that was pushed if there was a possibility of
        a cache overflow.
        
        No rb entry, approved via email by Marko.
      ######################################################

    modified:
      storage/innobase/row/row0sel.c
=== modified file 'storage/innobase/row/row0sel.c'
--- a/storage/innobase/row/row0sel.c	2011-02-07 11:23:17 +0000
+++ b/storage/innobase/row/row0sel.c	2011-03-09 19:16:29 +0000
@@ -3276,16 +3276,15 @@ row_sel_pop_cached_row_for_mysql(
 }
 
 /********************************************************************//**
-Pushes a row for MySQL to the fetch cache.
-@return TRUE on success, FALSE if the record contains incomplete BLOBs */
-UNIV_INLINE __attribute__((warn_unused_result))
-ibool
+Pushes a row for MySQL to the fetch cache. */
+UNIV_INLINE
+void
 row_sel_push_cache_row_for_mysql(
 /*=============================*/
 	byte*		mysql_rec,	/*!< in/out: MySQL record */
 	row_prebuilt_t*	prebuilt)	/*!< in/out: prebuilt struct */
 {
-	ut_ad(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
+	ut_a(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
 	ut_a(!prebuilt->templ_contains_blob);
 
 	if (UNIV_UNLIKELY(prebuilt->fetch_cache[0] == NULL)) {
@@ -3317,12 +3316,7 @@ row_sel_push_cache_row_for_mysql(
 	memcpy(prebuilt->fetch_cache[prebuilt->n_fetch_cached],
 	       mysql_rec, prebuilt->mysql_row_len);
 
-	if (++prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE) {
-		return(FALSE);
-	}
-
-	row_sel_pop_cached_row_for_mysql(mysql_rec, prebuilt);
-	return(TRUE);
+	++prebuilt->n_fetch_cached;
 }
 
 /*********************************************************************//**
@@ -4650,12 +4644,18 @@ requires_clust_rec:
 		not cache rows because there the cursor is a scrollable
 		cursor. */
 
+		ut_a(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
+
+		/* We only convert from InnoDB row format to MySQL row
+		format when ICP is disabled. */
+
 		if (!prebuilt->idx_cond
 		    && !row_sel_store_mysql_rec(
 			    buf, prebuilt, result_rec,
 			    result_rec != rec,
 			    result_rec != rec ? clust_index : index,
 			    offsets)) {
+
 			/* Only fresh inserts may contain incomplete
 			externally stored columns. Pretend that such
 			records do not exist. Such records may only be
@@ -4664,7 +4664,11 @@ requires_clust_rec:
 			transaction. Rollback happens at a lower
 			level, not here. */
 			goto next_rec;
-		} else if (row_sel_push_cache_row_for_mysql(buf, prebuilt)) {
+		}
+
+		row_sel_push_cache_row_for_mysql(buf, prebuilt);
+
+		if (prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE) {
 			goto next_rec;
 		}
 	} else {


Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20110309191629-6hufbu46jqhnus8k.bundle
Thread
bzr commit into mysql-trunk branch (alexander.nozdrin:3730) Bug#11765850Alexander Nozdrin9 Mar