Is it possible to query Oracle materialized view with Entity Framework model using linq?
Yes. From the Entity Framework's perspective, a materialized view is a table. The only caveat is that to generate the model from the materialized view, the materialized view must have a non-nullable column that could be used as the primary key.
Related
I have 2 or more base tables representing subtype entities. The records in these are mutually exclusive - no intersection. I want to create a materialized view which represents the supertype entity. Can this be done in Netezza using a UNION ALL in the create of the view?
Can this be done in Netezza using a UNION ALL in the create of the view?
Yes (via a "CREATE VIEW")
I want to create a materialized view
In Netezza, a "CREATE MATERIALIZED VIEW" is for a single table.
Good day,
Is it technically possible to create a materialized view against a another view in the master database (as opposed to a solid table)?
My DBA advises that oracle does not allow creation of materialized view logs against a view. IMO a view is pretty much the same as a table, so it ought to be possible.
Has anyone ever done this successfully (Oracle 11g).
The documentation is pretty clear about this:
Restrictions on Master Tables of Materialized View Logs
The following restrictions apply to master tables of materialized view logs:
You cannot create a materialized view log for a temporary table or for a view.
You cannot create a materialized view log for a master table with a virtual column.
A view is not pretty much the same as a table. It's a stored query, so it has no storage and DML is only possible through instead-of triggers. It doesn't have the basis for noticing an underlying data change.
Just thinking about it, in order to support a view log - even for a simple single-table view - an update to the view's base table would have to check if there were any views; check if any of those had materialized view logs; and then work out if the change needed to be logged - which would mean executing each view's query and looking at the entire result set. Imagine doing that for every change to the underlying table. And then imagine a more complicated view query, with aggregates or multiple tables, etc.
You'd effectively be materialising the view query to decide whether was a change that needed to be logged, to update an actual materialized view. This is partly what actual materialized views do - stop you having to repeatedly re-execute an expensive view query by tracking changes on the master table(s).
You have to create the materialized view logs on the (normal) view's base tables.
I'm new to oracle and materialized views. I have created a view for data that was producing a big bottleneck in our application. For reducing the complexity of the virtual view, the data were divided in respective part virtual views reflecting some business domain. I.e. the main virtual view which I want to use for the materialized view contains data joined from the part virtual views.
My question is, if I can create a materialized view from the main virtual view. Forther, II would like the data updated by each commit.
create materialized view log on main_view;
create materialized view main_view_mv refresh fast on commit
as select col_1 from main_view;
commit;
Is it possible to create the materialized view? Are these commands OK to refresh the materialized view?
Thnaks for the any hint.
To answer your question: no, you can't create materialized view logs on a view - only on tables. The requirements for a FAST refreshable materialized view are described in this answer
Materialized views aren't a magic tool to make slow views execute fast. You'll probably have to examine why the main view is slow.
May I know the difference for these two items?
Data in materialized view can be refresh but so as view when we use select statement. Why not just use view instead of materialized view?
When you need performance on data that don't need to be up to date to
the very second, materialized views are better, but your data will be
older than in a standard view.
While creating Materialized view Oracle creates two objects, a table where the results are actually materialized and a materialized view that has all the metadata (the query, the attributes, etc.).
But while creating View Oracle creates only one object, which has all the metadata(the query, the attributes, etc.)
You use materialized views for performance reasons mainly.
According to the Oracle docs:
A materialized view is a replica of a target master from a single point in time.
A regular view loads data 'on demand' and can 'automatically' change when the underlying data changes.
I have the following issue.
1. I created an Oracle Materialized View which contains the "WITH PRIMARY KEY" clause.
2. when I am trying to add that View to my EDMX, I encounter the following error:
"The table/view 'XXX' does not have a primary key defined and no valid primary key could
be inferred..."
Does anyone know how to add a primary key to Materialized View that can be added to EDMX?
Is this issue solvable ?
thanks,
Hagai
This clause refers to the materialised view including a primary key column from the master table, not that it possesses a primary key itself.
A materialised view is simply metadata on a regular (base) table, so you can perform an alter table command using the name of the the materialised view to create a primary key on the base table.