Bug #71068 Suggestion to add an undo object cache in trx_rseg_t object for memory tuning
Submitted: 4 Dec 2013 0:47 Modified: 17 Dec 2013 18:35
Reporter: Fangxin Flou (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:All Version OS:Any
Assigned to: CPU Architecture:Any
Tags: Memory, performance

[4 Dec 2013 0:47] Fangxin Flou
Description:
For update and delete statement, it need create undo struct in transaction's rollback segment, and release after execution, since undo struct is a fixed length memory area, so we can cacche (such as 8 undo memory objects) in rseg object to avoid the memory allocation and deallocation for each DML execution. Which coulde improve the update/delete statement TPS littley.

How to repeat:
N/A

Suggested fix:
Please chedk the attachement file.

diff -rc --exclude='*.orig' --exclude=sql_yacc.cc --exclude=sql_yacc.h percona-5.6.14/storage/innobase/include/trx0rseg.h percona-5.6.14-patched/storage/innobase/include/trx0rseg.h
*** percona-5.6.14/storage/innobase/include/trx0rseg.h  2013-10-22 15:42:41.000000000 +0800
--- percona-5.6.14-patched/storage/innobase/include/trx0rseg.h  2013-11-29 10:43:10.000000000 +0800
***************
*** 189,194 ****
--- 189,196 ----
                                        yet purged log */
        ibool           last_del_marks; /*!< TRUE if the last not yet purged log
                                        needs purging */
+       ulint           undo_cache_count;
+       trx_undo_t*     undo_cache_array[8];
  };

  /** For prioritising the rollback segments for purge. */
[12 Dec 2013 21:37] Sveta Smirnova
Thank you for the reasonable feature request.

In order to us to accept your patch you need to sign OCA as described in "Contributions" tab of this bug report.
[13 Dec 2013 14:51] MySQL Verification Team
Hi Mr. Fangxin,

It came to our attention that a major part of this code will be refactored and rewritten, which would also lead to cacheing of trx_rseg_t arrays. Scheduling of this job has yet to be decided upon.

It is however still wise that you sign the OCA agreement in case that your contribution will be used.

Thank you for your effort.
[17 Dec 2013 18:35] MySQL Verification Team
Back to "Verified" due to some internal, administrative decisions.