[ https://issues.apache.org/jira/browse/SENTRY-2210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576736#comment-16576736 ]
Arjun Mishra edited comment on SENTRY-2210 at 8/10/18 7:03 PM: --------------------------------------------------------------- Its the same with Derby too. Derby adds index by default. On adding a new index we only get a warning message. See below {noformat} CREATE INDEX AUTHZ_PATH_FK_IDX ON AUTHZ_PATH (AUTHZ_OBJ_ID); 0 rows inserted/updated/deleted WARNING 01504: 'AUTHZ_PATH_FK_IDX' index not created because it is a duplicate of an existing index: 'SQL180810140032310'. {noformat} was (Author: arjunmishra13): Its the same with Derby too. Derby adds index by default. See below {noformat} CREATE INDEX AUTHZ_PATH_FK_IDX ON AUTHZ_PATH (AUTHZ_OBJ_ID); 0 rows inserted/updated/deleted WARNING 01504: 'AUTHZ_PATH_FK_IDX' index not created because it is a duplicate of an existing index: 'SQL180810140032310'. {noformat} > AUTHZ_PATH should have index on the foreign key AUTHZ_OBJ_ID > ------------------------------------------------------------ > > Key: SENTRY-2210 > URL: https://issues.apache.org/jira/browse/SENTRY-2210 > Project: Sentry > Issue Type: Improvement > Components: Sentry > Affects Versions: 2.1.0 > Reporter: Na Li > Assignee: Na Li > Priority: Major > Attachments: SENTRY-2210.001.patch, SENTRY-2210.002.patch, > SENTRY-2210.003.patch, SENTRY-2210.004.patch > > > AUTHZ_PATH does not have index on the foreign key AUTHZ_OBJ_ID. When the > number of entries become really large, a command like "select * from > AUTHZ_PATH where AUTHZ_OBJ_ID = 8311512" becomes very slow because it results > in table scan. > To improve performance, we should add index for its foreign key in table > AUTHZ_PATH. > The sql script to do this in Oracle is "CREATE INDEX AUTHZ_PATH_FK_IDX on > AUTHZ_PATH(AUTHZ_OBJ_ID);" -- This message was sent by Atlassian JIRA (v7.6.3#76005)