MySQL Forums
Forum List  »  Partitioning

Re: Help in Paritioning the Table
Posted by: Rick James
Date: May 08, 2012 09:29AM

> But in both case i am getting the errors
The error message, itself, would be useful.

But, more importantly, what do you hope to gain by PARTITIONing? PARTITIONing, by itself, rarely provides any performance gain.

If LectureID is the PK, then there is no reason to have a compound key starting with LectureID:
(LectureId, ClassroomId, Date, ActualStartTime, ActualEndTime)
Move LectureID to the end, and make it non-UNIQUE. Or perhaps starting with Date makes the most sense; it depends on your queries.

What are the SELECTs you will be doing against these tables? From that, we can discuss the 'right' indexes, and whether PARTITIONing makes sense.

Partitioning on the PRIMARY KEY is rarely useful.

> Date DATETIME
> ActualStartTime Time
> ActualEndTime Time
Suggest using the DATE datatype for Date.
Usually I argue against splitting dates and times, but this might be an exception.

See
http://mysql.rjweb.org/doc.php/ricksrots
especially the sections on PARTITIONs and INDEXes.

Options: ReplyQuote


Subject
Views
Written By
Posted
2407
May 07, 2012 05:02AM
Re: Help in Paritioning the Table
1695
May 08, 2012 09:29AM


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.