datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
lxsameer 2018-11-29T19:38:04.038900Z

hey folks, I'm a bit confused about datascript indexes. is it actually store all the datums in the index nodes ?

2018-11-29T20:05:08.039400Z

Yes @lxsameer. Not only that, it stores them all at least 3 times because there are 3+ indexes.

lxsameer 2018-11-29T20:06:15.039800Z

like eavt and aevt and ...

lxsameer 2018-11-29T20:06:15.040Z

?

2018-11-29T20:10:58.041Z

Yes

2018-11-29T20:11:17.041300Z

It might be at least 2 times, need to refresh my memory

2018-11-29T20:11:45.041900Z

http://tonsky.me/blog/datascript-internals/ might be interesting to you

lxsameer 2018-11-29T20:12:09.042300Z

absolutely

lxsameer 2018-11-29T20:12:12.042600Z

thanks

lxsameer 2018-11-29T20:12:19.042900Z

also are you familiar with datahike ?

2018-11-29T20:13:35.043600Z

First time i'm hearing of it, but I'm familiar with 'hitchiker trees'

lxsameer 2018-11-29T20:15:50.044600Z

cool, so it does not make sense to me to store the data in the B+ or hitchhiker tree index nodes 3 times

lxsameer 2018-11-29T20:16:04.045Z

for datascript it makes sense since it is memory base

lxsameer 2018-11-29T20:16:19.045400Z

but does it make sense for a storage base tree ?

2018-11-29T20:17:29.045900Z

No, I bet its the same in datahike. Datomic also stores the atoms in the index nodes, multiple times.

2018-11-29T20:17:45.046300Z

It's a trade off between storage (cheap) and performance

lxsameer 2018-11-29T20:19:17.047500Z

so all of them store the datums on the index nodes as well

2018-11-29T20:19:32.047800Z

Yep

lxsameer 2018-11-29T20:19:55.048400Z

thank you so much man , you clarified lots of my confusions

👍 1