Appengine backreferences - need composite index?

Posted by davezor on Stack Overflow See other posts from Stack Overflow or by davezor
Published on 2010-06-11T17:50:39Z Indexed on 2010/06/11 17:52 UTC
Read the original article Hit count: 168

I have a query that is very recently starting to throw:

"The built-in indices are not efficient enough for this query and your data. Please add a composite index for this query."

I checked the line on which this exception is being thrown, and the problem query is this one:

count = self.vote_set.filter("direction =", 1).count()

This is literally a one-filter operation using appengine's built-in backreferences. I have no idea how to optimize this query...anyone have any suggestions? I tried to add this index:

 - kind: Vote
   properties:
   - name: direction
     direction: desc

 - kind: Vote
   properties:
   - name: direction

And I got a message (obviously) saying this was an unnecessary index.

Thanks for your help in advance.

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine