JanusGraph / JanusGraph/janusgraph
Improve Index cache lookup
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
Sometimes a workaround should look for uncommitted vertices within a transaction. To do this, we use the index cache. The first condition, which has the corresponding composite index, is used as the key to search the cache.
`StandardJanusGraphTx.java`
``` java
private PredicateCondition getEqualityCondition(Condition condition) {
...
for (final Condition child : condition.getChildren()) {
final PredicateCondition p = getEqualityCondition (child);
if (p! = null) return p;
}
...
}
```
Thus, if the selected index is not selective (i.e., it returns too many elements), then a cache search is not optimal.
I think that we need to iterate over all indexed keys and choose a more suitable one to search in the cache.
Contributor guide
Research direction
Start in StandardJanusGraphTx.java at getEqualityCondition and trace how its returned PredicateCondition is used for index-cache lookup. Review the indexed-key selection and cache behavior for transactions with uncommitted vertices; done means the lookup can consider all relevant indexed keys and avoid relying on a non-selective first condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100