Percona Server with XtraDB

Suboptimal userstat code

Reported by Alexey Kopytov on 2013-02-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
Low
Alexey Kopytov
5.6
Low
Alexey Kopytov

Bug Description

In close_thread_table() the following handler methods are called unconditionally:

  if(table->file)
  {
    table->file->update_global_table_stats();
    table->file->update_global_index_stats();
  }

What update_global_table_stats() does what userstats are disabled is it just zeroes rows_read and rows_changed and returns. update_global_index_stats() traverses the index_rows_read array and zeroes all elements.

Problems:

- 2 functions calls even if userstats are disabled.
- we probably don't need to zero all those data structures if userstats are disabled, as they are initialized to zero in handler::ha_open()
- even if we do have to zero them on close, why not memset() for the array, as the code for handler::ha_open() does?

tags: added: userstat
tags: added: userstats
removed: userstat
tags: added: low-hanging-fruit
tags: added: userstat
removed: userstats
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers