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

EXISTS to IN is not reflected in the optimizer trace

    XMLWordPrintable

    Details

      Description

      --- a/mysql-test/main/subselect_exists2in_costmat.test
      +++ b/mysql-test/main/subselect_exists2in_costmat.test
      @@ -65,19 +65,24 @@ set @@optimizer_switch = 'exists_to_in=on,in_to_exists=on,semijoin=on,materializ
       -- echo Q1.1m:
       -- echo MATERIALIZATION: there are too many rows in the outer query
       -- echo to be looked up in the inner table.
      -EXPLAIN
      +EXPLAIN EXTENDED
       SELECT Name FROM Country
       WHERE (EXISTS (select 1 from City where City.Population > 100000 and
       Code = Country) OR
              Name LIKE 'L%') AND
             surfacearea > 1000000;
       
      +
      +set optimizer_trace=1;
      +
       SELECT Name FROM Country
       WHERE (EXISTS (select 1 from City where City.Population > 100000 and
       Code = Country) OR
              Name LIKE 'L%') AND
             surfacearea > 1000000;
       
      +select * from information_schema.optimizer_trace;
      +
       drop database world;
       
       set optimizer_switch=@subselect_mat_cost;
      

        Attachments

          Activity

            People

            Assignee:
            varun Varun Gupta
            Reporter:
            sanja Oleksandr Byelkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: