mirror of https://github.com/sipwise/db-schema.git
parent
f0cd47f156
commit
2cc0d141f6
@ -0,0 +1,10 @@
|
||||
use sipstats;
|
||||
|
||||
alter ignore table messages remove partitioning;
|
||||
alter table messages partition by range (id) (partition pmax values less than maxvalue);
|
||||
|
||||
alter ignore table message_packets remove partitioning;
|
||||
alter table message_packets partition by range (message) (partition pmax values less than maxvalue);
|
||||
|
||||
alter ignore table packets remove partitioning;
|
||||
alter table packets partition by range (id) (partition pmax values less than maxvalue);
|
@ -0,0 +1,21 @@
|
||||
use sipstats;
|
||||
|
||||
alter ignore table messages remove partitioning;
|
||||
set @mx = (select (coalesce(max(id), 0)) + 700000 from messages);
|
||||
set @stm = concat('alter table messages partition by range (id) (partition p', @mx, ' values less than (', @mx, '))');
|
||||
prepare st from @stm;
|
||||
execute st;
|
||||
deallocate prepare st;
|
||||
|
||||
alter ignore table message_packets remove partitioning;
|
||||
set @stm = concat('alter table message_packets partition by range (message) (partition p', @mx, ' values less than (', @mx, '))');
|
||||
prepare st from @stm;
|
||||
execute st;
|
||||
deallocate prepare st;
|
||||
|
||||
alter ignore table packets remove partitioning;
|
||||
set @mx = (select (coalesce(max(id), 0)) + 700000 from packets);
|
||||
set @stm = concat('alter table packets partition by range (id) (partition p', @mx, ' values less than (', @mx, '))');
|
||||
prepare st from @stm;
|
||||
execute st;
|
||||
deallocate prepare st;
|
Loading…
Reference in new issue