[ https://issues.apache.org/jira/browse/HIVE-22015?focusedWorklogId=454544&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-454544 ]
ASF GitHub Bot logged work on HIVE-22015: ----------------------------------------- Author: ASF GitHub Bot Created on: 04/Jul/20 17:11 Start Date: 04/Jul/20 17:11 Worklog Time Spent: 10m Work Description: sankarh commented on a change in pull request #1109: URL: https://github.com/apache/hive/pull/1109#discussion_r449789477 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java ########## @@ -543,10 +557,30 @@ static void prewarm(RawStore rawStore) { tableColStats = rawStore.getTableColumnStatistics(catName, dbName, tblName, colNames, CacheUtils.HIVE_ENGINE); Deadline.stopTimer(); } + Deadline.startTimer("getPrimaryKeys"); + primaryKeys = rawStore.getPrimaryKeys(catName, dbName, tblName); + Deadline.stopTimer(); + cacheObjects.setPrimaryKeys(primaryKeys); + + Deadline.startTimer("getForeignKeys"); + foreignKeys = rawStore.getForeignKeys(catName, null, null, dbName, tblName); Review comment: We can have the foreignkeys kept under foreignkey table wrapper but the reference such as foreignkey db/table and key name in parent table wrapper. It will be useful when getForeignKeys is called with null for foreign db/tbl. I just want to confirm if this a frequent call with null as input. If yes, then let's do it, if not ignore this comment. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 454544) Time Spent: 2h 50m (was: 2h 40m) > [CachedStore] Cache table constraints in CachedStore > ---------------------------------------------------- > > Key: HIVE-22015 > URL: https://issues.apache.org/jira/browse/HIVE-22015 > Project: Hive > Issue Type: Sub-task > Reporter: Daniel Dai > Assignee: Adesh Kumar Rao > Priority: Major > Labels: pull-request-available > Time Spent: 2h 50m > Remaining Estimate: 0h > > Currently table constraints are not cached. Hive will pull all constraints > from tables involved in query, which results multiple db reads (including > get_primary_keys, get_foreign_keys, get_unique_constraints, etc). The effort > to cache this is small as it's just another table component. -- This message was sent by Atlassian Jira (v8.3.4#803005)