Hi S. Sriram,

Great question. For the query that you've listed above, no, exploding
indexes should not be a problem. Since you are using = filters, the query
can be done using single property indexes and merge join (which is handled
for you). Note that if the data is too sparse (too many rows scanned without
finding results), the merge-join query may quit and instruct you to use a
custom index instead.

http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Defining_Indexes_With_Configuration

This specific query would not require it's own composite index. However, if
this query also had an oder clause or an inequality filter, a composite
index would be required. In a composite index, multiple equality filters on
the same property require multiple columns in the index for the property (so
"words=1, words=3, words=5" will match a single row), and therefore the
index will explode.
Thank you,

Jeff

On Sat, Apr 11, 2009 at 12:21 PM, molicule <[email protected]> wrote:

>
> Hi,
>
> If I have
>
> class MyModel(db.Model):
>     field1 = db.StringProperty()
>     field2 = db.StringProperty()
>     ......
>     words = db.StringListProperty()
>
> and one of the rows has
> field1 = "f1"
> field2" = "f2"
> words =["list", "with", "five", "hundred", "words"]
>
> and query (a)
> query = MyModel.all().filter("field1 =", "f1").filter("field2 =",
> "f2").filter("words =", "with").filter("words =", "five").filter
> ("words =", "words").fetch(10)
> which should return the row above
>
> or query (b)
> query = MyModel.all().filter("field1 =", "f1").filter("field2 =",
> "f2").filter("words =", "with").filter("words =", "five").filter
> ("words =", "notinlist").fetch(10)
> which should return no rows.
>
> Would such a query result in an "exploding index" ?
>
>
> Thanks
> S. Sriram
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to