Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why is the cache not used when querying vertices through an index? #2713

Unanswered
xulzee asked this question in Q&A
Discussion options

for example :

g.V().hasLable("server")
it will use indexQuery

g.V('1:xx').bothE().dedup()",
it will use CachedGraphTransaction

You must be logged in to vote

Replies: 2 comments

Comment options

@xulzee Hello there! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together!

The cache is not used when querying vertices through an index, such as in the query g.V().hasLabel("server"), because this query uses indexQuery, which directly interacts with the index to retrieve the vertices. The indexQuery method is optimized for quick lookups using the index, bypassing the need for caching.

In contrast, the query g.V('1:xx').bothE().dedup() uses CachedGraphTransaction, which benefits from caching mechanisms. This is because such queries involve traversals and deduplication operations that can be optimized by caching previously retrieved data to avoid redundant database accesses. The CachedGraphTransaction class manages caching for vertices and edges, allowing traversal queries to utilize cached data when available, thus enhancing performance by reducing the need for repeated backend queries [1] [2] .

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

You must be logged in to vote
0 replies
Comment options

g.V().hasLable("server")

First, retrieve the vertices from the index, and then look up the vertex attributes from the vertex table. The second step should be able to use caching. Because the second step involves random queries, it’s much less efficient than retrieving data from the cache.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /