Re: two column int index not used correctly
Hi Ming,
In the first query, the range is known at query optimization time (you specified it as constants) and MySQL figures out that range access is the best way to read this range.
In the second query, the range is not known at query optimization time. Moreover, the range will be different for each row in table_main. MySQL cannot use range access for such queries.
Hope this helps,
Jørgen Løland
Software Engineer, MySQL, Oracle
jorgenloland.blogspot.com
Subject
Views
Written By
Posted
3869
May 27, 2011 10:06AM
1694
June 06, 2011 03:15AM
1431
June 15, 2011 06:18AM
Re: two column int index not used correctly
1090
June 15, 2011 07:14AM
1085
June 15, 2011 08:07PM
1256
June 15, 2011 11:30PM
1001
June 16, 2011 06:23AM
1628
June 17, 2011 01:20AM
1085
June 17, 2011 01:34AM
1029
June 20, 2011 12:20AM
1083
June 20, 2011 11:49PM
1101
June 22, 2011 12:05AM
1130
June 16, 2011 08:58AM
1354
June 17, 2011 01: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.