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

Log Queries without Indexes - Ignore those where just the "wrapping" SELECT doesn't use index

    XMLWordPrintable

    Details

      Description

      Consider queries like these:

      (SELECT ...) UNION ALL (SELECT ...) UNION ALL (SELECT ...) ORDER BY ... DESC

      SELECT * FROM (SELECT ...) AS `t` ORDER BY ... ASC

      And something more complex, like a mix of the above:

      All these queries are logged when I have not_using_index in log_slow_filter.

      I believe these queries are optimized as they can be, and I can't really make those "wrapping SELECTs" use indexes. (except, I believe, if I put the results in temporary tables with indexes, which seems overkill to me)

      Having these appearing in the Slow Log creates a lot of noise that doesn't let me focus on other queries that really need to be fixed.

      –

      I wonder if it would make sense to add an extra filter so that these "false positives" are not included, what do you think?

      Something like "not_using_index_notderived" or "not_using_index_realtables" (just random suggestions)

      Thank you very much.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nunop Nuno
            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.