Re:SQLite Internals: Pages and B-trees
by infogulch on Wednesday July 27, 2022 @01:48PM
(#32253817)
Commendable attempt! I've considered writing a datalog storage backend on sqlite just like your prototype. Thank you for sharing, now I can lazily study your prototype instead of doing the hard work myself. :) I'm curious, what kinds of limitations of SQLite indexes are you referring to?
[ Parent
| on HN ]
Re:SQLite Internals: Pages and B-trees
by packetlost on Wednesday July 27, 2022 @01:55PM
(#32253955)
Sparse indexes are pretty limited and it only supports B-tree, which make implementing AVET and VAET difficult. Further efficiently finding the current value for a E + A is difficult to do in SQL in a way that doesn't require maintaining a whole copy of the data. I actually bumped up against what I believe are weird edge-case bugs in the SQLite query planner when dealing with sparse indexes as well.
I think I gave up when trying to implement one-many relationships because the SQL was getting too gnarly.