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

Temporary Tables using Aria with very poor performance

Details

    • 10.1.30, 5.5.59, 10.0.34

    Description

      Hello,

      I have tested this with MariaDB 10.0 and 10.1, and the result is the same.

      Creating a temporary table using Aria is a lot slower than using MyISAM.
      I'll gives here some examples.

      Creating a Temporary Table of ~800Mb using MyISAM
      MariaDB [admin_fnf_beta]> CREATE TEMPORARY TABLE table9 engine=MyISAM AS (SELECT * FROM ibf_forums_posts);
      Query OK, 1576320 rows affected (11.51 sec)
      Records: 1576320 Duplicates: 0 Warnings: 0

      Creating a Temporary Table of ~800Mb using Aria with default pagecache buffer
      MariaDB [admin_fnf_beta]> CREATE TEMPORARY TABLE table10 engine=Aria AS (SELECT * FROM ibf_forums_posts);
      Query OK, 1576320 rows affected (19.71 sec)
      Records: 1576320 Duplicates: 0 Warnings: 0

      Creating a Temporary Table of ~800Mb using Aria with 1GB pagecache buffer
      MariaDB [admin_fnf_beta]> CREATE TEMPORARY TABLE table10 engine=Aria AS (SELECT * FROM ibf_forums_posts);
      Query OK, 1576320 rows affected (16.53 sec)
      Records: 1576320 Duplicates: 0 Warnings: 0

      As you can see, Aria is faster using the pagecache buffer for the temporary table, but its still slower than MyISAM using the disk.

      This also happens with small temporary tables.
      Example:

      Creating a Temporary Table of ~7Mb using MyISAM
      MariaDB [admin_fnf_beta]> CREATE TEMPORARY TABLE table2 engine=MyISAM AS (SELECT * FROM ibf_forums_topics);
      Query OK, 57492 rows affected (0.44 sec)
      Records: 57492 Duplicates: 0 Warnings: 0

      Creating a Temporary Table of ~7Mb using Aria with default pagecache buffer
      MariaDB [admin_fnf_beta]> CREATE TEMPORARY TABLE table3 engine=Aria AS (SELECT * FROM ibf_forums_topics);
      Query OK, 57492 rows affected (0.62 sec)
      Records: 57492 Duplicates: 0 Warnings: 0

      This issue becomes more important because we can't change the default internal temporary table storage engine. Its defaulted to Aria and we can only change it if we recompile MariaDB.

      Attachments

        Issue Links

          Activity

            "The fix should be pushed to 10.2 or 10.3 soon."

            What about 10.1 ?

            pamamolf Dimitris Chatzis added a comment - "The fix should be pushed to 10.2 or 10.3 soon." What about 10.1 ?

            10.1.31 is out but don't have that fix

            Any info if the fix will be on the next version or if it will take too long to add it?

            pamamolf Dimitris Chatzis added a comment - 10.1.31 is out but don't have that fix Any info if the fix will be on the next version or if it will take too long to add it?

            The fix already exists, adding it to any version takes minutes.

            But it's a rather extensive change, so the question we're considering now is whether it's sufficiently safe to add it to 10.1-GA or not. The testing so far didn't show any problems, so it might go into 10.1 after all.

            serg Sergei Golubchik added a comment - The fix already exists, adding it to any version takes minutes. But it's a rather extensive change, so the question we're considering now is whether it's sufficiently safe to add it to 10.1-GA or not. The testing so far didn't show any problems, so it might go into 10.1 after all.

            Thanks for your reply !

            "The fix already exists"

            You mean that it is already included at 10.2.x and 10.3.x and not yet at 10.1.x ?

            As i didn't see that info at the changelog related to that....

            Also if you decide to add it at 10.1.x as it was not cause any issues is a month enough so you can add it on the next version of 10.1.x ?

            pamamolf Dimitris Chatzis added a comment - Thanks for your reply ! "The fix already exists" You mean that it is already included at 10.2.x and 10.3.x and not yet at 10.1.x ? As i didn't see that info at the changelog related to that.... Also if you decide to add it at 10.1.x as it was not cause any issues is a month enough so you can add it on the next version of 10.1.x ?

            Fixed performance problem with Aria by speeding up find_head().

            The result of this patch is a up to 2x or more speed up for inserts without keys for
            format PAGE.

            monty Michael Widenius added a comment - Fixed performance problem with Aria by speeding up find_head(). The result of this patch is a up to 2x or more speed up for inserts without keys for format PAGE.

            People

              monty Michael Widenius
              Venâncio Ferreira Venâncio Ferreira
              Votes:
              2 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.