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

MariaDB on CentOS 7 much slower than MySQL

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.18
    • 10.4(EOL)
    • Optimizer
    • CentOS 7 (CentOS Linux release 7.9.2009 (Core))

    Description

      The query below is much slower on MariaDB than on MySQL. Tested on two independent CentOS 7 machines and 3 MariaDB versions 10.4.18, 10.4.17and 10.4.14.:

      SELECT *
      FROM `catalog_product_entity` AS `e`
      LEFT JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`)
              AND (`at_name_default`.`attribute_id` = '65')
              AND `at_name_default`.`store_id` = 0
      LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`)
              AND (`at_name`.`attribute_id` = '65')
              AND (`at_name`.`store_id` = 1)
      WHERE (at_name.value IS NOT NULL OR at_name_default.value IS NOT NULL);
      

      MariaDB CentOS 7:
      Empty set (18.916 sec)

      MySQL:
      Empty set (0.02 sec)

      Also tested on MariaDB 10.2.32 on openSUSE Leap 15.1:
      Empty set (0.03 sec)

      Interestingly, when I add e.entity_id < 4564 condition, there is a breakpoint before the query takes 0 seconds and after 4 seconds, depending on the number. But this number depends on system. On my system, the value was 4564 where the query already took 4 seconds, but it took 0 seconds with 4563.

      Database dump is attached.

      Attachments

        Activity

          stann435 Stan Stan created issue -
          stann435 Stan Stan made changes -
          Field Original Value New Value
          Description The query below is much slower on MariaDB than on MySQL. Tested on two independent CentOS 7 machines and 3 MariaDB versions 10.4.18, 10.4.17and 10.4.14.:

          {{SELECT *
          FROM `catalog_product_entity` AS `e`
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name_default`.`attribute_id` = '65')
                  AND `at_name_default`.`store_id` = 0
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name`.`attribute_id` = '65')
                  AND (`at_name`.`store_id` = 1)
          WHERE (at_name.value IS NOT NULL OR at_name_default.value IS NOT NULL);}}

          MariaDB CentOS 7:
          {{Empty set (18.916 sec)}}

          MySQL:
          {{Empty set (0.02 sec)}}

          Also tested on MariaDB 10.2.32 on openSUSE Leap 15.1:
          {{Empty set (0.03 sec)}}

          Interestingly, when I add e.entity_id < 4564 condition, there is a breakpoint before the query takes 0 seconds and after 4 seconds, depending on the number. But this number depends on system. On my system, the value was 4564, where the query already took 4 seconds, but with it took 0 seconds with 4563.

          Database dump is attached.
          The query below is much slower on MariaDB than on MySQL. Tested on two independent CentOS 7 machines and 3 MariaDB versions 10.4.18, 10.4.17and 10.4.14.:

          {{SELECT *
          FROM `catalog_product_entity` AS `e`
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name_default`.`attribute_id` = '65')
                  AND `at_name_default`.`store_id` = 0
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name`.`attribute_id` = '65')
                  AND (`at_name`.`store_id` = 1)
          WHERE (at_name.value IS NOT NULL OR at_name_default.value IS NOT NULL);}}

          MariaDB CentOS 7:
          {{Empty set (18.916 sec)}}

          MySQL:
          {{Empty set (0.02 sec)}}

          Also tested on MariaDB 10.2.32 on openSUSE Leap 15.1:
          {{Empty set (0.03 sec)}}

          Interestingly, when I add e.entity_id < 4564 condition, there is a breakpoint before the query takes 0 seconds and after 4 seconds, depending on the number. But this number depends on system. On my system, the value was 4564 where the query already took 4 seconds, but it took 0 seconds with 4563.

          Database dump is attached.
          stann435 Stan Stan made changes -
          Description The query below is much slower on MariaDB than on MySQL. Tested on two independent CentOS 7 machines and 3 MariaDB versions 10.4.18, 10.4.17and 10.4.14.:

          {{SELECT *
          FROM `catalog_product_entity` AS `e`
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name_default`.`attribute_id` = '65')
                  AND `at_name_default`.`store_id` = 0
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name`.`attribute_id` = '65')
                  AND (`at_name`.`store_id` = 1)
          WHERE (at_name.value IS NOT NULL OR at_name_default.value IS NOT NULL);}}

          MariaDB CentOS 7:
          {{Empty set (18.916 sec)}}

          MySQL:
          {{Empty set (0.02 sec)}}

          Also tested on MariaDB 10.2.32 on openSUSE Leap 15.1:
          {{Empty set (0.03 sec)}}

          Interestingly, when I add e.entity_id < 4564 condition, there is a breakpoint before the query takes 0 seconds and after 4 seconds, depending on the number. But this number depends on system. On my system, the value was 4564 where the query already took 4 seconds, but it took 0 seconds with 4563.

          Database dump is attached.
          The query below is much slower on MariaDB than on MySQL. Tested on two independent CentOS 7 machines and 3 MariaDB versions 10.4.18, 10.4.17and 10.4.14.:

          {code:sql}
          SELECT *
          FROM `catalog_product_entity` AS `e`
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name_default` ON (`at_name_default`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name_default`.`attribute_id` = '65')
                  AND `at_name_default`.`store_id` = 0
          LEFT JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`)
                  AND (`at_name`.`attribute_id` = '65')
                  AND (`at_name`.`store_id` = 1)
          WHERE (at_name.value IS NOT NULL OR at_name_default.value IS NOT NULL);
          {code}

          MariaDB CentOS 7:
          {{Empty set (18.916 sec)}}

          MySQL:
          {{Empty set (0.02 sec)}}

          Also tested on MariaDB 10.2.32 on openSUSE Leap 15.1:
          {{Empty set (0.03 sec)}}

          Interestingly, when I add e.entity_id < 4564 condition, there is a breakpoint before the query takes 0 seconds and after 4 seconds, depending on the number. But this number depends on system. On my system, the value was 4564 where the query already took 4 seconds, but it took 0 seconds with 4563.

          Database dump is attached.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.4 [ 22408 ]
          Assignee Sergei Petrunia [ psergey ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 119546 ] MariaDB v4 [ 142628 ]

          People

            psergei Sergei Petrunia
            stann435 Stan Stan
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.