> I am curious, are there any 'developer tricks' for influencing when old > slots are reused? For example, instead of adding the new relationships > immediately after deleting old ones, but keeping a cache of 'relationships > to add' and adding them a little later. Will that increase the chance of old > slots being reused?
My understanding is this: An id for every record and, correspondingly, a number of bytes in the file, are reserved the moment that, during a tx, a new entity is created. Conversely, the id of an entity is freed upon successful commit() of the tx that deleted it, although the space is still occupied but marked as free and available to be returned at the next request for a new entity. Note that all these operations have entity type scope, meaning that a freed Node does not in any way influence Relationship operations. The above lead to a strategy of performing and committing any deletes first and then, in a new tx, create all that is needed. If, during the same tx, a delete is made and then a create, the deleted id is not reused. > I think this is relevant to cases where the developer wants to keep the > database reasonably compact but does large amounts of deletion and creation. I think there was a similar discussion here some time ago and I seem to recall that the proposed solution for compacting a db after a long streak of deletes/inserts was to recreate the db in a new location. Hope that helps somewhat. cheers, CG _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user