Hi
I guess the way two months and the plants get selected is not optimal and takes too much memory and eventually dumps. Have you tried not filtering on the plants? Sometimes not filtering makes the query access even faster. You secondary index might not be ideal for the sql access path
hope it helps
Martin