简体   繁体   中英

GAE datastore fetch taking too long?

I have a query which looks like this:

userBase = UserEntry.all().filter('debug =', False).filter('disabled =', False).filter('first_message =', False).fetch(200)

And an index (built and serving)

 - kind: UserEntry   
   properties:
   - name: first_message
   - name: disabled
   - name: debug

There are around 1000 entries in UserEntry, and after filtering out - only 200 which are being fethed.

The problem:

The aforementioned fetch, that single line of code, takes 1,5s to complete. Any ideas why this could be?

My guess is that there might be something wrong with the UserEntry model. It has quite a few properties - but I don't know where to start looking..

Your custom index appears to be in the wrong order; the query is most likely being done by a zigzag merge-join rather than using your custom index. Try filtering the properties in the same order they're in index.yaml .

提取次数太大,请尝试fetch(200)并查看花费了多长时间。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM