Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Practical Use of Views

Status
Not open for further replies.

marcon

Programmer
Aug 30, 2001
21
US
I am a beginner and am writing procedures that will create a view once a month with around 2-5 mil records. This view will be used to consolidate data into smaller tables. Is there a rule of thumb based on "common practices" that I can use in deciding if a table should be created instead of a view?
Let me put it another way.. when do you NOT use views in place of a table?
Any "views" greatly appreciated.
 
Views are based on tables, it aquires the data from tables and format it a different way. Too bad I.T. is not cash business

Luc Foata
Unix sysadmin, Oracle DBA
 
Thanks for the response. I'm sorry I was not clear. From a resource standpoint, when is it impractical to use a view? For example , if a query is based on views, is there a point where the queries should be based on tables to save time? Any general guidelines?
 
Marcon,

Views are made to simplify query. Meaning, if you have a query joining 3 or more tables create a view to simplify everything and does make your query faster. Hope this help...


Oracle8
 
In my experience, making views containing other views will confuse the optimizer and result in slow execution of your queries. The one thing you can't give for your heart's desire is your heart. - Lois McMaster Bujold
 
The main advantage of views was in that they were stored compiled so you may use some time on parsing stage. Bust since Oracle 8 their functionality was significantly improved. You may create triggers to update tables the view is based on. You may also create snapshots, called now "Materialized Views". According to your task I suppose you use materialized views. Normally they are used to eliminate the need in repeating heavy operations, returning the same result (quasy-static). If you have a big table or aset of tables and want to base your queries on some intemediate agregations you may create materialized view that is just a temporary table, storing the agregations you need. Your initial table may contain milions of records but materialized view - only hundreds. You may refresh this materialized view on a regular basis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top