简体   繁体   中英

AWS Neptune: More performant to drop Edges before Vertices?

Using - Neptune Engine: 1.0.5.1, Apache Tinkerpop: 3.5.2

My question is in regard to the performance of Vertex removal - it is not about the loading of the Vertices.

We have a cron job that clears out a limited number (1000) of "expired" Vertices.

We get hold of and store the vertices to be removed in a Set.

We then remove these via a gV([vertices]).sideEffect(drop()).next().

This works fine.

All of the Vertices to be removed will have 1 inE and 1 outE.

These Edges obviously get automatically removed when the linked Vertex is removed.

I am wondering though if Neptune (under the hood) would be more performant if we got hold of and removed the Edges first, and then removed the Vertices.

Just wondered if anyone out their (mainly using Neptune, but it is probably a "thing" with other graph databases too) has looked into this and has any hard evidence either way.

Many thanks

As far as using Amazon Neptune - If you are just doing a single threaded drop of 1,000 vertices where each only has one incident edge then what you are doing is fine. If you were dropping thousands (or more) of vertices, in a multi threaded fashion, then dropping the edges first can avoid collisions as different threads may try to get locks on the same object in the database. In such cases, to avoid conflicts, and therefore avoid retries, dropping the edges first can improve performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM