MySQL Forums
Forum List  »  Partitioning

Re: Partitioning not working need primary key?
Posted by: Rick James
Date: October 27, 2012 12:01PM

DOUBLE is SMALLER (good), but DECIMAL is precise (more imporant), so go with DECIMAL.

A PRIMARY KEY is a "UNIQUE KEY". So the "partition key" must be added (preferably at the end) of the PK (if it is not already in the PK [as is your case]). It's a rule; live with it.

A lot more rules, tips, etc:
http://mysql.rjweb.org/doc.php/ricksrots

A Summary Table would need to be updated as new information goes into the main table. There are many ways to do this. An immediate UPDATE is probably the most costly. I prefer a periodic "INSERT INTO summary SELECT ... FROM main GROUP BY...". This is very efficient; but it may or may not work in a given case. By "periodic", I mean every hour, every minute, and/or on demand -- again this varies with the use case.

Sorry, I don't have a document on Summary Tables -- it is a difficult one to write because of all the variations.

I have read 27 of your questions on this set of forums, and have responded to most of them. This thread is a significant escalation of your requirements; perhaps should hire an experienced DBA.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partitioning not working need primary key?
1875
October 27, 2012 12:01PM


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.