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

table elimination an a chain of left joins

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 5.5.28, 5.3.10
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In the following test case:

      drop table if exists t1, t2, t3;
      create table t1 (id int, key (id));
      insert t1 values (1),(2);
      create table t2 (t1_id int primary key, id int, key (id));
      insert t2 values (1,1),(2,2);
      create table t3 (t2_id int primary key);
      insert t3 values (1),(2);
      set sql_quote_show_create=0;
      explain extended select t1.id from t1 left join
          t2 on t1.id = t2.t1_id left join t3 on t2.id = t3.t2_id;
      

      the optimizer is supposed to eliminate both t2 and t3 from the query plan, but it only removes t3.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            Don't see a demand for resolving this (Does anybody use table elimination to the extent that they are affected?) Feel free to re-open if it affects you.

            Show
            psergey Sergei Petrunia added a comment - Don't see a demand for resolving this (Does anybody use table elimination to the extent that they are affected?) Feel free to re-open if it affects you.

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                serg Sergei Golubchik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: