-1

enter image description here

sql like this,it only need 0.33s, but when i change "LEFT JOIN" to "JOIN",like this enter image description here

it need 10s more,is anyone can explain why? I have index on im_callback_msg_body ,the column is "call_id" the "EXPAIN" command show execute plan like that "LEFT JOIN" enter image description here "JOIN" enter image description here

  • possible duplicate - [Difference between INNER and OUTER joins](http://stackoverflow.com/questions/38549/difference-between-inner-and-outer-joins) – Ren Mark Almojera Cerdan Jun 03 '16 at 07:59
  • I know the differentce between "JOIN" and "left JOIN",what I don't konw is when i use "join",it get 1596 record cost 10.7s, when use "left join",it get 3681 record only cost 0.33s – Zhao Zhenfei Jun 03 '16 at 08:17

1 Answers1

0

Change SELECT 1 to SELECT COUNT(*) and you might discover a useful clue.

Both will speed up with:

up needs INDEX(mobile)
e needs INDEX(msg_from)

Then we can discuss performance.

What other info does it say in the Extra column?

Rick James
  • 135,179
  • 13
  • 127
  • 222