4 ms·
A GAE datastore delete takes multiple operations because it also updates indexes: 1 entity delete = 2 Writes + 2 Writes per indexed property value + 1 Write pe
by peterknego 15y ago
A GAE datastore delete takes multiple operations because it also updates indexes:
1 entity delete = 2 Writes + 2 Writes per indexed property value + 1 Write per composite index value
All from this page: http://code.google.com/appengine/docs/billing.html#Billable_Resource_Unit_Cost http://code.google.com/appengine/docs/billing.html#Billable_...
And more about why it is so: http://code.google.com/appengine/articles/life_of_write.html http://code.google.com/appengine/articles/life_of_write.html
Well, the OP is just another coder who can't read docs, but can write a blog.
- theli0nheart 15y agoRegardless of how decent Google's AppEngine documentation is, this is indeed a bug. The correct behavior would be to recalculate the indices just once, instead of reindexing after every single delete operation. It then becomes 2*entities + 2*indexed property values + composite index values operations to delete all entities in the datastore, instead of 2*entities + 2*entities*indexed property values + entities*composite index values operations.
- tantalor 15y agoTo delete all entities should be free. Who cares about indexes? `rm -rf`, done.
- easy_rider 15y agoIn any case, good that something is pointed out that can and will be easily overlooked :)
- marram 15y agoI deleted all indices referencing those entities before starting the entity deletions.