mirror of https://github.com/sipwise/db-schema.git
* remove primary key and create (id,start_time) index
for the following accounting tables:
- cdr
- cdr_cash_balance_data
- cdr_time_balance_data
- cdr_relation_data
- cdr_tag_data
Change-Id: I399e9504496bdfd4600466d8fb67abccb3a0c40f
changes/93/14793/1
parent
0aa6c5abd5
commit
667df2f6c8
@ -0,0 +1,11 @@
|
||||
use accounting;
|
||||
|
||||
ALTER TABLE cdr drop index id_stime_idx, add primary key (id);
|
||||
ALTER TABLE cdr_cash_balance_data drop index cdr_id_idx,
|
||||
add primary key (cdr_id, provider_id, direction_id, cash_balance_id, cdr_start_time);
|
||||
ALTER TABLE cdr_time_balance_data drop index cdr_id_idx,
|
||||
add primary key (cdr_id, provider_id, direction_id, time_balance_id, cdr_start_time);
|
||||
ALTER TABLE cdr_relation_data drop index cdr_id_idx,
|
||||
add primary key (cdr_id, provider_id, direction_id, relation_id, cdr_start_time);
|
||||
ALTER TABLE cdr_tag_data drop index cdr_id_idx,
|
||||
add primary key (cdr_id, provider_id, direction_id, tag_id, cdr_start_time);
|
||||
@ -0,0 +1,11 @@
|
||||
use accounting;
|
||||
|
||||
ALTER TABLE cdr drop primary key, add index id_stime_idx (id, start_time);
|
||||
ALTER TABLE cdr_cash_balance_data drop primary key,
|
||||
add index cdr_id_idx (cdr_id, provider_id, direction_id, cash_balance_id, cdr_start_time);
|
||||
ALTER TABLE cdr_time_balance_data drop primary key,
|
||||
add index cdr_id_idx (cdr_id, provider_id, direction_id, time_balance_id, cdr_start_time);
|
||||
ALTER TABLE cdr_relation_data drop primary key,
|
||||
add index cdr_id_idx (cdr_id, provider_id, direction_id, relation_id, cdr_start_time);
|
||||
ALTER TABLE cdr_tag_data drop primary key,
|
||||
add index cdr_id_idx (cdr_id, provider_id, direction_id, tag_id, cdr_start_time);
|
||||
Loading…
Reference in new issue