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

EXPLAIN SELECT ... ORDER BY doesn't show "using MRR" even if it uses it

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.3.12, 5.5.36, 10.0.11
    • None
    • None
    • None

    Description

      The following testcase produces incorrect EXPLAIN output ("Using MRR" is missing). This is probably a long-known problem of wrong output of EXPLAIN .. ORDER BY. I am filing it, because 1) we now have SHOW EXPLAIN (and so, potential to fix it) and 2) it is also fixed in mysql-5.6

      create table ten (a int);
      insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
      create table one_k (a int);
      insert into one_k select A.a + 10*B.a + 100*C.a from ten A, ten B, ten C;
       
      create table t1 (a int, b int, c int, filler blob);
      insert into t1 select a,a,a, 'filler-data' from test.one_k;
      alter table t1 add key(a,b);
      explain select * from t1 force index(a) where a < 10000 order by b limit 10;
      select * from t1 force index(a) where a < 10000 order by b limit 10;
      set optimizer_switch='mrr_cost_based=off';

      Attachments

        Activity

          People

            Unassigned Unassigned
            psergei Sergei Petrunia
            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.