RANGER-486: Added index on resource_signature in x_policy Signed-off-by: sneethiraj <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/aff40741 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/aff40741 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/aff40741 Branch: refs/heads/tag-policy Commit: aff40741dc0aba53dbd492921bfbce7ede7be475 Parents: a65852b Author: Velmurugan Periasamy <[email protected]> Authored: Sun May 17 17:44:42 2015 -0400 Committer: sneethiraj <[email protected]> Committed: Sun May 17 17:58:09 2015 -0400 ---------------------------------------------------------------------- security-admin/db/mysql/patches/009-updated_schema.sql | 3 ++- security-admin/db/oracle/patches/009-updated_schema.sql | 1 + security-admin/db/postgres/xa_core_db_postgres.sql | 1 + security-admin/db/sqlserver/xa_core_db_sqlserver.sql | 6 ++++++ 4 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/aff40741/security-admin/db/mysql/patches/009-updated_schema.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/mysql/patches/009-updated_schema.sql b/security-admin/db/mysql/patches/009-updated_schema.sql index 14d7367..4f58acc 100644 --- a/security-admin/db/mysql/patches/009-updated_schema.sql +++ b/security-admin/db/mysql/patches/009-updated_schema.sql @@ -90,7 +90,8 @@ KEY `x_policy_added_by_id` (`added_by_id`), KEY `x_policy_upd_by_id` (`upd_by_id`), KEY `x_policy_cr_time` (`create_time`), KEY `x_policy_up_time` (`update_time`), -KEY `x_policy_service` (`service`), +KEY `x_policy_service` (`service`), +KEY `x_policy_resource_signature` (`resource_signature`), CONSTRAINT `x_policy_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`), CONSTRAINT `x_policy_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) REFERENCES `x_portal_user` (`id`), CONSTRAINT `x_policy_FK_service` FOREIGN KEY (`service`) REFERENCES `x_service` (`id`) http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/aff40741/security-admin/db/oracle/patches/009-updated_schema.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/oracle/patches/009-updated_schema.sql b/security-admin/db/oracle/patches/009-updated_schema.sql index 7bcd8ed..77a7d72 100644 --- a/security-admin/db/oracle/patches/009-updated_schema.sql +++ b/security-admin/db/oracle/patches/009-updated_schema.sql @@ -443,4 +443,5 @@ CREATE INDEX x_policy_cr_time ON x_policy(create_time); CREATE INDEX x_policy_up_time ON x_policy(update_time); CREATE INDEX x_policy_service ON x_policy(service); CREATE INDEX x_resource_def_parent ON x_resource_def(parent); +CREATE INDEX x_policy_resource_signature ON x_policy(resource_signature); commit; http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/aff40741/security-admin/db/postgres/xa_core_db_postgres.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/postgres/xa_core_db_postgres.sql b/security-admin/db/postgres/xa_core_db_postgres.sql index 90cd0ac..ac54aa8 100644 --- a/security-admin/db/postgres/xa_core_db_postgres.sql +++ b/security-admin/db/postgres/xa_core_db_postgres.sql @@ -907,6 +907,7 @@ CREATE INDEX x_policy_cr_time ON x_policy(create_time); CREATE INDEX x_policy_up_time ON x_policy(update_time); CREATE INDEX x_policy_service ON x_policy(service); CREATE INDEX x_resource_def_parent ON x_resource_def(parent); +CREATE INDEX x_policy_resource_signature ON x_policy(resource_signature); DROP VIEW IF EXISTS vx_trx_log; CREATE VIEW vx_trx_log AS select x_trx_log.id AS id,x_trx_log.create_time AS create_time,x_trx_log.update_time AS update_time,x_trx_log.added_by_id AS added_by_id,x_trx_log.upd_by_id AS upd_by_id,x_trx_log.class_type AS class_type,x_trx_log.object_id AS object_id,x_trx_log.parent_object_id AS parent_object_id,x_trx_log.parent_object_class_type AS parent_object_class_type,x_trx_log.attr_name AS attr_name,x_trx_log.parent_object_name AS parent_object_name,x_trx_log.object_name AS object_name,x_trx_log.prev_val AS prev_val,x_trx_log.new_val AS new_val,x_trx_log.trx_id AS trx_id,x_trx_log.action AS action,x_trx_log.sess_id AS sess_id,x_trx_log.req_id AS req_id,x_trx_log.sess_type AS sess_type from x_trx_log where id in(select min(x_trx_log.id) from x_trx_log group by x_trx_log.trx_id); http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/aff40741/security-admin/db/sqlserver/xa_core_db_sqlserver.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/sqlserver/xa_core_db_sqlserver.sql b/security-admin/db/sqlserver/xa_core_db_sqlserver.sql index 74996f2..af0241c 100644 --- a/security-admin/db/sqlserver/xa_core_db_sqlserver.sql +++ b/security-admin/db/sqlserver/xa_core_db_sqlserver.sql @@ -2634,6 +2634,12 @@ CREATE NONCLUSTERED INDEX [x_policy_service] ON [x_policy] ) WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY] GO +CREATE NONCLUSTERED INDEX [x_policy_resource_signature] ON [x_policy] +( + [resource_signature] ASC +) +WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY] +GO CREATE NONCLUSTERED INDEX [x_resource_def_parent] ON [x_resource_def] ( [parent] ASC
