Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.13, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log to MariaDB version 10.3.13, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB:
SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; |
We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs.
Any ideas why?
Dump of the database: http://www.rasca.net/tmp/dump.tar.gz
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
Attachment | create.sql [ 47956 ] |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_arnes_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_arnes_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
Attachment | create.sql [ 47956 ] |
Attachment | create.sql [ 47957 ] |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql: {code:sql} SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; {code} and hangs in MariaDB. Also explain-s are different where on MariaDB is: {code:java} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ | 1 | SIMPLE | p | ALL | PRIMARY | NULL | NULL | NULL | 291000 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where; Using join buffer (flat, BNL join) | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+------------------+--------+-------------------------------------------------+ {code} while in Mysql is: {code:sql} MySQL [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a RIGHT JOIN user_AUD u ON u.REV=a.id RIGHT JOIN profile_AUD p ON p.id=u.profile_id RIGHT JOIN person_AUD o ON o.id=p.person_id WHERE a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 591451 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +----+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} ---- However if we change that RIGHT JOIN statement to: {code:sql} MariaDB [aris]> explain SELECT u.username, u.created, o.name, o.surname, a.modifiedBy, a.timestamp FROM aris_revision a, user_AUD u, profile_AUD p, person_AUD o WHERE u.REV=a.id AND p.id=u.profile_id AND o.id=p.person_id AND a.timestamp < 1555324525347 AND a.timestamp > 1544873725347 AND u.REVTYPE=2; +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ | 1 | SIMPLE | u | ALL | NULL | NULL | NULL | NULL | 538480 | Using where | | 1 | SIMPLE | p | ref | PRIMARY | PRIMARY | 4 | aris.u.profile_id | 1 | Using where | | 1 | SIMPLE | o | ref | PRIMARY | PRIMARY | 4 | aris.p.person_id | 1 | | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 4 | aris.u.REV | 1 | Using where | +------+-------------+-------+--------+---------------+---------+---------+-------------------+--------+-------------+ {code} it works like it should. We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? I have included dump of a database. |
Attachment | create.sql [ 47957 ] |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? I have included dump of a database. |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? Dump of the database: http://www.rasca.net/tmp/dump.tar.gz |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? Dump of the database: http://www.rasca.net/tmp/dump.tar.gz |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log to MariaDB, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? Dump of the database: http://www.rasca.net/tmp/dump.tar.gz |
Description |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log to MariaDB, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? Dump of the database: http://www.rasca.net/tmp/dump.tar.gz |
We are migrating (dump, restore) data from Mysql version 5.5.61-38.13-log to MariaDB version 10.3.13, however we found a problem when RIGHT JOIN statement hangs, but inner join does not.
This one works in Mysql but not in MariaDB: {code:sql} SELECT t1.modifiedBy, t1.timestamp FROM table1 t1 RIGHT JOIN table2 t2 ON t2.REV=t1.id RIGHT JOIN table3 t3 ON t3.id=t2.profile_id RIGHT JOIN table4 t4 ON t4.id=t3.person_id WHERE t1.timestamp < 1555324525347 AND t1.timestamp > 1544873725347 AND t2.REVTYPE=2; {code} We found out that INNER JOIN, LEFT JOIN works, but RIGHT JOIN hangs. Any ideas why? Dump of the database: http://www.rasca.net/tmp/dump.tar.gz |
Assignee | Alice Sherepa [ alice ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Affects Version/s | 5.5 [ 15800 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 10.1 [ 16100 ] | |
Affects Version/s | 10.2 [ 14601 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] |
Fix Version/s | 10.1 [ 16100 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Assignee | Alice Sherepa [ alice ] | Igor Babaev [ igor ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Assignee | Igor Babaev [ igor ] | Sergei Petrunia [ psergey ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Petrunia [ psergey ] | Igor Babaev [ igor ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.1.41 [ 23406 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 95399 ] | MariaDB v4 [ 156077 ] |
However we found out, if we create indexes like:
... then query does not "hang".