wecharyu commented on code in PR #4744:
URL: https://github.com/apache/hive/pull/4744#discussion_r1427814093


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/impl/FindColumnsWithStatsHandler.java:
##########
@@ -37,11 +37,16 @@ public class FindColumnsWithStatsHandler implements 
QueryHandler<List<String>> {
 
   //language=SQL
   private static final String TABLE_SELECT = "SELECT \"COLUMN_NAME\" FROM 
\"TAB_COL_STATS\" " +
-      "WHERE \"DB_NAME\" = :dbName AND \"TABLE_NAME\" = :tableName";
+      "INNER JOIN \"TBLS\" ON \"TAB_COL_STATS\".\"TBL_ID\" = 
\"TBLS\".\"TBL_ID\" " +

Review Comment:
   @zhangbutao @deniskuzZ The benchmark test result shows there was no obvious 
performance decline:
   ```bash
   java -jar ./hmsbench-jar-with-dependencies.jar -H localhost --savedata 
/tmp/benchdata --sanitize -N 100 -N 1000 -o bench_results_direct.csv -C -d 
testbench_http --params=100  -E 'drop.*' -E 'renameTable.*' -E 
'getTableObjectsByName.*' -E 'listTables.*' -E 'listPartitions.*' -E 
'getPartitionsByNames.*' -E 'getPartitionNames.*' -E 'listPartition' -E 
'getPartition' -E 'getPartitions' -E 'getPartitions.10' -E 'getPartitions.100' 
-E 'getPartitions.1000' -E 'addPartition' -E 'addPartitions.*' -E 'getNid' -E 
'listDatabases' -E 'getTable' -E 'createTable' -E 'openTxn.*'
   ```
   - Before this patch
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              4.053    3.982    3.757    5.958    6.661
   getPartitionsStat.100          4.522    4.429    4.120    6.520    7.953
   getPartitionsStat.1000         6.976    6.808    6.493    11.46    10.39
   updatePartitionsStat           7.054    7.019    6.679    8.144    3.218
   updatePartitionsStat.100       1507     1478     1447     3230     12.33
   updatePartitionsStat.1000      1.491e+04 1.479e+04 1.459e+04 1.661e+04 2.386
   ```
   - After this patch
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              4.018    3.970    3.666    5.845    6.487
   getPartitionsStat.100          4.091    4.049    3.838    4.789    4.371
   getPartitionsStat.1000         6.248    6.142    5.869    10.95    8.817
   updatePartitionsStat           7.031    6.813    6.312    15.33    15.20
   updatePartitionsStat.100       1470     1454     1427     1871     5.304
   updatePartitionsStat.1000      1.468e+04 1.454e+04 1.440e+04 1.667e+04 2.231
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to