Skip to content

Commit cabecb4

Browse files
Remove unnecessary UNWIND on relationship types (#56)
A relationship has only one type, therefore it is unnecessary to UNWIND the types for each relationship. This fixes #51.
1 parent 91a560e commit cabecb4

File tree

1 file changed

+2
-3
lines changed
  • ui/jetbrains/src/main/java/com/albertoventurini/graphdbplugin/jetbrains/component/datasource/metadata/neo4j

1 file changed

+2
-3
lines changed

ui/jetbrains/src/main/java/com/albertoventurini/graphdbplugin/jetbrains/component/datasource/metadata/neo4j/Neo4jMetadataBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ RETURN labelName, SUM(cnt) AS labelCount
3939

4040
private static final String RELATIONSHIP_TYPES_QUERY = """
4141
MATCH ()-[r]->()
42-
WITH DISTINCT TYPE(r) AS relationshipsTypeNames, COUNT(r) AS cnt
43-
UNWIND relationshipsTypeNames AS relationshipTypeName
44-
RETURN relationshipTypeName, SUM(cnt) AS relationshipTypeCount
42+
WITH DISTINCT TYPE(r) AS relationshipTypeName, COUNT(r) AS relationshipTypeCount
43+
RETURN relationshipTypeName, relationshipTypeCount
4544
""";
4645

4746
private static final Logger LOG = Logger.getInstance(Neo4jMetadataBuilder.class);

0 commit comments

Comments
 (0)