Materialized Views in data warehouse environment (185)

tsinglee發表於2007-11-12

In data warehouses, materialized views are used to compute and store aggregated
data such as sums and averages. Materialized views in these environments are
typically referred to as summaries because they store summarized data. They can
also be used to compute joins with or without aggregations. If compatibility is set
to Oracle9i or higher, then materialized views can be used for queries that include
filter selections.
The optimizer can use materialized views to improve query performance by
automatically recognizing when a materialized view can and should be used to
satisfy a request. The optimizer transparently rewrites the request to use the
materialized view. Queries are then directed to the materialized view and not to
the underlying detail tables or views.

資料倉儲環境下的物化檢視
在資料倉儲中,物化檢視常被用於計算和儲存聚合資料,例如彙總,平均等.在資料倉儲環境中,物化檢視也被稱為概要,
因為其中通常儲存的是彙總資料.使用者也可以使用物化檢視儲存多個表連線後的結果集.如果資料庫的相容性引數被設為 Oracle9i 或更高,
物化檢視的查詢中可以包含過濾選擇

最佳化器可以利用物化檢視來提升查詢效能.最佳化器能夠自動地判斷一個儲存彙總資料的物化檢視是否能滿足使用者的查詢要求,
以及使用此物化檢視是否能提高查詢效能.之後最佳化器能夠重寫使用者提交的查詢以便使用相應的物化檢視,而這個重寫過程對使用者是透明的.
此時查詢直接使用物化檢視,而非使用者提交的 SQL 語句中指定的明細資料表或檢視.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-981812/,如需轉載,請註明出處,否則將追究法律責任。

相關文章