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

Slowdown when running nested statement with many partitions

    XMLWordPrintable

Details

    Description

      (Filing based on investigation of a support case)

      When a statement uses a partitioned table, there is O(#partitions_in_table) overhead even if the statement actually touches O(1) partitions.

      We always had this overhead (there is MDEV-20250 to get rid of it), but in 10.6 it got larger.

      In order to observe the overhead increase one needs:

      • A table with a lot (thousands) or partitions.
      • A statement that touches one or a few rows in one/few partitions. The statement must be sufficiently lightweight so the extra overhead is visible.
      • The above statement must be invoked many times by the embedding statement. This way, the overhead adds up and can be observed.

      The total slowdown observed was around 40%.

      Causes

      • One known reason is handler_stats_disable() and related calls which were added
        by MDEV-31558. It has unnecessary loops that go through all partitions.

      Overhead that already existed in 10.5:

      • Calls to extra(HA_EXTRA_.._CHILDREN). These are no-ops if one is not using MERGE engine.
      • Calls to extra(HA_EXTRA_*_KEYREAD). These only make sense for the partitions that are touched by the query

      Attachments

        Issue Links

          Activity

            People

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