MySQL Forums
Forum List  »  Backup

Re: Backup and trimming data idea
Posted by: Rick James
Date: July 08, 2012 09:33AM

(All partitions are missing a paren; p405 has an additional syntax error.)

> So as the days grows I must keep adding more partitioning right?
Yes. Some hints...

I would add two partitions:
PARTITION start VALUES LESS THAN (0) -- for obscure reasons

PARTITION future VALUES LESS THAN MAXVALUE
1. Without it, if the next day script fails to run, there will be a place to put the data.
2. The script should REORGANIZE PARTITION future INTO pxxx..., future...
This will automatically fix the 'bug' mentioned in #1, if it ever happens.

I would make the script smart enough to decide whether it is time to run, then either do the ALTERs, or not. This way, if you accidentally run it twice, no harm is done. Example of harm: blindly DROPping the oldest PARTITION.

Other issues:

> course int(3)
Perhaps you meant SMALLINT UNSIGNED -- this would shrink the field from 4 bytes (INT) to 2 bytes (SMALLINT). Ditto for other over-sized fields.

> PRIMARY KEY (`mainDataID`),
"Every UNIQUE key must include the partition key", so
PRIMARY KEY (`mainDataID`, gpsDateTime),

I don't see the other INDEXes that I recommended.

Options: ReplyQuote


Subject
Views
Written By
Posted
3533
June 22, 2012 07:34PM
1696
June 23, 2012 05:23PM
1753
June 23, 2012 05:36PM
1776
June 24, 2012 01:51PM
1813
June 25, 2012 10:16AM
1658
June 26, 2012 08:14AM
1758
June 26, 2012 08:46AM
1642
June 27, 2012 08:36AM
1738
June 27, 2012 09:03AM
1603
June 28, 2012 11:19PM
1553
June 29, 2012 07:12AM
1561
June 30, 2012 11:50AM
1635
July 02, 2012 09:47AM
1577
July 03, 2012 01:32PM
1621
July 05, 2012 11:13AM
1795
July 06, 2012 09:57AM
1584
July 07, 2012 10:50AM
Re: Backup and trimming data idea
1604
July 08, 2012 09:33AM
1595
July 16, 2012 08:08PM
1580
July 21, 2012 10:57PM


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.