I'm attempting to debug a performance issue I'm having with AWS Neptune. I am running some Gremlin queries and they seem to always result in 30 requests on the database. I'm wondering if I've done something wrong in my query.
The strange thing about this issue is that is occurring all of a sudden. Previously, this was working totally fine and we weren't having performance issues.
Each call I do has two general queries, one for nodes and one for edges:
nodes = g.V(id).emit().repeat(__.out('manages')).dedup().project('label', 'name', 'job', 'department', 'manager').\
by(__.id()).by('name').by('job').by('department').by('manager').toList()
id_list = list(map(lambda node: node["label"], nodes))
edges = g.V(id).emit().repeat(__.out('manages')).dedup().bothE('similar_to').dedup().\
where(__.and_(__.inV().has(T.id, P.within(id_list)), __.outV().has(T.id, P.within(id_list)))).\
project('from', 'to', 'similarity').by(__.outV().id()).by(__.inV().id()).by('similarity').toList()
Essentially, I have two edge types: manages and similar_to. I try to create a tree using the 'manages' edges, and then find all 'similar_to' edges within that tree.
This query gives the desired result, but is it unoptimized?