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

Improve optimization of joins with many tables, including eq_ref tables

Details

    Description

      This is a followup to MDEV-28073.

      Problem description

      Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

      An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

      The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

      Solution

      TODO description. Copy from:
      https://jira.mariadb.org/browse/MDEV-28073?focusedCommentId=225701&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225701

      Join prefix pruning is now controlled by @@optimizer_prune_level variable. The new pruning is done when @@optimizer_prune_level=2, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting @@optimizer_prune_level=1 (the default before 10.10).

      The tree

      It is preview-10.10-MDEV-28852-join-pruning

      Attachments

        Issue Links

          Activity

            psergei Sergei Petrunia created issue -
            psergei Sergei Petrunia made changes -
            Field Original Value New Value
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            Join optimizer can be very slow when there are a lot of similar plans to enumerate.
            This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning doesn't manage to prune plans.
            An important subset is a join where a lot of tables use eq_ref
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning doesn't manage to prune plans.
            An important subset is a join where a lot of tables use eq_ref
            This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning doesn't manage to prune plans.

            An important subset is a join where a lot of tables use eq_ref access . If these tables are next to each Putting these tables in different order
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning doesn't manage to prune plans.

            An important subset is a join where a lot of tables use eq_ref access . If these tables are next to each Putting these tables in different order
            This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.
            This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.
            TODO: note that pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is enabled by default, {{@@optimizer_prune_level=2}}. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}}
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.
            TODO: note that pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is enabled by default, {{@@optimizer_prune_level=2}}. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}}
            This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.

            Join prefix pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is done when {{@@optimizer_prune_level=2}}, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}} (the default before 10.10).
            elenst Elena Stepanova made changes -
            Assignee Michael Widenius [ monty ] Elena Stepanova [ elenst ]
            elenst Elena Stepanova made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            elenst Elena Stepanova made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.

            Join prefix pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is done when {{@@optimizer_prune_level=2}}, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}} (the default before 10.10).
            This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.

            Join prefix pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is done when {{@@optimizer_prune_level=2}}, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}} (the default before 10.10).

            h2. The tree
            It is {{preview-10.10-MDEV-28852-join-pruning}}
            psergei Sergei Petrunia made changes -
            Description This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description.

            Join prefix pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is done when {{@@optimizer_prune_level=2}}, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}} (the default before 10.10).

            h2. The tree
            It is {{preview-10.10-MDEV-28852-join-pruning}}
            This is a followup to MDEV-28073.

            h2. Problem description
            Join optimizer can be very slow when the join has many tables and join prefix pruning feature doesn't manage to prune join prefixes.

            An important special case is when a subset of join tables are joined with an equi-join condition on a primary key, and so can be joined using eq_ref in any order. Then, query plans that use different permutations of these tables have the same cost. The optimizer will consider all possible permutations. This can take a lot of CPU but provide little benefit.

            The fix for MDEV-28073 addresses these issues to some extent and was pushed into 10.6. This MDEV is about more comprehensive fix.

            h2. Solution
            TODO description. Copy from:
            https://jira.mariadb.org/browse/MDEV-28073?focusedCommentId=225701&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225701

            Join prefix pruning is now controlled by {{@@optimizer_prune_level}} variable. The new pruning is done when {{@@optimizer_prune_level=2}}, which is the new default. One can disable certain aspects (TODO elaborate) of the new behavior by setting {{@@optimizer_prune_level=1}} (the default before 10.10).

            h2. The tree
            It is {{preview-10.10-MDEV-28852-join-pruning}}
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            psergei Sergei Petrunia made changes -
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            elenst Elena Stepanova made changes -
            Assignee Sergei Golubchik [ serg ] Sergei Petrunia [ psergey ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels optimizer-feature Preview_10.10 optimizer-feature
            psergei Sergei Petrunia made changes -
            Fix Version/s 10.10.1 [ 27913 ]
            Fix Version/s 10.10 [ 27530 ]
            psergei Sergei Petrunia made changes -
            Fix Version/s 11.0.1 [ 28548 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 143812 136995

            People

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