mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

Consider including counts of assertions/retractions in the TxReport #780

Open grigoryk opened 6 years ago

grigoryk commented 6 years ago

In our current explorations of syncing, it's useful to know if a TxReport represents a transaction that did nothing. Currently the only way to do find this out is by querying a transactions table after the fact. A simple way to represent this state would be with a simple flag on the TxReport - but perhaps we'd want to know more information about what a transaction did at some point - hence the counts.

This assumes that we'll be using transactor for syncing purposes beyond initial prototyping.

rnewman commented 6 years ago

Bear in mind that excision will make these counts wrong, and so will rebasing — in both cases they'll be exaggerations. What you're asking for is presence/non-presence in the tx index, which should not be all that expensive. If you want to make that quite efficient, don't store timestamp datoms in the tx log itself — in that case an empty transaction would really be empty.