fix: Added primary key to perf_times to improve DELETE performance on replicas using ROW based replication (#7493)

* fix: Added primary key to perf_times to improve DELETE performance on replicas using ROW based replication

* moved sql file

* moved sql file

* Rebased

* fixed schema

* moved sql file
This commit is contained in:
Neil Lathwood
2017-10-31 21:08:16 +00:00
committed by GitHub
parent 6e3ea8b28e
commit cb333071c8
3 changed files with 5 additions and 1 deletions
+2
View File
@@ -997,6 +997,7 @@ pdb_ix_peers:
PRIMARY: { Name: PRIMARY, Columns: [pdb_ix_peers_id], Unique: true, Type: BTREE }
perf_times:
Columns:
- { Field: id, Type: int(11), 'Null': false, Extra: auto_increment }
- { Field: type, Type: varchar(8), 'Null': false, Extra: '' }
- { Field: doing, Type: varchar(64), 'Null': false, Extra: '' }
- { Field: start, Type: int(11), 'Null': false, Extra: '' }
@@ -1004,6 +1005,7 @@ perf_times:
- { Field: devices, Type: int(11), 'Null': false, Extra: '' }
- { Field: poller, Type: varchar(255), 'Null': false, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE }
type: { Name: type, Columns: [type], Unique: false, Type: BTREE }
plugins:
Columns:
+1 -1
View File
@@ -1,2 +1,2 @@
ALTER TABLE `config` CHANGE `config_group_order` `config_group_order` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `config` CHANGE `config_sub_group_order` `config_sub_group_order` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `config` CHANGE `config_sub_group_order` `config_sub_group_order` INT(11) NOT NULL DEFAULT 0;
+2
View File
@@ -0,0 +1,2 @@
TRUNCATE `perf_times`;
ALTER TABLE `perf_times` ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;