List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:March 2 2011 11:13pm
Subject:bzr push into mysql-trunk-innodb branch (Sunny.Bains:3527 to 3528)
Bug#11765850
View as plain text  
 3528 Sunny Bains	2011-03-03
      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
 3527 Vasil Dimov	2011-03-02 [merge]
      Merge mysql-5.5-innodb -> mysql-trunk-innodb (empty)

=== modified file 'storage/innobase/row/row0sel.c'
--- a/storage/innobase/row/row0sel.c	revid:vasil.dimov@stripped
+++ b/storage/innobase/row/row0sel.c	revid:sunny.bains@stripped
@@ -3286,16 +3286,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)) {
@@ -3327,12 +3326,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;
 }
 
 /*********************************************************************//**
@@ -4666,12 +4660,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
@@ -4680,7 +4680,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/sunny.bains@oracle.com-20110302230909-ec1hurrlyvxf8j17.bundle
Thread
bzr push into mysql-trunk-innodb branch (Sunny.Bains:3527 to 3528)Bug#11765850Sunny Bains3 Mar