Re: query not using index
First off (not a big deal) you only would ever need 2 of the 3 indicies that you created.
"billsec", "calldate" and "billsec,calldate". Anything that uses "billsec" could instead use "billsec,calldate". So you really would only ever need "calldate" and "billsec,calldate" in this example.
Again I do not think this is a huge deal, just something you may want to keep in mind.
2nd, have you tried a smaller date range? Possably 1 day range and see if that uses the index?
MySQL will sometime do a full table scan when it thinks it is faster than using the index. So for example if you where clause is selecting more than 30% of the rows it may just do a full table scan instead of reading the index and then using those pointers to read the table... If you have any questions about this let me know. I will try to answer the best I can. I am still somewhat new to this also.
Jonathan
Subject
Written By
Posted
Re: query not using index
January 14, 2005 01:05PM
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.