MySQL Forums
Forum List  »  InnoDB

Re: why must i specify an index in query?
Posted by: Peter Brawley
Date: July 02, 2015 01:58PM

The query looks needlessly baroque. Why left join, which requires the query engine to read all rows from the table on the left side of the join? If there's a match, Join will optimise much better. And why the convoluted On clause when you could write something simple like this?

select * 
from usersmobile u
join (
  select id
  from userhits
  order by id desc limit 1
) t on u.id=t.userid2;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: why must i specify an index in query?
995
July 02, 2015 01:58PM


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.