Inner query(b object in this case) is contributing to 50k issue. I need to count the number of records based on type and update the parent object.
A - parent B - child Select id, (select id, type from b) from A; Is returning more than 50k. Parent records are less than hundred. Child records are sometimes more than 50k
We can go with a batch class but I’m confused with the no. of records it processes since i need all the records in the inner query at once. I know that execute method executes 200 records so is it 1 a and 199 b records ?
Since we’re just querying we can use for loop but it’s same case as batch apex.
Please let me know how to achieve this or how the batch apex or for loop query functions in case when using inner queries?