[MDEV-24992] MariaDB on CentOS 7 much slower than MySQL Created: 2021-02-26  Updated: 2021-03-28

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.4.18
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Stan Stan Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: performance
Environment:

CentOS 7 (CentOS Linux release 7.9.2009 (Core))


Attachments: Zip Archive test.zip    

 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.


Generated at Thu Feb 08 09:34:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.