I’ve read in multiple locations that GAE lifted the 1000 record limit on queries and counts, however, I can only seem to get a count of the records up to 1000. I won’t be pulling more than 1000 queries at a time, but the requirements are such that I need a count of the matching records.
I understand you can use cursors to “paginate” through the dataset, but to cycle through just to get a count seems a bit much. Presumably when they said they “lifted” the limit, it was the hard limit – you still need to cycle through the results 1000 at a time, am I correct?
Should I be using a method other than the .all()/filter method to generate 1000+ counts?
Thanks in advance for all your help!
The behavior of
Query.count()is inconsistent with the documentation when no limit is explicitly specified – the documentation indicates that it will count “until it finishes counting or times out.” GAE Issue 3671 reported this bug (about 3 weeks ago).The workaround: explicitly specify a limit and then that value will be used (rather than the default of 1,000).
Testing on http://shell.appspot.com demonstrates this:
I also see the same behavior on the latest version of the development server (1.3.7) using this simple test app: