[das/#106] Change patterns and templates indexes to store handles only rather than handles+targets #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use 5 indexes in AtomDB. Names, incoming set, outgoing set, type templates and patterns.
All of them are hash tables mapping from handles to values. Values are different deppending on the type of the index. The former 3 indexes map handle->List[Handle] (list of handles) while the later 2 map handle->List[Tuple[Handle, [Tuple[Handle]]]] (list of tuples (handle, targets) with the handle and the targets pod the mapped links.
Mapped link targets are stored in the last two indexes for the sake of performance in the pattern matcher query algorithm.
In the scope of the integration of the cache in the query engines, this optimization is no longer required, thus we want to simplify the API and store handle->List[Handle] for ALL indexes. This is what this PR is about.
This PR changes the AtomDB to consider a mapping of Handle->List[Handle] in the templates and in the pattern indexes.
This change is coupled with changes in the meta parser and the query engines in order to keep compliance.
SIDE EFFECT CHANGE: as a side effect of these changes, ORDERED_LINKS references (as well as is_ordered() calls) have been removed.