Skip to content

Commit

Permalink
Adding new index to fix slowness on select queries
Browse files Browse the repository at this point in the history
  • Loading branch information
dhamith93 committed Jun 16, 2022
1 parent 319f1ef commit 052221e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collector/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,7 @@ CREATE TABLE `server_ping_time` (
`server_id` int,
`time` bigint(20)
);
ALTER TABLE `server_ping_time` ADD FOREIGN KEY (`server_id`) REFERENCES `server` (`id`);
ALTER TABLE `server_ping_time` ADD FOREIGN KEY (`server_id`) REFERENCES `server` (`id`);

-- change done to fix some lag on select queries
ALTER TABLE `monitor_log` ADD INDEX(`server_id`, `log_type`);

0 comments on commit 052221e

Please sign in to comment.