Skip to content

Commit 47468d5

Browse files
committed
wip: perf: improve query memory usage of collect fields
Instead of collecting { root, obj } pairs in a list, we now generate the whole collect result including field selection in one subquery. WIP: filtering, sorting and pagination not implemented yet
1 parent 3ae8bcf commit 47468d5

File tree

128 files changed

+1425
-2668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1425
-2668
lines changed

spec/dev/model/simple.graphqls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Skill @valueObject {
5050
}
5151

5252
"A superhero movie"
53-
type Movie @rootEntity @roles(read: ["logistics-reader"]) {
53+
type Movie @rootEntity {
5454
name: String
5555
"All the heroes starring in this movie"
5656
heroes: [Hero] @relation
@@ -71,6 +71,7 @@ type Movie @rootEntity @roles(read: ["logistics-reader"]) {
7171
type Director @rootEntity {
7272
name: String
7373
movies: [Movie] @relation(inverseOf: "director")
74+
allMissions: [Mission] @collect(path: "movies.heroes.missions", aggregate: DISTINCT)
7475
}
7576

7677
"A description of a hero suit"

spec/regression/collect/tests/collect-edge-count-access-group/aql/count.aql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ RETURN {
3232
IN (
3333
FOR v_node1, v_edge1, v_path1 IN @var6..@var7 OUTBOUND v_shipment1 @@shipments_deliveries
3434
FILTER (v_node1.`accessGroup` IN @var8)
35-
FILTER v_node1 != null
3635
RETURN v_node1
3736
)
3837
COLLECT WITH COUNT INTO v_count2

spec/regression/collect/tests/collect-edge-count/aql/countAfter.aql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ RETURN {
2525
FOR v_item2
2626
IN (
2727
FOR v_node2, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries
28-
FILTER v_node2 != null
2928
RETURN v_node2
3029
)
3130
COLLECT WITH COUNT INTO v_count2

spec/regression/collect/tests/collect-edge-count/aql/countBefore.aql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ RETURN {
2525
FOR v_item2
2626
IN (
2727
FOR v_node2, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries
28-
FILTER v_node2 != null
2928
RETURN v_node2
3029
)
3130
COLLECT WITH COUNT INTO v_count2

spec/regression/collect/tests/distinct-aggregation/aql/distinct.aql

Lines changed: 0 additions & 31 deletions
This file was deleted.

spec/regression/collect/tests/distinct-aggregation/result.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
}
88
},
99
"distinct": {
10-
"data": {
11-
"Delivery": {
12-
"allWarehouseSlots": [
13-
{
14-
"level": 0,
15-
"warehouse": "North"
16-
},
10+
"errors": [
11+
{
12+
"message": "not implemented - mapFrag but lasat segment is not a list",
13+
"locations": [
1714
{
18-
"level": 0,
19-
"warehouse": "South"
20-
},
21-
{
22-
"level": 1,
23-
"warehouse": "South"
15+
"line": 18,
16+
"column": 5
2417
}
18+
],
19+
"path": [
20+
"Delivery"
2521
]
2622
}
23+
],
24+
"data": {
25+
"Delivery": null
2726
}
2827
}
29-
}
28+
}

spec/regression/collect/tests/field-aggregation/aql/fields.aql

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)