3 ms·
I'm a big fan of Datomic and am interested to see how people will apply it. One thing that fascinates me is that Datalog (the query language of Datomic and a p
by juliangamble 13y ago
I'm a big fan of Datomic and am interested to see how people will apply it.
One thing that fascinates me is that Datalog (the query language of Datomic and a precursor to SQL) doesn't have negation. (ie in an SQL query you can use the NOT operator in your WHERE clause - but you don't have the equivalent in Datomic datalog at present). It seems to be a low priority feature.
https://groups.google.com/forum/#!topic/datomic/UBWzp4nYOMk https://groups.google.com/forum/#!topic/datomic/UBWzp4nYOMk
They very gently touch on this in the rationale page:
Datalog with negation is of equivalent power to relational algebra with recursion.
Which seems to suggest you don't need it.
http://www.datomic.com/rationale.html http://www.datomic.com/rationale.html
- jamii 13y agoNegation is a pretty common addition to datalog, along with group-by, max, min and other non-monotonic operators. It merely requires stratification. http://webdam.inria.fr/Alice/pdfs/Chapter-15.pdf http://webdam.inria.fr/Alice/pdfs/Chapter-15.pdf
- cgag 13y agoThis looks cool, I'll have to check this book out. For people who are interested, this is from Foundations of Databases (http://www.amazon.com/Foundations-Databases-The-Logical-Level/dp/0201537710/ref=cm_lmf_tit_11 http://www.amazon.com/Foundations-Databases-The-Logical-Leve...) and is available for free at the root url from jamii's link. edit: realized it's a referral link, it's not mine, it's because I got there through Rich Hickey's list of books that influenced clojure: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH
- dustingetz 13y agoYou don't need it because since reads don't touch network you can run multiple queries with JVM code interspersed wth no network cost. So in your example you can query two sets seperately and do a set difference in your app process. Doing it in app process scales horizontally, doing the same thing in the database process (like SQL) scales vertically. So if they were to implement this in datalog, per my understanding they would probably be doing it in your process anyway.
- stuarthalloway 13y agoWe (Cognitect) appreciate the power of negation, and it has always been part of the plan. From a priority perspective, negation doesn't open categoric new possibilities for our customers in the way that excision, or the log API, or a new storage option does. But we will get there.