RedisGraph icon indicating copy to clipboard operation
RedisGraph copied to clipboard

Query Relationship by id too slow

Open ChandlerBent opened this issue 3 years ago • 1 comments

GRAPH.QUERY "graph" "match (n) return count(n)"

count(n)
--
199055
GRAPH.QUERY "graph" "match p=()-[r]->() return count(r)"

count(r)
--
159172
GRAPH.QUERY "graph" "match ()-[r:TERMRELATION]->() where id(r)= 159171 return r"

1) 1) "r"
2) 1) 1) 1) 1) "id"
            2) (integer) 159171
         2) 1) "type"
            2) "TERMRELATION"
         3) 1) "src_node"
            2) (integer) 141707
         4) 1) "dest_node"
            2) (integer) 141700
         5) 1) "properties"
            2) 1) 1) "kind"
                  2) "S00000102700000002"
               2) 1) "line_type"
                  2) "solid"
               3) 1) "line_color"
                  2) "#666"
               4) 1) "text_color"
                  2) "#409EFF"
               5) 1) "relation_key"
                  2) "141707_141700_S00000102700000002"
3) 1) "Cached execution: 1"
   2) "Query internal execution time: 1210.553027 milliseconds"

In Neo4j. Query Relationship use time below 15ms by id.

ChandlerBent avatar Aug 24 '22 02:08 ChandlerBent

@LiorKogan I believe the above is pretty clear, we'll need to introduce a scan_by_id operation to handle edges as we do with nodes.

swilly22 avatar Aug 24 '22 05:08 swilly22