What's the recommended way of doing pagination with datalevin? Are :limit and :offset performance footguns?
results are spilled to disk if it is too large.
No. The full results are cached on the first query call, :limit and :offset work off that cached result set.
Could that cause memory issues for large result sets?
(If there's a better/specific channel for asking general datomic-style queries+organization, let me know) In general, are multi-value attributes considered a smell? Like storing a list/JSON in an SQL column, technically supported, but probably indicative that you want another table instead? For example, suppose, among other things, I had a Person entity:
#:person{:name "...", :address "..."}
And I wanted to also store the Cars they own:
#:car{:vin "...", :model "...", :year "..."}
Should I model that relationship as a :car/owner (single-value) attribute, or a :person/cars (multi-value) attribute?In Datalevin, mostly yes. Because Datalevin is optimized for normalized data. The optimizer is very good at finding good join orders. Multi cardinality attributes are not normalized, it will hit slower path in EAV index scan, basically we will be doing Cartesian products while scanning.
So, car/owner is preferred in Datalevin
But a tiny set of multi values hurts less, the convenience can be worth it sometimes.
Perfect, thank you