Use of Oracle Materialized View

Source: Internet
Author: User
Tags oracle materialized view

The materialized view aims to save some queries that take a long time to obtain results in advance, save the results of these queries to a local copy, and then query the results later, you can query data from the materialized view without querying some remote data tables. This improves the query performance.

Create materialized view AUTHOR_MV
REFRESH FAST
START WITH SYSDATE
Next sysdate more than 5/86400
WITH PRIMARY KEY
AS
SELECT *
From author @ TO_DMED;

The above is an example of creating a materialized view.

Refresh fast indicates to REFRESH the materialized view in incremental REFRESH mode, but only when the LOG of the materialized view is created on the table, the incremental REFRESH is to REFRESH the data changed since the last time.

Other options include: Completely refresh COMPLETE, FORCE automatically select the above two methods, first select FAST if the conditions are met.

Start with indicates the time when the data is copied to the local device for the first time, and NEXT indicates the NEXT refresh time.

With primary key is used to create a materialized view of the primary key on a remote database table.

Create materialized view log on author

With primary key;

If refresh fast is used, the materialized view log of the original table must be created in the data of the original table.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.