Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34443

ha_innobase::info_low() does not distinguish HA_STATUS_VARIABLE_EXTRA

    XMLWordPrintable

Details

    Description

      wlad posted some flame graphs that show that ha_innobase::info_low() is spending time on waiting for a shared latch. It seems to me that the following is the culprit:

      			space->s_lock();
      			stats.delete_length = 1024
      				* fsp_get_available_space_in_free_extents(
      					*space);
      			space->s_unlock();
      

      This is being executed on every call for HA_STATUS_VARIABLE, even though apparently only callers with HA_STATUS_VARIABLE_EXTRA are interested in the result. This would mainly be SHOW TABLES and get_schema_tables_record().

      In the flame graph, the unnecessary latch acquisition occurs in mysql_update():

        /* Update the table->file->stats.records number */
        table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
        set_statistics_for_table(thd, table);
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.