R
Ravinath
Guest
Assume there are four tables like GroupH, GroupL, Member, Incident. If I write a nested for each like below,
for each GroupH use-index grouph-id
NO-LOCK,
each GroupL use-index groupl-id
where GroupL.grphid = GroupL.grphid
NO-LOCK,
each Member use-index member-id
where Member.memberid = GroupL.memberid
NO-LOCK,
each Incident use-index incident-key
where Incident.memberid = Member.memberid
NO-LOCK
BREAK BY
Member.memberid
Member.schemid
Member.emplid:
//do something.
end.
What could be the facts that can make my query significantly inefficient in relation to the 'BREAK BY' fields?
Continue reading...
for each GroupH use-index grouph-id
NO-LOCK,
each GroupL use-index groupl-id
where GroupL.grphid = GroupL.grphid
NO-LOCK,
each Member use-index member-id
where Member.memberid = GroupL.memberid
NO-LOCK,
each Incident use-index incident-key
where Incident.memberid = Member.memberid
NO-LOCK
BREAK BY
Member.memberid
Member.schemid
Member.emplid:
//do something.
end.
What could be the facts that can make my query significantly inefficient in relation to the 'BREAK BY' fields?
Continue reading...