imbajin opened a new issue, #2731:
URL: https://github.com/apache/incubator-hugegraph/issues/2731

   
   ### Discussed in 
https://github.com/apache/incubator-hugegraph/discussions/2720
   
   <div type='discussions-op-text'>
   
   <sup>Originally posted by **haohao0103** January  7, 2025</sup>
   
![image](https://github.com/user-attachments/assets/42cef8e5-e7ba-4504-9582-749b0f477e37)
   According to the current logic, the edgeCache invalidation mechanism is 
triggered by any vertex addition, update, or deletion, as well as any edge 
addition, update, or deletion, resulting in the clearing of the entire edge 
cache. As shown in the image, my expectation is to handle edgeCache 
invalidation differently based on the type of vertex change. From what I 
understand, the edgeCache's cache key is the queryId, such as:
   
   `Query * from EDGE where [OWNER_VERTEX == 2, DIRECTION == OUT OR DIRECTION 
== IN]
   Query * from EDGE where [OWNER_VERTEX == 1, DIRECTION == OUT OR DIRECTION == 
IN]`
   
   This data is sourced from 
CachedGraphTransactionTest#testEdgeCacheClearWhenUpdateVertex.
   
   The queryId in edgeCache is related to the vertex ID and not to the vertex's 
properties. Therefore, vertex addition or update operations should not trigger 
edgeCache invalidation. Is this understanding correct?
   
   For vertex deletion operations, only the edgeCache entries corresponding to 
the relevant queryId should be cleared, rather than clearing the entire edge 
cache. This requires designing a data structure to maintain the mapping between 
vertices and their associated queryIds.
   
   For edge change operations, I do not yet have a clear approach and will 
temporarily maintain the original design.
   
   I welcome any guidance, suggestions, or feedback on this approach. Thank you 
in advance for your input!</div>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to