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

Push conditions into materialized IN subqueries

Details

    • 10.0.34, 10.1.31, 10.2.13, 10.1.32, 10.3.6-1

    Description

      The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
      If such a subquery is an IN subquery

       (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
      

      and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:

      expr[1]=col[1] AND ...
      

      Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

      This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see MDEV-9197).

      EDIT
      optimizer_switch flag name is condition_pushdown_for_subquery

      Attachments

        Issue Links

          Activity

            igor Igor Babaev (Inactive) created issue -
            igor Igor Babaev (Inactive) made changes -
            Field Original Value New Value
            Description The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.
            The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see mdev-9197).
            igor Igor Babaev (Inactive) made changes -
            Description The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see mdev-9197).
            The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see mdev-9197).
            cvicentiu Vicențiu Ciorbaru made changes -
            Summary Push conditions into materialized subquiries Push conditions into materialized subqueries
            serg Sergei Golubchik made changes -
            Description The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see mdev-9197).
            The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see MDEV-9197).
            serg Sergei Golubchik made changes -
            Component/s Admin statements [ 11400 ]
            igor Igor Babaev (Inactive) made changes -
            Assignee Igor Babaev [ igor ] Galina Shalygina [ shagalla ]
            igor Igor Babaev (Inactive) made changes -
            Labels gsoc17
            shagalla Galina Shalygina (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3 [ 22126 ]
            serg Sergei Golubchik made changes -
            Sprint 10.0.34 [ 224 ]
            serg Sergei Golubchik made changes -
            Sprint 10.0.34 [ 224 ] 10.0.34, 10.1.31 [ 224, 225 ]
            serg Sergei Golubchik made changes -
            Sprint 10.0.34, 10.1.31 [ 224, 225 ] 10.0.34, 10.1.31, 10.2.13 [ 224, 225, 228 ]
            shagalla Galina Shalygina (Inactive) made changes -
            Assignee Galina Shalygina [ shagalla ] Igor Babaev [ igor ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            shagalla Galina Shalygina (Inactive) made changes -
            Assignee Igor Babaev [ igor ] Galina Shalygina [ shagalla ]
            shagalla Galina Shalygina (Inactive) made changes -
            Sprint 10.0.34, 10.1.31, 10.2.13 [ 224, 225, 228 ] 10.0.34, 10.1.31, 10.2.13, 10.1.32 [ 224, 225, 228, 235 ]
            shagalla Galina Shalygina (Inactive) made changes -
            Sprint 10.0.34, 10.1.31, 10.2.13, 10.1.32 [ 224, 225, 228, 235 ] 10.0.34, 10.1.31, 10.2.13, 10.1.32, 10.3.6 [ 224, 225, 228, 235, 237 ]
            shagalla Galina Shalygina (Inactive) made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.3 [ 22126 ]
            shagalla Galina Shalygina (Inactive) made changes -
            Fix Version/s 10.4.0 [ 23115 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            shagalla Galina Shalygina (Inactive) made changes -
            psergei Sergei Petrunia made changes -
            Summary Push conditions into materialized subqueries Push conditions into materialized IN subqueries
            psergei Sergei Petrunia made changes -
            Description The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see MDEV-9197).
            The subqueries with GROUP BY are always materialized in MariaDB/MySQL.
            If such a subquery is an IN subquery
            {noformat}
             (expr[1],...) IN (SELECT col[1], ...FROM ... GROUP BY...)
            {noformat}
            and is a conjunct of the WHERE condition of the main query then for every row in the result set the following is true:
            {noformat}
            expr[1]=col[1] AND ...
            {noformat}
            Let P be a comparison predicate over expr[i]. Then the condition P(expr[i]/col[i]) can be pushed into the subquery.

            This task basically has to repeat what was done for pushing conditions into materialized views/derived tables (see MDEV-9197).

            *EDIT*
            {{optimizer_switch}} flag name is {{condition_pushdown_for_subquery}}
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 80160 ] MariaDB v4 [ 133195 ]

            People

              shagalla Galina Shalygina (Inactive)
              igor Igor Babaev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.