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

Description

**Reported in Launchpad by Alexey Kopytov last update 24-03-2016 11:15:07

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.

Environment

None

Activity

Laurynas Biveinis 
December 17, 2018 at 1:51 PM

lpjirasync 
January 21, 2018 at 1:32 PM

**Comment from Launchpad by: Laurynas Biveinis on: 03-05-2013 11:58:43

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.

Duplicate

Details

Assignee

Reporter

Priority

Created January 21, 2018 at 1:32 PM
Updated December 17, 2018 at 1:51 PM
Resolved December 17, 2018 at 1:51 PM