> On April 27, 2018, 3:51 p.m., kalyan kumar kalvagadda wrote:
> > Lina, This index might not be needed for every database. we need it for 
> > Oracle database for sure.
> > 
> > For example, mysql creates an index automaticallym when a cloumn is added 
> > as a foreign key. Adding a duplicate indexes is un-cecessary over head.

1)The test shows that after defining foreign key, MySql does automatically 
added the key fro the foreign key. KEY `AUTHZ_PATH_FK` (`AUTHZ_OBJ_ID`),
2)2) After adding index for the foreign key explicitly, the automatically 
created key is removed. So there is no more than one index on the same foreign 
key. KEY `AUTHZ_PATH_FK_IDX` (`AUTHZ_OBJ_ID`),

More details in 
https://issues.apache.org/jira/browse/SENTRY-2210?focusedCommentId=16456708&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16456708


- Na


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66764/#review202069
-----------------------------------------------------------


On April 27, 2018, 3:13 p.m., Na Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66764/
> -----------------------------------------------------------
> 
> (Updated April 27, 2018, 3:13 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, Arjun Mishra, kalyan kumar 
> kalvagadda, and Sergio Pena.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> add index for the foreign key AUTHZ_OBJ_ID on table AUTHZ_PATH
> 
> 
> Diffs
> -----
> 
>   
> sentry-provider/sentry-provider-db/src/main/resources/010-SENTRY-2210.derby.sql
>  PRE-CREATION 
>   
> sentry-provider/sentry-provider-db/src/main/resources/010-SENTRY-2210.mysql.sql
>  PRE-CREATION 
>   
> sentry-provider/sentry-provider-db/src/main/resources/010-SENTRY-2210.oracle.sql
>  PRE-CREATION 
>   
> sentry-provider/sentry-provider-db/src/main/resources/010-SENTRY-2210.postgres.sql
>  PRE-CREATION 
>   sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-2.1.0.sql 
> ca20a39 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-2.1.0.sql 
> 70acb89 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-2.1.0.sql 
> eb175bd 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-2.1.0.sql 
> e6dbf91 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-2.1.0.sql
>  989301b 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-2.0.0-to-2.1.0.sql
>  aca05bc 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-derby-2.0.0-to-2.1.0.sql
>  a3c87bd 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-mysql-2.0.0-to-2.1.0.sql
>  cce5c7c 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-oracle-2.0.0-to-2.1.0.sql
>  169cd4d 
>   
> sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-postgres-2.0.0-to-2.1.0.sql
>  986389b 
> 
> 
> Diff: https://reviews.apache.org/r/66764/diff/4/
> 
> 
> Testing
> -------
> 
> run mysql script to verify it works on mysql
> SentrySchemaTool upgrade/install tests
> 
> 
> Thanks,
> 
> Na Li
> 
>

Reply via email to