Although I had absorbed the index logic long ago, I was pretty paralyzed after reading these 2 articles once again: https://developers.google.com/appengine/docs/python/datastore/indexes#Python_Index_definition_and_structure https://developers.google.com/appengine/articles/indexselection Especially the second one is a gem
I had accepted the fact that I was okay with 2000+ write operations (index number) - however while rewriting the codebase with transaction/index related improvements, I decided to re-visit my index structure too There are some repeated properties I have that are either "a"/"b" or just existent/non existent homogenously Basically 50% is "a", 50% is "b" etc, I've decided to pull them out of composite indexes to reduce write operations, seems like a safe/obvious move However there are also instances with such configurations: Model_name - repeated_property [80] - tag [0-10] - sort_order DESC When there are 10 tags, the write operations become 10x80 = 800 - pretty costly considering sort_order also gets updated from time to time, all those updates cost 800 Both "repeated_property" and "tag" are extremely diverse, "tag" is a random string, "repeated_property" has billions of values A possible reduction for zig-zag indexing could be: Model_name - repeated_property [80] - sort_order DESC Model_name - tag [0-10] - sort_order DESC It reduces the index number from 800 to 90 However I'm not sure zig-zag merging could handle the above scenario As none of the index's results are anywhere close to the actual result itself --- My second is question is a pretty short one, it's kind of like a confirmation, I'm 99% sure, but not 100% sure Would the situation be any different if sort_order was ASC? Model_name - repeated_property [80] - tag [0-10] - sort_order I think the above index would still be needed, so there won't be any difference --- I should do some more testing and watch this too :) http://www.google.com/events/io/2010/sessions/next-gen-queries-appengine.html I'm not sure I got the zig-zag logic properly -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
