Hi,

Assuming the app runs on an HR database and that the number of indexes
is not a problem:

Say that because of the data model, these queries are equivalent (i.e.
return the exact same results), which one should be used to get the
best performance?

query = db.GqlQuery("SELECT * FROM Photo WHERE ANCESTOR IS :1 AND
prime = TRUE ORDER BY timestamp DESC", self.user.key())

query = db.GqlQuery("SELECT * FROM Photo WHERE ANCESTOR IS :1 AND
initialized = TRUE AND prime = TRUE ORDER BY timestamp DESC",
self.user.key())

Does the response change if somewhere else in the code, there is also
this query (because of shared indexes or something)?

query = db.GqlQuery("SELECT * FROM Photo WHERE ANCESTOR IS :1 AND
initialized = TRUE ORDER BY timestamp DESC", self.user.key())

Same question, this time with these 2 other queries:

query = db.GqlQuery("SELECT * FROM Photo WHERE event = :1 AND prime =
TRUE AND hidden = FALSE ORDER BY timestamp DESC", event.key())

query = db.GqlQuery("SELECT * FROM Photo WHERE ANCESTOR IS :1 AND
event = :2 AND prime = TRUE AND hidden = FALSE ORDER BY timestamp
DESC", event.key().parent(), event.key())

I understand the 2nd version is an ancestor query which should return
consistent results (right?) but in this case, it's ok if the results
are a bit stalled.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to