datomic

robert-stuttaford 2025-10-29T12:27:46.155679Z

super great job shipping the excision fixes, Datomic team! that must have been a hairy one to test 😄

2
enn 2025-10-29T15:34:17.488359Z

Is it correct that there is no scenario in which adding :db/index true on an attribute of type :db.type/ref can improve query performance, because queries by ref value always use VAET? Is this true even in cases where the cardinality of V is much different (higher) than the cardinality of A ?

favila 2025-10-29T15:42:16.203579Z

being precise as possible: • in a datalog query • in a data pattern clause • if A and V are bound • if A is a ref VAET is always used, never AVET

favila 2025-10-29T15:42:49.550759Z

that doesn't mean you can't use AVET instead, but datalog won't

favila 2025-10-29T15:44:05.214329Z

e.g. [(datomic.api/datoms $ :avet ?a ?v) [[?e]]]

cch1 2025-10-29T15:47:10.798749Z

does that ^ work in cloud?

favila 2025-10-29T15:47:25.566279Z

donno

enn 2025-10-29T15:49:49.770489Z

Thanks, Francis. "in a data pattern clause" - are there other clause types (disjunction, conjunction, rule invocation) where AVET might be used for a ref attr?

favila 2025-10-29T15:50:50.939089Z

the other kinds of clauses are predicates, functions, and rules

favila 2025-10-29T15:51:23.650789Z

predicates and functions can do anything you want, datalog has no insight. So in the e.g. above i'm using a function expression to call d/datoms directly so I have complete control

favila 2025-10-29T15:51:44.483099Z

rules are aggregates of the other clause types, so they don't do anything on their own

favila 2025-10-29T15:52:01.305769Z

so the only thing left is data pattern, which works how I said

1