Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // user_actions
- auto_id = auto increment ID
- type = a number (1 = photo upload, 2 = friend added, 3 = status post, 4 = so other action, etc..)
- user_id = The id of the user who did the action
- datetime = date and time
- action_id = this could be the ID of the action, so if it is for a status post, it could be the ID of the actual status post record
- CREATE TABLE user_actions (
- auto_id INT NOT NULL AUTO_INCREMENT,
- type INT NOT NULL,
- user_id INT NOT NULL,
- insert_datetime DATE NOT NULL,
- action_id INT NOT NULL)
- PARTITION BY RANGE(TO_DAYS(insert_datetime))
- (
- PARTITION p0 VALUES LESS THAN (to_days('2011-06-01')),
- PARTITION p1 VALUES LESS THAN (to_days('2012-01-01')) ,
- PARTITION p11 VALUES LESS THAN MAXVALUE
- );
- -- Untested, but again should be close
- ALTER TABLE t1 REORGANIZE PARTITION (pM) INTO
- (PARTITION p20110101 VALUES LESS THAN (to_days('2011-07-01'),
- PARTITION pM VALUES LESS THAN MAXVALUE);
Advertisement
Add Comment
Please, Sign In to add comment