IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Query which uses union all in a program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
divya_maddi

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Thu Jul 05, 2007 1:21 pm
Reply with quote

We are using a query which uses union all in a program which fetches some millions of records. Since we are looking at CPU usage reduction, is there any alternative to the union all in the following scenario?

table 1 has a column say decide_table. and table 1 has two child tables table 2 and table 3. If decide_table has the value 'table 2', the child row is in table 2 and if it has the value 'table 3', the child row is in table 3.

Hence we are using a union all for table 2 and table 3 so that the row is fetched from the corresponding child table. Is there a better way of handling this scenario?
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Jul 05, 2007 10:46 pm
Reply with quote

Post your full query and the available indexes in those tables, somebody will try to help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts RC query -Time column CA Products 3
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top