mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

Use non-unit cache lookups in queries #583

Open fluffyemily opened 6 years ago

rnewman commented 6 years ago

Right now we'll use cached values if there's only one — a mapping from a value to a single entity, or an entity to a single value. That's great for most uses (reverse lookup in particular), but it means a query can drop from using the cache to not doing so simply by adding a new datom.

We use the cache by direct substitution. To use the cache more would require one of several things:

The big question with each of these is whether it's quicker to do extra work to avoid having our very fast SQL query system do the work. My guess is no, but we'll see.