Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-1969

LP #1128066: Suboptimal userstat code

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Alexey Kopytov last update 26-05-2013 10:51:26

      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?

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist