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


##########
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:
   benchmark test in postgres:
   - Before this patch
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              5.567    5.540    4.552    7.147    9.534
   getPartitionsStat.100          3.768    3.694    3.169    6.014    13.11
   getPartitionsStat.1000         4.884    4.828    4.533    6.532    5.764
   updatePartitionsStat           8.446    8.269    6.857    13.06    11.14
   updatePartitionsStat.100       878.3    864.7    822.6    1360     7.428
   updatePartitionsStat.1000      9132     9082     8960     1.102e+04 2.426
   ```
   - After this patch
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              5.400    5.316    4.462    7.926    11.33
   getPartitionsStat.100          4.099    4.001    3.687    8.556    12.75
   getPartitionsStat.1000         4.417    4.343    3.889    5.383    7.743
   updatePartitionsStat           8.432    8.366    7.243    13.19    9.267
   updatePartitionsStat.100       870.4    863.5    830.1    1158     4.379
   updatePartitionsStat.1000      9157     9130     8963     1.064e+04 1.981
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to