We have two custom objects - obj1 and obj2. These are related by a custom Id. We need to iterate through obj1, get its relevant records from obj2 based on Id and further query for permission of each object in the user permission table and make external call outs for them. Obj1 has around 5 M records and each record can have around 10K records in obj2. I will be executing this through a batch job. Is there a possibility of hitting any governor limits in this scenario? Following is pseudo-code for execute method of the batch job.
global Database.Querylocator start (Database.BatchableContext BC) {
return Database.getQueryLocator('select id from obj1');
}
global void execute (object1Scope) {
For every object in object1Scope
Fetch all relevant objects in object2
For each object retrieved from object2
fetch permissions from user permission table
Multiple external callouts
update
}