As I mentioned at the end of my first comment. The sql includes the 3 fields :isToday, isThisWeek and isThisMonth" is to create less indexes. If I use the 3 fields each in a sql, then there will be 3 indexes created insead of one.
I heard of that more indexes means more index builing time when create or update an entity. I also know the query with sql "(isToday==true || isToday==false) && (isThisWeek==true || isThisWeek==false) && isThisMonth==true" in fact is 4 sub queries. It is not efficient. But if there is a AnyValue filter, the query with sql " AnyValue (isToday) && AnyValue(isThisWeek) && isThisMonth==true" is exactly one sub query. There are more cases, with a AnyValue filter, ther number of indexes will largely saved. On Jul 15, 4:09 am, Robert Kluin <[email protected]> wrote: > Hi Tapir, > You might want to read the "How Entities and Indexes are Stored" > article from the "Mastering the Datastore" series. > http://code.google.com/appengine/articles/datastore/overview.html > > You might also check out Alfred Fullers next gen queries talk from > Google IO 2010. > http://code.google.com/events/io/2010/sessions/next-gen-queries-appen... > > Robert > > > > On Tue, Jul 13, 2010 at 10:12 PM, Tapir <[email protected]> wrote: > > For example, this query: > > > (isToday==true || isToday==false) && (isThisWeek==true || > > isThisWeek==false) > > && isThisMonth==true > > > in fact contains 4 sub queries: > > > (isToday==true) && (isThisWeek==true) && isThisMonth==true > > (isToday==true) && (isThisWeek==false) && isThisMonth==true > > (isToday==false) && (isThisWeek==true) && isThisMonth==true > > (isToday==false) && (isThisWeek==false) && isThisMonth==true > > > If use the AnyValue filter, only one sub query is needed: > > > AnyValue (isToday) && AnyValue(isThisWeek) && isThisMonth==true > > > BTW, the reason of using one query instead of 4 queries is to decrease > > the number of indexes. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google App Engine" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
