-
Notifications
You must be signed in to change notification settings - Fork 615
-
for example :
g.V().hasLable("server")
it will use indexQuery
g.V('1:xx').bothE().dedup()",
it will use CachedGraphTransaction
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
@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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.