MariaDB launches LEFT JOIN query 100 times slower than Mysql

I work on two terminals only on command lines (phpmyadmin is not used here):
-MariaDB 10.1.9 (on the first computer running Windows 10)
-Mysql 5.1.73 (on the second computer running Windows 10)

I run this special command:

SELECT price, volume
    FROM dates d
    LEFT JOIN (
      SELECT fr.price,fr.volume,f.code_pays,fr.flux,fr.id_date, cf.code,fr.niv
      FROM fr_logical_data_2 fr
      INNER JOIN fr_pays f ON fr.id_code_pays = f.id
      INNER JOIN fr_nc8 n ON fr.id_code_nc8 = n.id
      INNER JOIN commodities_fr cf ON n.code_nc8 = cf.nc8
      WHERE cf.code = 'code_007' AND fr.flux= 1 AND f.code_pays = 'PT' AND fr.niv = 0
    ) AS Q
    ON Q.id_date = d.id

Mysql requires: 0.1 s; MariaDB requires: 4 min and 5 sec.

Exact result (49 lines), the result of the query below

Note. Two computers usually have the same response time

2: LEFT JOIN INNER JOIN ( , , ). , , MariaDB LEFT RIGHT JOINs.

- ?

3: EXPLAIN SELECT... EXPLAIN SELECT...

+4

All Articles