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

Condition pushdown from HAVING into WHERE is not shown in optimizer trace

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT, b VARCHAR(1), KEY (a), KEY(b,a)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (4,'n'),(1,'h'),(NULL,'w');
       
      SELECT b, a FROM t1 WHERE b <> 'p' OR a = 4 GROUP BY b, a HAVING a <= 7;
      

      Condition pushdown from HAVING into WHERE puts "t1.a <=7" into the WHERE:

        $6 = 0x555557aff480 <dbug_item_print_buf> "(t1.b <> 'p' or multiple equal(4, t1.a)) and t1.a <= 7"
      

      But this is not visible in the optimizer trace.

      Observed on 10.5 but probably affects other versions as well.

      Attachments

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              oleg.smirnov Oleg Smirnov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.