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

New-style hint: [NO_]SPLIT_MATERIALIZED

    XMLWordPrintable

Details

    • Q2/2025 Development, Q3/2025 Maintenance

    Description

      Add a new-style hint to control Split Materialized (aka "Lateral Derived") optimization.

      The PR is here: https://github.com/MariaDB/server/pull/4019 .

      Hint effect

      • NO_SPLIT_MATERIALIZED(X) disables use of Split-Materialized optimization in the context of X (I will elaborate below on what is X).
      • SPLIT_MATERIALIZED(X) forces use of Split-Materialized in the context of X unless it is otherwise impossible to do (e.g. because a table is not a materialized derived table, etc).

      The hint should be attached to the derived table being split.

      It seems a logical and natural location. Consider an example:

      SELECT
        /*+ SPLIT_MATERIALIZED(CUST_TOTALS) */
        ...
      FROM
        customer
        (SELECT SUM(amount), o_custkey FROM orders GROUP BY o_custkey) as CUST_TOTALS
      WHERE
         customer.c_custkey= o_custkey AND
         customer.country='FI';
      

      CUST_TOTALS on its own "does not know" whether Split-materialized would be useful for it.
      example: if you need totals for all customers, then probably it won't.
      We learn that Split-Materialized is good to use for CUST_TOTALS when we look at the parent query. And realize that we will only require totals for customers from Finland.

      SPLIT_MATERIALIZED should force use of splitting

      Splitting should be used even when the optimizer would consider it to be not worth it.

      Attachments

        Issue Links

          Activity

            People

              lstartseva Lena Startseva
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.