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

log_slow_filter = not_using_index set automatically log_queries_not_using_indexes = 1 and overwrites long_query_time filter

    XMLWordPrintable

Details

    Description

      In

      https://mariadb.com/kb/en/server-system-variables/#log_slow_filter

      is documented

      " If a query matches one of the types listed in the filter, and takes longer than long_query_time, it will be logged"
      

      So long_query_time is a mandatory condition for log_slow_filter.

      So log_slow_filter and log_slow_filter must be fulfilled.

      But this is not the case for option
      "not_using_index".

      If you add "not_using_index" to log_slow_filter
      it logs into slow_log, even if the execution time is less than "log_slow_filter" long_query_time.

      The root cause is, that adding
      "not_using_index"
      to "log_slow_filter"
      set implicit log_queries_not_using_indexes = 1.

      to reproduce:

      set SESSION  log_queries_not_using_indexes = 0;
      SHOW VARIABLES LIKE 'log_q%';
      set SESSION log_slow_filter  = "admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,not_using_index,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk ";
      SHOW VARIABLES LIKE 'log_q%';
      

      For "log_queries_not_using_indexes", it is documented,
      that query time is not important.

      Queries that don't use an index, or that perform a full index scan where the index doesn't limit the number of rows, will be logged to the slow query log (regardless of time taken).
      

      But "not_using_index," as a "log_slow_filter" option should respect "long_query_time".

      Attachments

        Issue Links

          Activity

            People

              greenman Ian Gilfillan
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.