Hacker News new | past | comments | ask | show | jobs | submit login

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_... And more about why it is so: 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.




Regardless 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.


To delete all entities should be free. Who cares about indexes? `rm -rf`, done.


In any case, good that something is pointed out that can and will be easily overlooked :)


I deleted all indices referencing those entities before starting the entity deletions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: