for each tuple deposit do begin for each tuple customer do begin examine pair (d, c) to see if a tuple should be added to the result end end
begin
for each tuple customer do
examine pair (d, c) to see if a
tuple should be added to the result
end
Good buffer management can reduce this considerably.