MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

joins vs looping in a cobol program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
gauthaman_mech
Beginner


Joined: 10 Apr 2005
Posts: 12
Topics: 5
Location: India

PostPosted: Wed Sep 20, 2006 3:04 pm    Post subject: joins vs looping in a cobol program Reply with quote

I have a requirement in which there are 4 tables: Policy, state, location and coverage. The relationship is a polciy can have multiple states and each state can have multiple locations and each location can have multiple coverages.
I want some data from all tables.
The primary condition is that I want only certain coverges, hence my where clause is on the coverage table.
Which one will be better in performance
1. A nested join to get the data, or,
2. A cursor first to get specific coveages and then loop it in the program to get the data from the remaining tables.

My understanding is joins are effective only when the condition is applied on the parent table. If we use a join here I think that first all possible combinations will be feteched from on which the where condition will be applied.
I am correct or a join is always the best option.

Thanks in advance
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group