google app engine - At what rate do indexes "explode" in GAE's big table? -
at rate indexes "explode" in gae's big table?
the excerpt documentation below explains collection values, indexes can "explode" exponentially.
does mean object 2 collection values, there index entry each subset of values in first collection paired each subset in second collection? or there index entry each possible pair of values?
example:
entity:
widget:{ mamas_list: ['cookies', 'puppies'] papas_list: ['rain', 'sun'] }
index entry each subset of values in first collection paired each subset in second collection:
cookies rain cookies puppies rain cookies puppies rain sun cookies sun cookies rain sun puppies rain puppies sun puppies rain sun
only index entry each possible pair of values:
cookies rain cookies sun puppies rain puppies sun
exploding indexes excerpt:
source: https://developers.google.com/appengine/docs/python/datastore/indexes#index_limits
an entity can have multiple values same property requires separate index entry each value; again, if number of possible values large, such entity can exceed entry limit.
the situation becomes worse in case of entities multiple properties, each of can take on multiple values. accommodate such entity, index must include entry every possible combination of property values. custom indexes refer multiple properties, each multiple values, can "explode" combinatorially, requiring large numbers of entries entity relatively small number of possible property values. (taken from: )
chris,
you'll have 'exploding index problem' in cases explicitly add index.yaml entry multiple repeated properties, , when objects saved table have many multiple properties.
in example, index.yaml add index?
- kind: widget properties: - name: mamas_list - name: papas_list
if save sample object datastore:
widget(mamas_list=['a', 'b'], papas_list['c', 'd']).put()
there 4 different indexes saved:
['a', 'c'] ['a', 'd'] ['b', 'c'] ['b', 'd']
the whole purpose of adding index allow querying these 2 properties:
widget.query().filter(mamas_list=='a').filter(papas_list=='d').fetch()
you avoid exploding index (not found in sample case), using zig-zag algorithm indexes:
http://www.google.com/events/io/2010/sessions/next-gen-queries-appengine.html
Comments
Post a Comment