mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Applied the patch from mysql-5.6 code line that fixed
a significant performance drop for high concurrency bechmarks (bug #11765850 - 58854). Here's the comment of the patch commit: 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.
This commit is contained in:
parent
51e4bf7356
commit
94c316069e
1 changed files with 16 additions and 13 deletions
|
@ -3259,16 +3259,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)) {
|
||||
|
@ -3300,12 +3299,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;
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
@ -4669,6 +4663,11 @@ 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, offsets)) {
|
||||
|
@ -4680,8 +4679,12 @@ 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)) {
|
||||
goto next_rec;
|
||||
}
|
||||
|
||||
row_sel_push_cache_row_for_mysql(buf, prebuilt);
|
||||
|
||||
if (prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE) {
|
||||
goto next_rec;
|
||||
}
|
||||
} else {
|
||||
if (UNIV_UNLIKELY
|
||||
|
|
Loading…
Reference in a new issue