Solved

Performance hit of nested Oracle views

Posted on 2006-07-10
4
649 Views
Last Modified: 2012-06-27
I am creating a .NET application running off of a Oracle 9.2 database.  I would like to give the users the ability to create views, based either on tables or existing views, through this program.  I have read a bit about the possible performance hits of nesting views and I'm interested in any insight.

Thanks.
0
Comment
Question by:mistaeverly
4 Comments
 
LVL 34

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 250 total points
Comment Utility
The performance hit of nesting views is one thing (and usually not so bad).  The performance hit from ad-hoc views that users can create on-the-fly may be *HUGE*, whether they are nested or not!  If you have no controls on the type of views that get created, then you have no way to predict the performance impact.  There are two big performance issues with ad-hoc views:
1. the parsing overhead for these unique SQL statements
2. the fact that many of these view could be based on non-indexed columns

If you want predictable performance, you will have to control the application, that is: control the SQL statements that get created and executed.  If you want to maximize flexibility though, and give users the ability to create views on-the-fly, forget about predictable performance!

Sorry, but you can't get maximum performance plus maximum flexibility from the same application/database.
0
 
LVL 14

Expert Comment

by:sathyagiri
Comment Utility
If the views that the users will create is going to be temporary u wd be okay.

But if it's going to be retained in the database, then you might run into some nested views which might have some complex joins and unions after a while which may not make any sense.
0
 
LVL 19

Accepted Solution

by:
actonwang earned 250 total points
Comment Utility
Views are essentially sqls. The reason why nested views create a performance hit is NOT because "NESTED" itself that because nested view will easily transfer to more queries with bad performance if they are introduced to generate other ad-hoc queries.

You need to think about advantange and disadvange before you use a vew:

view would:
1.You would expose a subset of data via view.
2.To hide complex query and let user focus on the meaning of view
3.maybe provde more meaningful names for columns
4.achieve some abstraction

but in the same time some inappropriate use of views would make a query slow and hard to tune.

Acton



0
 
LVL 3

Author Comment

by:mistaeverly
Comment Utility
Thanks guys.  I plan on restricting what views are created through some to-be-created interface.  Hopefully I can use this to allow the flexibility of nested views while forcing intelligently-constructed joins.  Easier said than done, I'm sure.  

Some of the things I read on the web made it seem that there was some inherent performance hit with even well-constructed views, so I appreciate the explanations.

Chad
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now