Fork me on GitHub

Hi! Quick question: is there a soft guarantee that results from a datalog query or pull expression will always come back in the same order if the query is executed on the same DB?


I am not familiar with the internals of Datomic/the datalog execution engine


This doesn’t have to be a hard guarantee. Basically I am wondering if I could build cursor pagination on top of datomic by using a (tx-id, index) pair as cursor


The tx-id would be used to get back the db at the point where the request was originally made, and the index would be the index in the result set


I don’t need those cursors to work forever; I would likely set a short expiry on them (since querying an old point in time in a Datomic db can be problematic for a variety of reasons; schema changes, etc)


If result is a set, likely will always be in same order because hashing the same


(Assuming set has same values: since queries can call arbitrary fns is not guaranteed)


But if use aggregation probably all bets are off


Hi! Quick question: is it OK performance-wise to use :db.unique/value a lot? In my application it seems that quite often when :db/isComponent true is used it makes sense to also declare the attribute as unique