Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Performance issues with views
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

imtiazp
Starting Member

1 Posts

Posted - 16 March 2006 :  17:22:32  Show Profile
Is it better to use tables instead of views that are build on some other views.

The final query returns only the count(*) by from the views.

In a nutshell, which is better option and why

select count(*) from view join someother views

select count(*) from table join someother table


Thanks
Imtiaz

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 16 March 2006 :  17:40:58  Show Profile  Send ruirib a Yahoo! Message
Whenever you have the possibility to use tables, do that. Tables can have indexes which can contribute to a much better performance of a query. Even though the concept of a indexed view is supported in some DBs, I don't think it can be as effective as table indexing. Views are not a way to optimize performance, they have other purposes. So, IMO, go with tables whenever you can.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 March 2006 :  19:25:26  Show Profile
This is where your problem starts :

quote:
select count(*) from view join someother views


IF you can do it, make all the joins at once, in the view. Using your example code you are doing joins on joins on joins on joins ...... and the tables below that MAY be leading to the slow response times. Views ARE slower, but if you create a table then the data will not be completely up to date. Oracle has a new concept called a materialised view (MV) that acts like a view, but the data still resides on disk and is updated periodically.

Basically, either one is fine if you use it under the correct conditions.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07