[ 
https://issues.apache.org/jira/browse/HIVE-6980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16452770#comment-16452770
 ] 

Peter Vary commented on HIVE-6980:
----------------------------------

Performance test results using [~akolb]'s testing tool 
([https://github.com/akolb1/hclient)|https://github.com/akolb1/hclient):], 
dropping table with 10/100/1000 partitions

Before:
{code:java}
[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 10 -W 1 -S dropTableWithPartitions.10

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.10     0.000    119.8    117.3    106.3    143.3    
8.807   

[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 100 -W 1 -S dropTableWithPartitions.100

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.100    0.000    661.1    654.7    623.1    728.2    
5.535    

[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 1000 -W 1 -S dropTableWithPartitions.1000

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.1000   0.000    6256     6282     5969     6492     
2.714   {code}
After:
{code:java}
[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 10 -W 1 -S dropTableWithPartitions.10

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.10     0.000    55.60    54.43    50.93    68.56    
9.390   

[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 100 -W 1 -S dropTableWithPartitions.100

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.100    0.000    70.30    69.46    67.85    75.43    
3.426   

[main] INFO  com.akolb.HMSBenchmark - using args -P 9084 -H localhost -d 
test_db7 -L 10 -N 1000 -W 1 -S dropTableWithPartitions.1000

Operation                      AMean    Mean     Med      Min      Max      
Err%    
dropTableWithPartitions.1000   0.000    267.6    267.7    259.5    272.9    
1.652 {code}
 

> Drop table by using direct sql
> ------------------------------
>
>                 Key: HIVE-6980
>                 URL: https://issues.apache.org/jira/browse/HIVE-6980
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>    Affects Versions: 0.12.0
>            Reporter: Selina Zhang
>            Assignee: Peter Vary
>            Priority: Major
>         Attachments: HIVE-6980.patch
>
>
> Dropping table which has lots of partitions is slow. Even after applying the 
> patch of HIVE-6265, the drop table still takes hours (100K+ partitions). 
> The fixes come with two parts:
> 1. use directSQL to query the partitions protect mode;
> the current implementation needs to transfer the Partition object to client 
> and check the protect mode for each partition. I'd like to move this part of 
> logic to metastore. The check will be done by direct sql (if direct sql is 
> disabled, execute the same logic in the ObjectStore);
> 2. use directSQL to drop partitions for table;
> there maybe two solutions here:
> 1. add "DELETE CASCADE" in the schema. In this way we only need to delete 
> entries from partitions table use direct sql. May need to change 
> datanucleus.deletionPolicy = DataNucleus. 
> 2. clean up the dependent tables by issue DELETE statement. This also needs 
> to turn on datanucleus.query.sql.allowAll
> Both of above solutions should be able to fix the problem. The DELETE CASCADE 
> has to change schemas and prepare upgrade scripts. The second solutions added 
> maintenance cost if new tables added in the future releases.
> Please advice. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to