-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #323 from kinvolk/query_optim
backend: Improve sql query performances
- Loading branch information
Showing
5 changed files
with
95 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- +migrate Up | ||
|
||
create index if not exists instance_application_instance_id_application_id_idx on instance_application (instance_id,application_id); | ||
|
||
create index if not exists activity_class_created_ts_severity_version_group_id_applica_idx on activity (class,created_ts,severity,"version",group_id,application_id); | ||
|
||
create index if not exists instance_application_application_id_group_id_last_check_for_idx on instance_application(application_id,group_id,last_check_for_updates,instance_id); | ||
|
||
-- +migrate Down | ||
|
||
drop index if exists instance_application_instance_id_application_id_idx; | ||
|
||
drop index if exists activity_class_created_ts_severity_version_group_id_applica_idx; | ||
|
||
drop index if exists instance_application_application_id_group_id_last_check_for_idx; |
11 changes: 0 additions & 11 deletions
11
pkg/api/db/migrations/0011_add_index_instance_application.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- +migrate Up | ||
|
||
drop index if exists users_team_id_idx; | ||
|
||
drop index if exists instance_status_history_application_id_idx; | ||
|
||
drop index if exists event_event_type_id_idx; | ||
|
||
drop index if exists event_application_id_idx; | ||
|
||
drop index if exists channel_package_id_idx; | ||
|
||
-- +migrate Down | ||
|
||
create index if not exists users_team_id_idx on users (team_id); | ||
|
||
create index if not exists instance_status_history_application_id_idx on instance_status_history (application_id); | ||
|
||
create index if not exists event_event_type_id_idx on event (event_type_id); | ||
|
||
create index if not exists event_application_id_idx on event (application_id); | ||
|
||
create index if not exists channel_package_id_idx on channel (package_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters