Re: Optimize Inner Join With WHERE BETWEEN dates
Since TimeClass is not used on the first of a or b, please add these indexes:
INDEX(`UserID`,`ClockIn`),
INDEX(`UserID`,`ClockOut`),
One of them will be used for `a`.
Then the existing (`UserID`,`TimeClass`,`ClockIn`,...) may be used for `b`
How many different values of TimeClass are there?
Please provide the EXPLAIN after you add the above indexes; I want to see if I missed anything else.
Subject
Views
Written By
Posted
4263
May 21, 2013 07:32PM
1753
May 22, 2013 06:41PM
1712
May 24, 2013 12:40PM
1566
May 25, 2013 11:43AM
1643
May 30, 2013 05:30PM
Re: Optimize Inner Join With WHERE BETWEEN dates
1546
June 02, 2013 01:15PM
1704
June 03, 2013 05:02PM
2908
June 04, 2013 11:49PM
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.