Unnecessary calls to innobase_get_trx() if slow log is enabled, but InnoDB stats are not

Bug #1124028 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
Status tracked in 5.7
5.1
Won't Fix
Medium
Unassigned
5.5
Triaged
Medium
Unassigned
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

We have the following code in buf_page_get_zip(), buf_page_get_gen(), buf_page_opimistic_get() and buf_page_get_known_nowait():

 if (innobase_get_slow_log()) {
  trx = innobase_get_trx();
 }

The problem is that innobase_get_trx() is expensive due to current_thd and if the slow log is enabled, but InnoDB stats are not, it will still be called for no reasons, as trx->take_stats will be FALSE and no stats will actually be collected.

tags: added: slow-extended
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

If I may piggyback on this bug report, as the issue is too minor for its own bug report and can be fixed at the same time. The innobase_get_trx() prototype should be removed from buf0buf.c. Instead, it should be declared in ha_prototypes.h.

tags: added: xtradb
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-1315

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.