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

I_S optimization: fast status variable lookup

    XMLWordPrintable

Details

    Description

      INFORMATION_SCHEMA.GLOBAL_VARIABLES, INFORMATION_SCHEMA.SESSION_STATUS and other tables for global/session/system status/variables are often queried for just one variables:

      select variable_value from information_schema.global_status where variable_value='uptime'
      

      Currently it's a linear search in the array with all variables. Recursive, because some elements of the array may be pointers to sub-arrays or to functions generating sub-arrays.

      This can be changed to

      1. a hash with all variables that aren't dynamically generated by a function call
      2. an array with all prefixes that need a function call to generate full variable names.

      almost all variables will be in the hash, the array will be very small, less than 10 elements, may be even empty (depends on what plugins are loaded).

      Thus the new approach can be: if the variable name is fully specified in the query, no wildcards, then do a hash lookup, and if nothing is found check the array of prefixes.

      Attachments

        Issue Links

          Activity

            People

              TheLinuxJedi Andrew Hutchings
              serg Sergei Golubchik
              Votes:
              0 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.