Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- log_mpe
- -- recreate log_mpe table
- create table log_mpe_2 like log_mpe;
- -- determine new auto_increment value for new table
- select max(id)
- from log_mpe;
- alter table log_mpe_2
- auto_increment ##max_id + 500##;
- -- 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 id < (
- select min(lo.id)
- from log_mpe l1
- )
- and creation_timestamp < date_sub(now(), interval 1 hour);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement