Fork me on GitHub
#datomic
<
2017-08-12
>
hmaurer00:08:36

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?

hmaurer00:08:53

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

hmaurer00:08:49

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

hmaurer00:08:23

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

hmaurer00:08:19

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)

favila02:08:02

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

favila02:08:49

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

favila02:08:12

But if use aggregation probably all bets are off

hmaurer23:08:33

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