I think I have narrowed the problem down to differences in 
query behavior between the local dev SDK and production appspot. (FYI -- I 
have used SDKs starting at 1.3.1 through 1.7.2.) Here's what I've found: 

Via the local dev_server, if you execute a python api query using a filter 
for a string property set to an empty string, and the local datastore does 
not contain a match (because they have string values with lengths > 0) then 
the query will return with no results, just as one would expect. 

However, if you execute the same query via production appspot on an exact 
copy of the data, then one of the following results will occur:

1) The query will never finish and after running for several hours will 
consume all the datastore read quota until it crashes due to a lack of 
quota. Typically, the error message will be: 

google.appengine.runtime.apiproxy_errors.OverQuotaError: The API call 
datastore_v3.RunQuery() required more quota than is available.


2) The query will crash due to a time-out error. Typically, the error 
message will be:

urllib2.URLError: <urlopen error (10060, 'Operation timed out')>


If anyone else runs into this problem, here's the solution that (so-far) is 
working for me:

Change the query filter from = '' (empty string) to < ' ' (space 
character). Then order (sort) the query results by that same property. 
Since using an inequality in the filter will not work with the standard 
(hidden) entity indexes, you will need to build custom indexes.

If anyone knows of a better solution, let me know!


 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/zHFg048Vcv0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to