Fork me on GitHub
#datomic
<
2019-02-02
>
johanatan02:02:36

what's the best way to reconcile "across time" queries to singular points in time across that series? i.e., return values adhering to relations at they existed at single points in time across large swaths of time. is the best we can do: create as-of snapshots across all of time (i.e., at each tx-id) and run the query against each of those? or is there something that can be done with a join/filter involving ?tx and :db/txInstant in a historical query?

johanatan02:02:58

my naive approach is essentially resulting in a cross-join of all values of particular entity x with all values of attribute of related entity y across all of time (which is obviously not what I need).

favila05:02:27

Is your puzzlement about doing all of this in a query?

johanatan05:02:32

@favila my problem is that a join (on a d/history db) seems to join across all of time; i.e., all attr A for entity Y values related to entity X that occur after X comes into existence are returned. a la a "cross join". I want to get attr A for related entity Y at each consistent point in time across all of history (preferably in a single query without mapping over each transaction ID and doing as-of on each tx-id [which would be very costly]). does that make sense?

favila05:02:27

I’m not sure what you mean by “reconcile to single points in time”

johanatan05:02:32

@favila my problem is that a join (on a d/history db) seems to join across all of time; i.e., all attr A for entity Y values related to entity X that occur after X comes into existence are returned. a la a "cross join". I want to get attr A for related entity Y at each consistent point in time across all of history (preferably in a single query without mapping over each transaction ID and doing as-of on each tx-id [which would be very costly]). does that make sense?