Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excision #95

Open
halgari opened this issue Sep 13, 2024 · 0 comments
Open

Excision #95

halgari opened this issue Sep 13, 2024 · 0 comments

Comments

@halgari
Copy link
Contributor

halgari commented Sep 13, 2024

Datomic has the concept of "Excision" which is a somewhat long process of completely deleting data from all indexes, including history. Datomic's approach to this is a bit complex because the data is stored in a B-tree in many blocks in the database, so an excision involves a re-index of the affected parts of the index. We have a much simpler path in MnemonicDB.

The interface for this operation should simply be conn.Excise(IEnumerable<EntityId> ids). That operation will do the following:

  • for each entity Id
  • pull all datoms from the current index
  • issue a delete call against every current index for each datom found in that first query
  • pull all the datoms from the history index
  • issue a delete call against every history index for each datom found that query
  • issue a delete from the TXLog for every datom found in the other two queries

Since the datoms are stored exactly the same in all idexes (the indexes only sort differently) in MnemonicDB, that's all that is needed to implement this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant