I want to store the IDs children returned in the first time in a temporary variable in the second stage, this variable will be used to retrieve other children pages with another keyword but they are not returned in the first stage
I don't understand how you can retrieve children that were not retrieved in the first pass by storing the IDs of children that were. I also don't see why you need two passes, since you should be able to add to line 6 of Treigh's example and get all the resources you want in one pass.
In any case, a dedicated snippet would be a lot faster, but we'd need to know more about what is supposed to happen in these two passes (for example, are all the resources to be mixed in one list, or presented in two separate lists?).
Also, a couple of questions about the TV values:
1. Are any of the TVs set to their default value (it's faster if none are).
2. Can you use the raw values of the TVs for your search without processing them? (It's faster if you can.)