问题标签 [materialized-views]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
6304 浏览

oracle - Oracle - FAST REFRESH 具有 LEFT JOINS 的物化视图更新非常慢

我在 Oracle 中有一个物化视图,其中包含一个需要很长时间才能更新的 LEFT JOIN。当我更新基础表时,它需要 63914.765 秒才能运行(是的,差不多 17 小时)。

我在同一张表上使用 LEFT JOIN,因为我想将数据从行旋转到列。透视命令在此 Oracle 版本中不可用,并且不允许在 FAST REFRESH 物化视图上使用 GROUP BY + CASE。

物化视图日志如下所示:

物化视图本身看起来像这样(它包含 700000 行,Programmes_Titles 表包含 900000 行):

我使用的 UPDATE 语句是这样的:

此 UPDATE 语句需要 17 小时。使用 INNER JOIN(删除(+))时,需要几毫秒。

我还尝试在 Mv_Web_Programmes 物化视图上添加 INDEXES,但这似乎也没有帮助。(它仍然运行超过一分钟,这很慢,我不会在每次更改后等待 17 小时,所以它可能会改进 UPDATE)

所以我的问题是:为什么要花这么长时间来更新基础表?我该如何改进呢?

0 投票
2 回答
1701 浏览

sql - 物化视图 - Oracle

我已经物化了要更改其刷新时间的视图:

我想知道这方面的一些事情。

  1. NEXT SYSDATE +1 描述了什么(我将如何更改它)
  2. 什么是 DISABLE QUERY REWRITE
    换句话说,就物化视图而言,DISABLE QUERY REWRITE vs ENABLE QUERY REWRITE。
0 投票
2 回答
1373 浏览

oracle - Oracle - 创建物化视图

我正在阅读一些文章,甚至是堆栈上的一些答案,但我仍然有一些问题。我将发布我的 MV 代码以进行可能的分析:

错误是:

我忘记了什么吗?我唯一想要的是每个月开始我的MV更新。有人可以帮忙吗?

谢谢!

0 投票
1 回答
113 浏览

php - 删除某些源数据后如何维护汇总表的更新

我遇到了物化视图,看起来很棒: http ://en.oreilly.com/mysql2011/public/schedule/detail/17146

但是有太多“详细”数据,我不得不在每天结束时将其删除......有没有办法我仍然可以利用 flexviews 或类似的东西来处理我的求和逻辑?

对于上下文,此脚本记录页面视图(其中它们太多,我无法无限期地存储所有详细信息),并且我正在寻找构建汇总表来回答长期报告问题。

0 投票
1 回答
2431 浏览

oracle - Refreshing Materialzed View in Oracle

I have created materialized view (MV) on a table which is updated once in a month.. Do we have any automatic way to refresh my MV... I mean how refresh of MV is done is it manual or Automatic how frequent we can do???? like can i use Trigger for it..??

I am using Oracle9i on PL/SQL developer Thanks

0 投票
3 回答
17387 浏览

oracle - 为什么在创建这个简单的物化视图示例时会出现 ORA-12054 错误?

无法理解这里有什么问题,我知道如果我取出 DISTINCT 子句它会起作用,但是如果我指定了必需的“REFRESH COMPLETE ON COMMIT”,为什么我不能使用“DISTINCT”。

如果我按需使用 DISTINCT 和 REFRESH 没有问题,但这不是要求。

0 投票
1 回答
1840 浏览

oracle - Oracle materialized view log

If I have table T with 10 columns and create materialized view log with only 3 of them as well as materialized view with those 3, why when I updated ANY column in the table (besides those in the log) the record is inserted into MLOG$_T ? Is there a way to avoid?

Thanks

0 投票
2 回答
4790 浏览

oracle - oracle刷新抛出表未找到异常

有简单的刷新脚本:

甲骨文认为:

问题:我错过了什么?

笔记:

  • 刷新的MV确实存在
  • 如果未指定架构,则结果相同
0 投票
1 回答
1508 浏览

oracle - Refreshable on commit materialized view using MAX()

I'm being hit hard by the entity-attribute-value antipattern. Some day, years ago, a guy decided that DDL wasn't sexy, and wanted to develop something "flexible enough" to keep information about people. He ignored the fact that people uses to have at least some basic attributes, as name, date of birth, and the like. Not only that, he put a bunch of (side-effects-ridden) PL/SQL packages on top of that schema. The thing managed to be a key subsystem in which other applications relied on.

Fast forward some years and 20 million rows. The guy isn't at the company anymore, and I have to deal with this. I need to implement some basic searches that right now would require multiple inner joins and just take forever for some cases. Rewriting the whole thing it's not possible, so I want to "pivot" the most important attributes.

I thought that materialized views could be a viable alternative, but I need some guidance, since I have never used them. I would like to get a table like this:

as I understand reading Oracle docs, I should be able to create a "REFRESHABLE ON COMMIT" materialized view with MAX() if the query has no where clause.

But can't get it to work. I've tried:

It works for inserts, but not for updates. I see that is capable of these things:

but I think I should see also REFRESH_FAST_AFTER_ONETAB_DML. Any ideas?

Update: Output of dbms_mview.explain_mview

0 投票
1 回答
221 浏览

oracle - 有没有办法查询Oracle中物化视图快速刷新所做的更改?

假设您有两个 Oracle 数据库,DB_A 和 DB_B。在 DB_A 中有一个名为 TAB1 的表,其中包含一个物化视图日志,并且在 DB_B 中创建了一个名为 SNAP_TAB1 的物化视图

每次调用快速刷新物化视图后,有没有办法在 DB_B 中查询对 SNAP_TAB1 所做的更改?

在 DB_A 中,在刷新之前,您可以查询物化视图日志表 MLOG$_TAB1,以查看 TAB1 中哪些行发生了更改。我正在寻找一种在 DB_B 中查询的方法,每次刷新后,SNAP_TAB1 中已刷新了哪些行。

谢谢!