Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Performance hit of nested Oracle views

Posted on 2006-07-10
4
Medium Priority
?
731 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 1000 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

636 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