MySQL Forums
Forum List  »  Partitioning

Re: Partitioning not working need primary key?
Posted by: newbie Shai
Date: November 03, 2012 10:37AM

Dear Rick,
This is interesting to me.

If you have an index (or the PK) with (outletID,receiptID,dateTime) and you say
WHERE outletID = 123 AND dateTime >=...
It will use that index starting with outletID

If you have an index (or the PK) with (outletID,receiptID,dateTime) and you say
WHERE receiptID = 987 AND dateTime >=...
It will ignore that index, and would use your proposed INDEX(dateTime) if it existed.


I dont quite understand why the second query will not be using the composite index whereas the first will as the second one too have part of the composite index rite?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partitioning not working need primary key?
1450
November 03, 2012 10:37AM


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.