JanusGraph / JanusGraph/janusgraph

P.within on an indexed property does not use the index

Open
#643 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

For example, the Gremlin traversal:
```
g.V().has("INDEXED_PROPERTY", P.within("foo", "bar"));
```
takes time linear in the length of the graph, whereas:
```
g.V().has("INDEXED_PROPERTY", "foo");
```
is very fast.

It seems like the former query could use the index to improve performance.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Gremlin traversal with P.within is handled for indexed properties, then compare it with the direct equality lookup described in the issue. Confirm the relevant index path is used for multiple values and measure the traversal against the examples; done means the P.within query no longer scans the graph linearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.