From 3f2d4e20eba63eafe078d6b7a7d0f904ecb7e0e8 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 20 Jul 2012 18:23:17 +0000 Subject: [PATCH] changed sipstats partitioning scheme --- db_scripts/diff/9702_not_replicated.down | 14 ++++++++++++++ db_scripts/diff/9702_not_replicated.up | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 db_scripts/diff/9702_not_replicated.down create mode 100644 db_scripts/diff/9702_not_replicated.up diff --git a/db_scripts/diff/9702_not_replicated.down b/db_scripts/diff/9702_not_replicated.down new file mode 100644 index 00000000..7100f442 --- /dev/null +++ b/db_scripts/diff/9702_not_replicated.down @@ -0,0 +1,14 @@ +use sipstats; + +alter table packets remove partitioning; +alter table packets drop primary key, drop key uniq, + add primary key (id, timestamp), add unique key (timestamp, src_mac, dst_mac, header(80)); +alter table packets partition by range (floor(timestamp)) (partition pmax values less than maxvalue); + +alter table messages remove partitioning; +alter table messages drop primary key, drop key timestamp, add primary key (id, timestamp); +alter table messages partition by range (floor(timestamp)) (partition pmax values less than maxvalue); + + + + diff --git a/db_scripts/diff/9702_not_replicated.up b/db_scripts/diff/9702_not_replicated.up new file mode 100644 index 00000000..cd18d519 --- /dev/null +++ b/db_scripts/diff/9702_not_replicated.up @@ -0,0 +1,10 @@ +use sipstats; + +alter table packets remove partitioning; +alter table packets drop primary key, drop key timestamp, + add primary key (id), add key uniq (timestamp, src_mac, dst_mac, header(80)); +alter table packets partition by range (id) (partition pmax values less than maxvalue); + +alter table messages remove partitioning; +alter table messages drop primary key, add primary key (id), add key (timestamp); +alter table messages partition by range (id) (partition pmax values less than maxvalue);