Oracle??™s query optimizer will automatically recognize that the materialized view
could be used to satisfy the query??”a feature known as query rewrite.
NOTE
For best results, make sure the statistics on the materialized view
are kept current. As of Oracle Database 10g, statistics on all
database objects are collected on a regular basis during predefined
maintenance windows as part of the automated maintenance tasks
infrastructure (AutoTask).
You can use initialization parameters to configure the optimizer to automatically rewrite queries
to use the materialized views whenever possible. Because materialized views are transparent to
SQL applications, they can be dropped or created without any impact on the execution of the
SQL code. You can also create partitioned materialized views, and you can base materialized
views on partitioned tables.
Unlike regular views, materialized views store data and take up physical space in your database.
Materialized views are populated with data generated from their base queries, and they are
Chapter 17: Managing Distributed Databases 613
refreshed on demand or on a scheduled basis. Therefore, whenever the data accessed by the base
query changes, the materialized views should be refreshed to reflect the data changes. The data
refresh frequency depends on how much data latency your business can tolerate in the processes
supported by the materialized views. You??™ll see how to establish your refresh rate later in this
chapter.
Pages:
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900