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

dict_stats_fetch_from_ps() unnecessarily acquires exclusive dict_sys.latch

    XMLWordPrintable

Details

    Description

      The function dict_stats_fetch_from_ps() first looks up the InnoDB persistent statistics tables in a suboptimal way, acquiring and releasing a shared dict_sys.latch multiple times, and then proceeds to acquire an exclusive dict_sys.latch for the duration of the call to que_eval_sql().

      I think that this needs to be optimized as follows:

      • Try to acquire a shared dict_sys.latch only once in the case that both statistics tables are cached in dict_sys and that a metadata lock (MDL) can be acquired without waiting.
      • If one of the statistics tables is not cached or if we have to wait for a MDL, we may fall back to something like the existing logic.
      • For the que_eval_sql() call, pass table handles with pars_info_bind_id(). In this way, there should be no need to hold any dict_sys.latch during the execution of the SQL.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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