DB2 V7 on z/OS - Question about view

Aristotle

DB2 V7 on z/OS - Question about view
Hello list,
The problem is kind of big. I try to explain as much
as i can. I have two views A, B with the same
definition. Both are running ok if not very fast. It
is a join with 5 tables accessing 80 mil, 20 mil, 10
mil, 20 mil rows in each table. The access path seems
to be ok and when i query from these two views its ok.
I am getting the result in a quick time. The third
view C has the union of these two with UNION (not
union all) something like this:
create view c (col...) as

select A.* from A, B where a.c1 = b.c1 and a.c2 = b.c2

union
select B.* from A, B where a.c1 = b.c1 and a.c2 = b.c2


for example table a has all in and table b has all out

This third query kind of runs for ever..

will it help if we make one view and refering its
instance one more time to get things done?

say view A select c.. from t1, t2, t3, t4, t5 where
t1.col1 = 'in';

say view B select c.. from t1, t2, t3, t4, t5 where
t1.col1 = 'out';

into something like

say view 1 select c.. from t1, t2, t3, t4, t5 where
t1.col1 in ('in', 'out') ;

and later on i can get go for join with one another..
to check the condition? Will it help?

will GTT can help to hold the data.. but again how we
can use it for a view?

Its a dataware house so lots of data.

I agree the information is not very much in detail.
Any ideas will appreciated very much.

Cheers,
AA.




__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm