I was hitting SOQL query limits in my Test class so I thought I'd test things out with some Limits.getQueries() bench-marking.
I replicated the use case that would fire the trigger on 1 Order and looked at the results. The class that handles the trigger starts with just looping through the Orders in the trigger (following best practice, this isn't in the trigger class itself, so it's passed the Order IDs and it's looping through them for some logic).
Anyway, in a loop that just goes through the IDs for some logic and no queries within it, the first pass around, it had 3 queries so far. I figured, ok, something beforehand maybe did that...but then I noticed the debug again, with a higher number. But this loop should only have one Order in it since that's all I updated.
So, I included the Order ID to see why it's grabbing other Orders...but the weird thing is, it's the same ID! The first time with 3, the next time with 17, and then a third time with 35 queries made.
Another bench-mark also happened three times: first with 2 queries, then with 16, then with 34. Clearly, this is happening three times as much as I expect for this one order.
What gives?