GUACAMOLE-345: Name all PostgreSQL indexes.

This commit is contained in:
Michael Jumper
2017-07-22 21:41:58 -07:00
parent 128b0ca8e0
commit 0ad7e4e1a3
4 changed files with 71 additions and 29 deletions

View File

@@ -125,7 +125,8 @@ CREATE TABLE guacamole_sharing_profile (
);
CREATE INDEX ON guacamole_sharing_profile(primary_connection_id);
CREATE INDEX guacamole_sharing_profile_primary_connection_id
ON guacamole_sharing_profile(primary_connection_id);
--
-- Add table of sharing profile parameters
@@ -145,7 +146,8 @@ CREATE TABLE guacamole_sharing_profile_parameter (
);
CREATE INDEX ON guacamole_sharing_profile_parameter(sharing_profile_id);
CREATE INDEX guacamole_sharing_profile_parameter_sharing_profile_id
ON guacamole_sharing_profile_parameter(sharing_profile_id);
--
-- Object-level permission table for sharing profiles
@@ -169,8 +171,11 @@ CREATE TABLE guacamole_sharing_profile_permission (
);
CREATE INDEX ON guacamole_sharing_profile_permission(sharing_profile_id);
CREATE INDEX ON guacamole_sharing_profile_permission(user_id);
CREATE INDEX guacamole_sharing_profile_permission_sharing_profile_id
ON guacamole_sharing_profile_permission(sharing_profile_id);
CREATE INDEX guacamole_sharing_profile_permission_user_id
ON guacamole_sharing_profile_permission(user_id);
--
-- Add new (optional) sharing profile ID and name columns to connection history
@@ -187,4 +192,5 @@ ALTER TABLE guacamole_connection_history
FOREIGN KEY (sharing_profile_id)
REFERENCES guacamole_sharing_profile (sharing_profile_id) ON DELETE SET NULL;
CREATE INDEX ON guacamole_connection_history(sharing_profile_id);
CREATE INDEX guacamole_connection_history_sharing_profile_id
ON guacamole_connection_history(sharing_profile_id);

View File

@@ -51,4 +51,5 @@ CREATE TABLE guacamole_user_password_history (
);
CREATE INDEX ON guacamole_user_password_history(user_id);
CREATE INDEX guacamole_user_password_history_user_id
ON guacamole_user_password_history(user_id);

View File

@@ -21,6 +21,12 @@
-- Ensure history entry start/end dates are indexed.
--
CREATE INDEX ON guacamole_connection_history(start_date);
CREATE INDEX ON guacamole_connection_history(end_date);
CREATE INDEX guacamole_connection_history_search_index ON guacamole_connection_history(start_date, connection_id, user_id);
CREATE INDEX guacamole_connection_history_start_date
ON guacamole_connection_history(start_date);
CREATE INDEX guacamole_connection_history_end_date
ON guacamole_connection_history(end_date);
CREATE INDEX guacamole_connection_history_search_index
ON guacamole_connection_history(start_date, connection_id, user_id);