?
Solved

Performance hit of nested Oracle views

Posted on 2006-07-10
4
Medium Priority
?
712 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

752 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