How can I determine how many sub-queries are required for a single top-level query on app engine (python)?
I am playing around with the IN
operator, and I am curious if there is any way to be notified if I over-step my 30 sub-query limit.
How can I determine how many sub-queries are required for a single top-level query on app engine (python)?
I am playing around with the IN
operator, and I am curious if there is any way to be notified if I over-step my 30 sub-query limit.
If you try to execute a query which would spawn too many sub-queries then you would get this error:
BadArgumentError: Cannot satisfy query -- too many subqueries (max: 30, got 31). Probable cause: too many IN/!= filters in query.
If you wanted to check before trying to execute the query, you could check the length of the list which you are passing query - as long as it has 30 or fewer elements the query will be okay (as long as you aren't using the !=
operator in the query too; if you are, then each !=
query will double the number of sub-queries that you would otherwise have).