google app engine - Can I save an item to Datastore with 0 write operations on indexes? -
the number of datastore write operations takes persist entity 1 + number of indexes
.
what if update existing entity , indexed fields not changed. how many write operations take? possible save existing item 1 write op. if indexes not affected?
the short answer no. if want search field, needs indexed, , have pay per write. on each entity write, entire entity written, , datastore doesn't know whether changed indexed field or not.
if you're worried costs, can create fields not indexed. unindexed fields not add write ops. however, can't search unindexed fields: http://code.google.com/appengine/docs/python/datastore/queries.html#unindexed_properties
you can manually set property unindexed, write entity, , set indexed again afterwards. practically useless , bunch of effort, , not you're looking for. sounds want use old index, technique blow away index, , particular entity won't indexed (and won't turn in search results), while others of same kind are.
if have field may write lot compared rest of entity, cost conscious thing may break field off own, unindexed entity, , store key in original entity. you'll need db fetch each time though.
edit: original answer incorrect. might have misread question @ time. while cannot create new entity 1 write op, if write existing entity indexed properties not changed, can indeed write 1 write op.
Comments
Post a Comment