MySQL Forums
Forum List  »  Performance

Re: index not being pick up
Posted by: Peter Brawley
Date: January 17, 2018 12:41PM

Given tables a, b with matchable indexed id columns, Explain will tell you that the query engine will not use an index on table a in the query ...

select a.* from a join b using(id);

... because it sees that the query requires the engine to read all the data in table a, so an index on it won't help performance.

But it will use an index for ...

select b.* from a join b using(id);

... because now the index offers an advantage.

Options: Reply• Quote


Subject
Views
Written By
Posted
2439
r r
January 15, 2018 11:57PM
1281
January 16, 2018 12:19AM
852
January 16, 2018 04:39PM
871
January 16, 2018 07:49PM
1072
January 17, 2018 12:26AM
1285
January 17, 2018 01:07AM
1053
January 17, 2018 01:19AM
Re: index not being pick up
917
January 17, 2018 12:41PM
1037
January 19, 2018 07:26AM
1109
January 21, 2018 04:31PM
855
January 21, 2018 05:41PM
875
January 22, 2018 03:00AM


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.