Solved

Performance hit of nested Oracle views

Posted on 2006-07-10
4
690 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 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 250 total points
ID: 17076688
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
ID: 17077718
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
ID: 17078151
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
ID: 17078571
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

730 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