Based on what conditions can we decide whether to use a table or a view or a materialized view ?

Questions by Shweta_faqs   answers by Shweta_faqs

Showing Answers 1 - 7 of 7 Answers

rajat dey

  • Feb 21st, 2006
 

hi,1. Security reasons we can use view2. If there is a more transaction in a base table we better chose materialised view for performance 3. Depend upon the situation where we need to refresh the data in specific time interval.

  Was this answer useful?  Yes

Ashok kr. Choubey

  • Mar 4th, 2006
 

Hi All,

Tables we used for entity information physically in our DB.

View is a virtual representation of table data, for security and hiding the table column infor. we used normally view. we uses for Report & MIS purposes for showing the data from more than two table.  

Materalized view is used for remote data access and suitable for transaction related data storage in distributed environment. It stores the data phyisically comparision to normal view. It can refreshes the remote data auto. and forcefully/manually.

--if the refresh mode is Force
dbms_mview.refresh('Ashok_mview')

  Was this answer useful?  Yes

Deepika S Verma

  • Apr 19th, 2006
 

Table is the basic entity in any RDBMS , so for storing data you need table .

for view - if you have complex query from which you want to extract data again and again , moreover it is a standard data which is required by many other user also for REPORTS generation then create view . Avoid to insert / update / delete through view unless it is essential. keep view as read only (FOR SHOWING REPORTS)

for materialized view - this view ia mainly used in datawarehousing . if you have two databases and you want a view in both databases , remember in datawarehousing we deal in GB or TB datasize . So create a summary table in a database and make the replica(materialized view) in other database.

when to create materialized view-

[1] if data is in bulk and you need same data in more than one database then create summary table at one database and replica in other databases

[2] if you have summary columns in projection list of query.

main advatages of materialized view over simple view are -

[1] it save data in database whether simple view's definition is saved in database

[2] can create parition or index on materialize view to enhance the performance of view , but cannot on simple view.

View: If a query is being used again and again then its better to create a view with that query. The query gets stored in database as an object.

Materialized view: When you want you replicate the main data to multiple sites to reduce the load on main server materialized views are used. Materialized view is a way of reducing load on main server and ease of access to local replicated subset of actual data.

  Was this answer useful?  Yes

Radha

  • Jul 14th, 2011
 

We use view to be confidential about the data and to avoid the complexity of a query. But Mviews are used for performance problem, we use mviews for faster execution of a query. But we need to do regular refresh for mviews.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions