Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema: Add indices needed for detail histories in Web #367

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions schema/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,8 @@ CREATE TABLE history (
PRIMARY KEY (id),

INDEX idx_history_event_time (event_time) COMMENT 'History filtered/ordered by event_time',
INDEX idx_history_host_id_object_type_event_time (host_id, object_type, event_time) COMMENT 'Host detail history ordered by event_time',
INDEX idx_history_host_service_id_object_type_event_time (host_id, service_id, object_type, event_time) COMMENT 'Service detail history ordered by event_time',
INDEX idx_history_acknowledgement (acknowledgement_history_id),
INDEX idx_history_comment (comment_history_id),
INDEX idx_history_downtime (downtime_history_id),
Expand Down
4 changes: 4 additions & 0 deletions schema/mysql/upgrades/1.0.0-rc2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ ALTER TABLE usergroup ADD INDEX `idx_usergroup_display_name` (`display_name`) CO
ALTER TABLE usergroup ADD INDEX idx_usergroup_name_ci (name_ci) COMMENT 'Usergroup list filtered using quick search';
ALTER TABLE usergroup ADD INDEX idx_usergroup_name (name) COMMENT 'Usergroup list filtered/ordered by name; Usergroup detail filter';

ALTER TABLE history
ADD INDEX idx_history_host_id_object_type_event_time (host_id, object_type, event_time) COMMENT 'Host detail history ordered by event_time',
ADD INDEX idx_history_host_service_id_object_type_event_time (host_id, service_id, object_type, event_time) COMMENT 'Service detail history ordered by event_time';

ALTER TABLE host
MODIFY active_checks_enabled enum('n','y') NOT NULL,
MODIFY passive_checks_enabled enum('n','y') NOT NULL,
Expand Down