mv complate重新整理時使用DELETE OR TRUNCATE!
You Asked
I am seeing that when I use the dbms_mview.refresh function to refresh a group of Materialized Views, that the view contents are deleted. I have also seen that if I set atomic_refresh to False, that Truncate should be used. In reading the description of atomic_refresh indicates whether the group of MV's is refresh together or as independent refreshes. It does not discuss 'Delete' vs 'Truncate'.My situation is that I have several MV's that are quite large and would prefer to refresh them using Truncate.
My question, If I provide a list of MV's to the dbms_mview.refresh function, what is the use of Truncate, based on the setting of atomic_refresh? Or, should I be doing something else to ensure that Truncate is used?
[@more@]
and we said...
we've talked about this a couple of times.
If you "have several MV's that are quite large and would prefer to refresh them using Truncate", in 10g and above you would use atomic_refresh=>FALSE
that permits us to user
truncate+insert/*+APPEND*/
to rebuild the MV (the MV disappears for a while, becomes empty - you have to expect that)
else, if atomic_refresh=>TRUE, we use
delete+insert
to rebuild the MV (the MV never disappears, transactional consistency is there)
If you use a list like mv1,mv2... - and atomic_refresh=>FALSE, it'll use truncate+insert/*+Append*/ on them in turn.
引自:http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1857127200346321681
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10130206/viewspace-1056922/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Diffrence Between delete and truncatedelete
- truncate 比 delete 慢delete
- drop、delete 與truncatedelete
- SQL – TRUNCATE vs DELETESQLdelete
- MV快速重新整理時執行的SQLSQL
- truncate delete drop 區別delete
- truncate delete 的區別delete
- 簡述truncate、delete和dropdelete
- Truncate,Delete,Drop的比較.delete
- truncate與delete的區別delete
- truncate 比 delete 慢的原因。delete
- truncate和delete 的區別delete
- SQL truncate 、delete與drop區別SQLdelete
- oracle truncate 與 delete 的區別Oracledelete
- truncate,delete,drop的異同點delete
- truncate 和 delete 的效能對比delete
- 為什麼當刪除整個表中的資料時,需使用TRUNCATE代替DELETEdelete
- delete和truncate刪除的區別delete
- Oracle中truncate和delete的區別Oracledelete
- 深入解析delete和truncate不同之處:delete
- HWM和delete,drop,truncate的關係delete
- truncate,delete,drop的異同點(原)delete
- 關於delete,drop,truncate的問題delete
- 提高對大批量資料時MV的重新整理效率
- 資料庫:drop、truncate、delete的區別資料庫delete
- SQLSERVER 的 truncate 和 delete 有區別嗎?SQLServerdelete
- MySQL和Oracle中的delete,truncate對比MySqlOracledelete
- zt_orafaq_delete與truncate的區別delete
- 表管理之四:刪除資料Delete與truncate的使用區別delete
- Oracle中truncate和delete的區別(例項)Oracledelete
- 詳解SQL中drop、delete和truncate的異同SQLdelete
- oracle恢復表delete/truncate/drop的方法總結Oracledelete
- Truncate table 詳解及與delete,drop 的區別delete
- delete/truncate刪除資料索引空間問題delete索引
- Truncate table詳解及與delete,drop的區別delete
- MV (Materialed View) 物化檢視的重新整理組View
- 資料庫關鍵詞 drop、truncate和delete的用法資料庫delete
- truncate和不帶where子句的delete, 以及drop區別delete