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

LP:884631 - Table elimination works 5.3 release builds even if turned off

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Table elimination works in 5.3 release builds, even if one sets @@optimizer_switch to turn it off.

      create table t1 (a int);
      insert into t1 values (0),(1),(2),(3);
      create table t2 (a int primary key, b int)
      as select a, a as b from t1 where a in (1,2);

      set optimizer_switch='table_elimination=on';
      explain extended select t1.a from t1 left join t2 on t2.a=t1.a;
      id select_type table type possible_keys key key_len ref rows filtered Extra
      1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00
      Warnings:
      Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1

      set optimizer_switch='table_elimination=off';
      explain extended select t1.a from t1 left join t2 on t2.a=t1.a;
      id select_type table type possible_keys key key_len ref rows filtered Extra
      1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00
      Warnings:
      Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1

      Attachments

        Activity

          People

            Unassigned Unassigned
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.