Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- recreate log_mpe table
- create table log_mpe_2 like log_mpe;
- -- determine new auto_increment value for new table
- select max(id) + 5000
- from log_mpe;
- alter table log_mpe_2
- auto_increment ##max_id##;
- -- rename table, subsequent inserts will go to new log_mpe table
- -- and use the next higher id
- rename table log_mpe to log_mpe_old, log_mpe_2 to log_mpe;
- -- insert 1 hours worth or records from original log_mpe table
- insert into log_mpe
- select *
- from log_mpe_old lo
- where creation_timestamp > date_sub(now(), interval 1 hour);
Advertisement
Add Comment
Please, Sign In to add comment