473,480 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Views Efficiency

How efficient is ti to use join views in a database?

I'm developing an e-commerce system and using join views to join the
product, product category and product review tables and wondering if this
would have any adverse effect on performance.

Thanks in advance
Jul 20 '05 #1
3 3863
Andrew Banks (ba****@nojunkblueyonder.co.uk) writes:
How efficient is ti to use join views in a database?

I'm developing an e-commerce system and using join views to join the
product, product category and product review tables and wondering if this
would have any adverse effect on performance.


Views are essentially macros. That is, there are no query plans
associated with views, so views or direct SELECT statements does
not really make much difference.

There is one exception, and that is you create a clustered index
on the view. In this case the view is materialized, and SELECT:s
against the view are likely to be faster than SELECTs against the
table. The price you pay is that updates takes longer time.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Thanks Erland

"Erland Sommarskog" <so****@algonet.se> wrote in message
news:Xn**********************@127.0.0.1...
Andrew Banks (ba****@nojunkblueyonder.co.uk) writes:
How efficient is ti to use join views in a database?

I'm developing an e-commerce system and using join views to join the
product, product category and product review tables and wondering if this would have any adverse effect on performance.


Views are essentially macros. That is, there are no query plans
associated with views, so views or direct SELECT statements does
not really make much difference.

There is one exception, and that is you create a clustered index
on the view. In this case the view is materialized, and SELECT:s
against the view are likely to be faster than SELECTs against the
table. The price you pay is that updates takes longer time.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 20 '05 #3
FYI

Sometimes when a view is used more then once in a query,
a better plan is generated for the query then when no view is used.

Seems to me, the query optimizer is a bit limited/lazy about realizing
various parts of query are the same. But at least one can use a view
to help the query optimizer come to that realization; upon which,
the query optimizer will consider taking advantage of that fact.

Bye,
Delbert Glass

"Erland Sommarskog" <so****@algonet.se> wrote in message
news:Xn**********************@127.0.0.1...
Andrew Banks (ba****@nojunkblueyonder.co.uk) writes:
How efficient is ti to use join views in a database?

I'm developing an e-commerce system and using join views to join the
product, product category and product review tables and wondering if this would have any adverse effect on performance.


Views are essentially macros. That is, there are no query plans
associated with views, so views or direct SELECT statements does
not really make much difference.

There is one exception, and that is you create a clustered index
on the view. In this case the view is materialized, and SELECT:s
against the view are likely to be faster than SELECTs against the
table. The price you pay is that updates takes longer time.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
4279
by: asj | last post by:
awhile back, eBay decided to switch from a Microsoft/.NET/Windows architecture on the backend to a J2EE one, which might explain why their java backend will handle up to 1 BILLION page views a day!...
8
15211
by: Mike N. | last post by:
Hello: I am new to T-SQL programing, and relativly new to SQL statements in general, although I have a good understanding of database theory. I'm a little confused as to the fundamental...
3
9928
by: dbtoo_dbtoo | last post by:
One of the databases has 50 views and when I do a db2look I only get schema for 40 of them. If I select from the sysviews, I can see all 50 (the text column contains schema for all 10 (missing)...
3
10134
by: KemperR | last post by:
Hello Experts outhere, may be someone can tell me whats going wrong with my ADOX trial. I have an Access 2002 database with some tables and queries (views) The code listed below works well up...
2
1939
by: dbuchanan52 | last post by:
Hello, I am building an application for Windows Forms using. I am new to SQL Server 'Views'. Are the following correct understanding of their use? 1.) I believe a view can be referenced in a...
15
3043
by: rod.weir | last post by:
Fellow database developers, I would like to draw on your experience with views. I have a database that includes many views. Sometimes, views contains other views, and those views in turn may...
33
6602
by: Peter | last post by:
People are telling me it is bad to put select * from <atable> in a view. I better should list all fields of the table inside the definition of the view. I dont know exactly why but some...
335
11424
by: extrudedaluminiu | last post by:
Hi, Is there any group in the manner of the C++ Boost group that works on the evolution of the C language? Or is there any group that performs an equivalent function? Thanks, -vs
7
4637
by: Gary | last post by:
Hello guys! Bear with me, I am a newbie. She is the Data Warehouse manager. She has about 50 users to use the Oracle database from M$ Access via ODBC connection. All those users have only...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6763
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4503
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.