[MDEV-22054] Very bad performance MariaDB vs MySQL Created: 2020-03-26 Updated: 2023-09-19 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Query Cache |
| Affects Version/s: | 10.4.12 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Pascal ROBINET | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Alpine Linux 3.11 |
||
| Description |
|
Hello,
while with MySQL 5.7.29 I get :
Afterward the cache is primed and things gets ugly for MariaBD when I repeat the same query :
The EXPLAIN shows both software have a very different way of running this very same query : MariaDB
MySQL
I experimented a bit with some optimizations but to not avail. MariaDB optimizer is not up to par with MySQL but it's mostly the cache that is way better in MySQL. |
| Comments |
| Comment by Elena Stepanova [ 2020-04-05 ] |
|
Did you paste the right queries? You are reporting x6 drop, but according to your output, it's 11.3 sec vs 8 sec, and the contents / size of the table is different, too (the query for MariaDB returns higher count). |
| Comment by Pascal ROBINET [ 2020-04-06 ] |
|
Hi and thanks for the answer, |
| Comment by Pascal ROBINET [ 2020-04-15 ] |
|
Hi, I see you labeled as "Need Feedback", why so ? There is no other precision. Thanks |
| Comment by Axel Schwenke [ 2020-06-23 ] |
|
sorry, I didn't see your mention of an upload. |
| Comment by Pascal ROBINET [ 2022-04-12 ] |
|
Hi, any progress on this issue ? |
| Comment by Daniel Black [ 2022-11-25 ] |
|
axel DDL_tables_perf_query_mariadb-MDEV22054.txt is still on the ftp server. |
| Comment by Pascal ROBINET [ 2022-11-25 ] |
|
It would be great to see this issue solved so we can at last switch our workload to MariaDB. |
| Comment by Pascal ROBINET [ 2023-08-14 ] |
|
Hi, any update on this bug please ? I updated the description to be more precise, taking into account @elenst comment |
| Comment by Sergei Golubchik [ 2023-09-05 ] |
|
There are few things you could try to understand what's happening better. You can exclude the optimizer differences by forcing the same query plan in MariaDB and in MySQL. STRAIGHT JOIN and FORCE INDEX can make the optimizer to use a specific join order or a specific index. Then, innodb_flush_method. It affects whether InnoDB will be using filesystem cache or not. The size of the innodb buffer pool matters too, that's one of the few most important variables to tune. |
| Comment by Pascal ROBINET [ 2023-09-14 ] |
|
Hi Sergei and thanks for your answer but I'm not sure to understand your comment, do you need more input from my side to pinpoint the root cause ? If so could you be a bit more precise about your needs please ? Do you need me to run some tests with different values ? If so which values please ? |
| Comment by VAROQUI Stephane [ 2023-09-14 ] |
|
Having probably a stupid question , Can't you just remove the user table from the query ? |
| Comment by VAROQUI Stephane [ 2023-09-14 ] |
|
Please try to ANALYSE TABLE users, products_views PERSISTENT FOR ALL and see if explain change |
| Comment by Pascal ROBINET [ 2023-09-19 ] |
|
Of course we can't remove the table @stephane@skysql.com, we don't just randomly dump tables into a query And anyway the issue is about a bad performance of MariaDB optimizer compared to MySQL, which needs to be fixed to avoid people dropping MariaDB in favor of MySQL. The analysis and timing I provided comes mainly from ANALYSE TABLE results. |