Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

VIEW performance advantage/disadvantage?

 
   Database Help (Home) -> DB2 RSS
Next:  Linked Table to AS/400 Member within a File  
Author Message
shorti

External


Since: Nov 26, 2007
Posts: 13



(Msg. 1) Posted: Fri Dec 19, 2008 10:06 am
Post subject: VIEW performance advantage/disadvantage?
Archived from groups: comp>databases>ibm-db2 (more info?)

We are using db2 v8.2 on AIX

Would using a VIEW for the sole purpose of only needing to look at one
table to get data make sense?

If you have three tables T1, T2, T3 that contain 2 columns each that
you need to constantly query is it better to use a VIEW or to just use
a regular SELECT for performance purposes?

i.e : SELECT T1.col1, T1.col2, T2.col1, T2.col2, T3.col1, T3.col2
from T1, T2, T3 WHERE T1.col1 IN (SELECT col2 FROM T2 WHERE col3 = 5
AND col4 = 'N' AND col5 = col6 AND col5 = T3.col1 and T3.col4 = 'N')
AND .....


Versus setting up a VIEW for the 6 columns in the 3 tables then using
a similar


Or..maybe there is another suggestion.

 >> Stay informed about: VIEW performance advantage/disadvantage? 
Back to top
Login to vote
Mark A

External


Since: Aug 29, 2008
Posts: 52



(Msg. 2) Posted: Fri Dec 19, 2008 2:55 pm
Post subject: Re: VIEW performance advantage/disadvantage? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"shorti" wrote in message

> We are using db2 v8.2 on AIX
>
> Would using a VIEW for the sole purpose of only needing to look at one
> table to get data make sense?
>
> If you have three tables T1, T2, T3 that contain 2 columns each that
> you need to constantly query is it better to use a VIEW or to just use
> a regular SELECT for performance purposes?
>
> i.e : SELECT T1.col1, T1.col2, T2.col1, T2.col2, T3.col1, T3.col2
> from T1, T2, T3 WHERE T1.col1 IN (SELECT col2 FROM T2 WHERE col3 = 5
> AND col4 = 'N' AND col5 = col6 AND col5 = T3.col1 and T3.col4 = 'N')
> AND .....
>
>
> Versus setting up a VIEW for the 6 columns in the 3 tables then using
> a similar
>
>
> Or..maybe there is another suggestion.

If you use a view it could take slightly longer (but barely measurable) to
compile the SQL, but if your dynamic statements are cached (or they use
static SQL in a package) then there is no performance difference at all.

 >> Stay informed about: VIEW performance advantage/disadvantage? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Views & performance - Hi, simple question I have 2 hugge tables Table A and Table B. I define a view over these 2 tables (select,..joint,...) My question is: Does the DB2 runs the query every time that I access the View? or only the first time that I create the view. Is th...

HADR performance issue - Hi, I have setup a HADR between two servers in different locations. When I compare the application response time in standard environment and in HADR environment, I find the latter is more than twice slower than the former. I have tried to tune some..

performance of db2 7 on mainframe - hello, I'm having a performance issue with a Windows CLI/ODBC application that connects to a DB2 rel 7.1 on a mainframe of a bank. I have to say I'm pretty new with this kind of environment. The application is working, but it is much slower than when I..

Performance Goals for DBAs - I would like to know what would be some performance goals for DBAs ? I can think of customer satisfaction and database availability being some. What else can I have as performance goals for my DBAs and more important what can I have as some stretch goals...

DB2 Performance Monitor. - I am working on DB2 Performance optimizaton and I came across a very good freeware tool for DB2 that monitors DB2 performance. It executes dynamic snapshots against a DB2 database and then formats and displays the data in a very snappy GUI written in C...
   Database Help (Home) -> DB2 All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]