[ 
https://issues.apache.org/jira/browse/HIVE-21344?focusedWorklogId=325909&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325909
 ]

ASF GitHub Bot logged work on HIVE-21344:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Oct/19 20:46
            Start Date: 09/Oct/19 20:46
    Worklog Time Spent: 10m 
      Work Description: vineetgarg02 commented on pull request #749: HIVE-21344
URL: https://github.com/apache/hive/pull/749#discussion_r333172647
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java
 ##########
 @@ -159,15 +165,36 @@ public void run() {
         SessionState ss = new SessionState(db.getConf());
         ss.setIsHiveServerQuery(true); // All is served from HS2, we do not 
need e.g. Tez sessions
         SessionState.start(ss);
-        final boolean cache = !db.getConf()
-            
.get(HiveConf.ConfVars.HIVE_SERVER2_MATERIALIZED_VIEWS_REGISTRY_IMPL.varname).equals("DUMMY");
-        for (Table mv : db.getAllMaterializedViewObjectsForRewriting()) {
-          addMaterializedView(db.getConf(), mv, OpType.LOAD, cache);
+        if (initialized.get()) {
+          for (Table mvTable : db.getAllMaterializedViewObjectsForRewriting()) 
{
 
 Review comment:
   I suggest we add a info/perf LOG here to mark the beginning of 
refresh/initialization. Since we already LOG when it is finished it will give 
us an idea how long this initialization/refresh spent. This will potentially 
help debug issues related to performance in future. 
 
----------------------------------------------------------------
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: 325909)
    Time Spent: 20m  (was: 10m)

> CBO: Reduce compilation time in presence of materialized views
> --------------------------------------------------------------
>
>                 Key: HIVE-21344
>                 URL: https://issues.apache.org/jira/browse/HIVE-21344
>             Project: Hive
>          Issue Type: Bug
>          Components: Materialized views
>    Affects Versions: 4.0.0
>            Reporter: Gopal Vijayaraghavan
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21344.01.patch, HIVE-21344.02.patch, 
> HIVE-21344.03.patch, HIVE-21344.04.patch, HIVE-21344.patch, 
> calcite-planner-after-fix.svg.zip, mv-get-from-remote.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> For every query, {{getAllValidMaterializedViews}} still requires a call to 
> metastore to verify that the materializations exist, whether they are 
> outdated or not, etc. Since this is only useful for active-active HS2 
> deployments, we could take a less aggressive approach and check this 
> information only after rewriting has been triggered. In addition, we could 
> refresh the information in the HS2 registry periodically in a background 
> thread.
> {code}
> // This is not a rebuild, we retrieve all the materializations. In turn, we 
> do not need
> // to force the materialization contents to be up-to-date, as this is not a 
> rebuild, and
> // we apply the user parameters 
> (HIVE_MATERIALIZED_VIEW_REWRITING_TIME_WINDOW) instead.
> materializations = db.getAllValidMaterializedViews(getTablesUsed(basePlan), 
> false, getTxnMgr());
> {code}
> !mv-get-from-remote.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to