Data Sheet nearly 40 million the amount of data, the table only the primary key index no other indexes, materialized views to create a pre-filter query
- often only a few hundred each query of data in 40 million, and thus create a materialized view filter and get the result of a few thousand to tens of thousands of pieces of data, and creates a listener dynamically updated.
drop materialized view log on fs_budgetpayout_detail ; --不是view名,是表名 create materialized view mv_fs_budgetpayout_detail --创建物化视图 mv_fs_budgetpayout_detail build immediate refresh fast on commit enable query rewrite as select t.fiscal, t.co_code, t.project_code, t.outlay_code , sum(t.payout_amt) payout_amt from fs_budgetpayout_detail t where t.period != 0 and t.period != 13 group by t.fiscal, t.co_code, t.project_code,t.outlay_code create materialized view log on fs_budgetpayout_detail with rowid,sequence(payout_amt,fiscal,co_code,project_code,period,outlay_code) including new values;