Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6688509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:24:43+00:00 2026-05-26T05:24:43+00:00

Does a refresh fast on commit union all materialized view (in Oracle) copy all

  • 0

Does a refresh fast on commit union all materialized view (in Oracle) copy all the underlying data, or does it just have a reference to it?

If this materialized view does copy all the data is there anyway to do the following:

create table3 as ( table1 union all table2 );

So that I can create indexes and materialized view logs on table3, and table 3 is just a reference to table 1 and table 2.

The reason for this is I want put the following in a materialized view:

create materialized view mat1
refresh fast on commit
(
  select data, count(*)
  from (table1 union all table2)
  group by data
);

But the above isn’t fast refreshable.

But the following sort of thing works:

create materialized view mat1
refresh fast on commit
(
  select data from table1
  union all
  select data from table2
);

create materialized view mat2
refresh fast on commit
(
  select data, count(*) 
  from mat2
  group by data
);

But I’m concerned the first materialized view is unnecessarily replicating all the data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:24:44+00:00Added an answer on May 26, 2026 at 5:24 am

    A materialized view does exactly that – it “materializes” the data by creating a table containing the data defined by the query. You can demonstrate this by dropping the materialized view but preserving the contents as a table:

    DROP MATERIALIZED VIEW xxx PRESERVE TABLE;
    

    Which keeps a table named xxx that is no longer refreshed. So, your mat1 view does indeed duplicate all the data in both tables.

    Think about it – if it just “referenced” the union, then it would be a regular view, no? You can’t have your cake and eat it too in this case.

    EDIT:

    You cannot have a fast refresh on a complex materialized view. Aggregate functions such as COUNT are one of the things that cause a view to be complex. According to the docs, so does a UNION ALL, so I’m surprised your mat1 view is fast refreshable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a materialized view defined this way: CREATE MATERIALIZED VIEW M_FOO REFRESH COMPLETE
My UITable View does not refresh from its data source of an array, which
I'm trying to create a materialized view in Oracle 11.1, which apparently does not
How often does Akamai refresh cache? We use Akamai to cache frequently accessed files.
What does the CascadeType.REFRESH actually do? The definition for it is When we refresh
When i refresh my flex application, the page does not hold its state and
My ascx control inside a container update panel does a full page refresh when
Does Google force employees who have offers from Facebook to leave immediately?
Does the Java language have delegate features, similar to how C# has support for
Does anyone have any recommendations of tools that can be of assistance with moving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.