Fork me on GitHub
#datomic
<
2017-09-22
>
PB15:09:43

There might not be a good answer to this. The datomic result set, is it ordered in any way?

favila15:09:50

queries that don't use aggregation (i.e. those whose result would be a set) will have a stable order for the same input

favila15:09:20

this is just because the order of sets is stable (based on hash code)

favila15:09:52

but queries that use aggregation I'm not sure you can rely on repeatable order because they may perform some parts of the aggregation in parallel, and the result is an ArrayList

favila15:09:34

So basically, no, there is no order you can really depend on. datalog operates in a set-wise fashion

hmaurer16:09:17

@favila is it stable “forever”, or only within a certain time window?

favila17:09:50

If the result set is the same (same values in it, all hashing the same) and the collection implementation is the same (uses same hashing algorithm, etc) then it's likely the same

favila17:09:23

The further you get from immediately rerunning the same query in the same process, the weaker the guarantee

favila17:09:43

IOW I think it is foolish to depend on a stable order for anything non-trivial

favila17:09:14

order is not part of the contract of d/q