Re: inner join vs left join - huge performance difference
There are a few extra keys that I didn't describe, but here are the EXPLAIN results:
INNER JOIN:
+----+-------------+-------+------------+-------+-----------------+-------+---------+------------+------+----------+------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+-------+-----------------+-------+---------+------------+------+----------+------------------------------------+
| 1 | SIMPLE | table | NULL | range | date,type,LocID | LocID | 6 | NULL | 515 | 9.57 | Using index condition; Using where |
| 1 | SIMPLE | table | NULL | ref | date,type,LocID | LocID | 6 | const,func | 19 | 9.57 | Using index condition; Using where |
+----+-------------+-------+------------+-------+-----------------+-------+---------+------------+------+----------+------------------------------------+
LEFT JOIN:
+----+-------------+-------+------------+-------+-----------------+-------+---------+-------+------+----------+------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+-------+-----------------+-------+---------+-------+------+----------+------------------------------------+
| 1 | SIMPLE | table | NULL | range | date,type,LocID | LocID | 6 | NULL | 527 | 9.57 | Using index condition;Using where |
| 1 | SIMPLE | table | NULL | ref | date,type,LocID | type | 1 | const | 10 | 100.00 | Using where |
+----+-------------+-------+------------+-------+-----------------+-------+---------+-------+------+----------+------------------------------------+
Subject
Views
Written By
Posted
12577
July 06, 2016 09:32AM
3102
July 06, 2016 12:00PM
2099
July 06, 2016 12:18PM
1712
July 06, 2016 12:29PM
1499
July 06, 2016 12:36PM
Re: inner join vs left join - huge performance difference
1557
July 06, 2016 12:44PM
1548
July 06, 2016 01:51PM
1553
July 06, 2016 02:32PM
1268
July 06, 2016 02:41PM
1380
July 08, 2016 11:58PM
1527
July 09, 2016 09:54AM
1691
September 27, 2016 07:13AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.