[ https://issues.apache.org/jira/browse/HIVE-21344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16950708#comment-16950708 ]
Jesus Camacho Rodriguez commented on HIVE-21344: ------------------------------------------------ [~ashutoshc], fwiw the refresh is incremental: for those materialized views that are up-to-date, reload is a no-op, and we only end up reloading in the registry those that are missing or are not up-to-date. I'll create a new JIRA to change the default. > 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 > Fix For: 4.0.0 > > Attachments: HIVE-21344.01.patch, HIVE-21344.02.patch, > HIVE-21344.03.patch, HIVE-21344.04.patch, HIVE-21344.05.patch, > HIVE-21344.patch, calcite-planner-after-fix.svg.zip, mv-get-from-remote.png > > Time Spent: 1h > 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)