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


##########
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:
   The ORM was similar, here is a test result in mysql ORM:
   - Before this patch:
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              7.583    7.432    5.914    11.53    13.82
   getPartitionsStat.100          5.956    5.778    5.280    12.48    14.01
   getPartitionsStat.1000         12.12    11.93    11.00    13.97    5.809
   updatePartitionsStat           11.75    11.69    10.32    14.97    6.476
   updatePartitionsStat.100       1581     1572     1510     1961     4.320
   updatePartitionsStat.1000      1.579e+04 1.564e+04 1.536e+04 1.778e+04 2.859
   ```
   - After this patch:
   ```bash
   Operation                      Mean     Med      Min      Max      Err%
   getPartitionsStat              7.323    7.341    5.533    10.45    13.74
   getPartitionsStat.100          5.168    5.079    4.643    9.383    10.01
   getPartitionsStat.1000         11.35    11.14    10.51    13.49    5.317
   updatePartitionsStat           10.86    10.67    8.824    19.97    14.70
   updatePartitionsStat.100       1537     1523     1471     1917     4.554
   updatePartitionsStat.1000      1.563e+04 1.549e+04 1.517e+04 1.774e+04 2.890
   ```



-- 
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