Skip to content

Commit 39ffe53

Browse files
committed
proof of concept for inlining field selection in TraversalQueryNode
order, pagination and filtering still missing, as well as a few other todos
1 parent 7c4be08 commit 39ffe53

File tree

11 files changed

+446
-48
lines changed

11 files changed

+446
-48
lines changed

spec/regression/traversal-performance/test-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default async function init(context: InitTestDataContext) {
1616
key: 'super1',
1717
createRoots: [...Array(10).keys()].map((rootIndex) => ({
1818
key: `root${rootIndex}`,
19-
payload: generateRandomString(1_000_000),
19+
payload: generateRandomString(5_000_000),
2020
children: [...Array(10).keys()].map((childIndex) => ({
2121
key: `child${rootIndex}_${childIndex}`,
2222
})),

spec/regression/traversal-performance/tests/traversal-performance/aql/RelationAndFieldTraversal.aql

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ LET v_super1 = FIRST((
99
RETURN {
1010
"Super": (IS_NULL(v_super1) ? null : {
1111
"rootChildren": (
12-
FOR v_child1
13-
IN (
14-
FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots
15-
FILTER v_node1 != null
16-
RETURN v_node1.`children`[*]
17-
)[**]
18-
RETURN {
19-
"key": v_child1.`key`
20-
}
21-
)
12+
FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots
13+
RETURN v_node1.`children`[* RETURN {
14+
"key": CURRENT.`key`
15+
}]
16+
)[**]
2217
})
2318
}

spec/regression/traversal-performance/tests/traversal-performance/aql/RelationAndFieldTraversalWithParent.aql

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ LET v_super1 = FIRST((
99
RETURN {
1010
"Super": (IS_NULL(v_super1) ? null : {
1111
"rootChildren": (
12-
FOR v_child1
13-
IN (
14-
FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots
15-
FILTER v_node1 != null
16-
RETURN v_node1.`children`[*]
17-
)[**]
18-
RETURN {
19-
"key": v_child1.`key`,
20-
"parent": { __cruddl_runtime_error_code: @var5, __cruddl_runtime_error: @var6 }
21-
}
22-
)
12+
FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots
13+
RETURN v_node1.`children`[* RETURN {
14+
"key": CURRENT.`key`,
15+
"parent": (IS_NULL(v_node1) ? null : {
16+
"key": v_node1.`key`
17+
})
18+
}]
19+
)[**]
2320
})
2421
}

spec/regression/traversal-performance/tests/traversal-performance/result.json

Lines changed: 302 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,316 @@
11
{
22
"RelationAndFieldTraversal": {
3-
"errors": [
4-
{
5-
"message": "AQL: query would use more memory than allowed [node #17: TraversalNode] [node #18: CalculationNode] [node #19: FilterNode] [node #20: CalculationNode] [node #34: SubqueryEndNode] [node #31: SubqueryStartNode] [node #13: FilterNode] [node #23: CalculationNode] [node #24: EnumerateListNode] [node #25: CalculationNode] [node #32: SubqueryEndNode] [node #28: CalculationNode] [node #29: ReturnNode] (while executing)",
6-
"locations": [
3+
"data": {
4+
"Super": {
5+
"rootChildren": [
76
{
8-
"line": 2,
9-
"column": 5
7+
"key": "child9_0"
8+
},
9+
{
10+
"key": "child9_1"
11+
},
12+
{
13+
"key": "child9_2"
14+
},
15+
{
16+
"key": "child9_3"
17+
},
18+
{
19+
"key": "child9_4"
20+
},
21+
{
22+
"key": "child9_5"
23+
},
24+
{
25+
"key": "child9_6"
26+
},
27+
{
28+
"key": "child9_7"
29+
},
30+
{
31+
"key": "child9_8"
32+
},
33+
{
34+
"key": "child9_9"
35+
},
36+
{
37+
"key": "child8_0"
38+
},
39+
{
40+
"key": "child8_1"
41+
},
42+
{
43+
"key": "child8_2"
44+
},
45+
{
46+
"key": "child8_3"
47+
},
48+
{
49+
"key": "child8_4"
50+
},
51+
{
52+
"key": "child8_5"
53+
},
54+
{
55+
"key": "child8_6"
56+
},
57+
{
58+
"key": "child8_7"
59+
},
60+
{
61+
"key": "child8_8"
62+
},
63+
{
64+
"key": "child8_9"
65+
},
66+
{
67+
"key": "child7_0"
68+
},
69+
{
70+
"key": "child7_1"
71+
},
72+
{
73+
"key": "child7_2"
74+
},
75+
{
76+
"key": "child7_3"
77+
},
78+
{
79+
"key": "child7_4"
80+
},
81+
{
82+
"key": "child7_5"
83+
},
84+
{
85+
"key": "child7_6"
86+
},
87+
{
88+
"key": "child7_7"
89+
},
90+
{
91+
"key": "child7_8"
92+
},
93+
{
94+
"key": "child7_9"
95+
},
96+
{
97+
"key": "child6_0"
98+
},
99+
{
100+
"key": "child6_1"
101+
},
102+
{
103+
"key": "child6_2"
104+
},
105+
{
106+
"key": "child6_3"
107+
},
108+
{
109+
"key": "child6_4"
110+
},
111+
{
112+
"key": "child6_5"
113+
},
114+
{
115+
"key": "child6_6"
116+
},
117+
{
118+
"key": "child6_7"
119+
},
120+
{
121+
"key": "child6_8"
122+
},
123+
{
124+
"key": "child6_9"
125+
},
126+
{
127+
"key": "child5_0"
128+
},
129+
{
130+
"key": "child5_1"
131+
},
132+
{
133+
"key": "child5_2"
134+
},
135+
{
136+
"key": "child5_3"
137+
},
138+
{
139+
"key": "child5_4"
140+
},
141+
{
142+
"key": "child5_5"
143+
},
144+
{
145+
"key": "child5_6"
146+
},
147+
{
148+
"key": "child5_7"
149+
},
150+
{
151+
"key": "child5_8"
152+
},
153+
{
154+
"key": "child5_9"
155+
},
156+
{
157+
"key": "child4_0"
158+
},
159+
{
160+
"key": "child4_1"
161+
},
162+
{
163+
"key": "child4_2"
164+
},
165+
{
166+
"key": "child4_3"
167+
},
168+
{
169+
"key": "child4_4"
170+
},
171+
{
172+
"key": "child4_5"
173+
},
174+
{
175+
"key": "child4_6"
176+
},
177+
{
178+
"key": "child4_7"
179+
},
180+
{
181+
"key": "child4_8"
182+
},
183+
{
184+
"key": "child4_9"
185+
},
186+
{
187+
"key": "child3_0"
188+
},
189+
{
190+
"key": "child3_1"
191+
},
192+
{
193+
"key": "child3_2"
194+
},
195+
{
196+
"key": "child3_3"
197+
},
198+
{
199+
"key": "child3_4"
200+
},
201+
{
202+
"key": "child3_5"
203+
},
204+
{
205+
"key": "child3_6"
206+
},
207+
{
208+
"key": "child3_7"
209+
},
210+
{
211+
"key": "child3_8"
212+
},
213+
{
214+
"key": "child3_9"
215+
},
216+
{
217+
"key": "child2_0"
218+
},
219+
{
220+
"key": "child2_1"
221+
},
222+
{
223+
"key": "child2_2"
224+
},
225+
{
226+
"key": "child2_3"
227+
},
228+
{
229+
"key": "child2_4"
230+
},
231+
{
232+
"key": "child2_5"
233+
},
234+
{
235+
"key": "child2_6"
236+
},
237+
{
238+
"key": "child2_7"
239+
},
240+
{
241+
"key": "child2_8"
242+
},
243+
{
244+
"key": "child2_9"
245+
},
246+
{
247+
"key": "child1_0"
248+
},
249+
{
250+
"key": "child1_1"
251+
},
252+
{
253+
"key": "child1_2"
254+
},
255+
{
256+
"key": "child1_3"
257+
},
258+
{
259+
"key": "child1_4"
260+
},
261+
{
262+
"key": "child1_5"
263+
},
264+
{
265+
"key": "child1_6"
266+
},
267+
{
268+
"key": "child1_7"
269+
},
270+
{
271+
"key": "child1_8"
272+
},
273+
{
274+
"key": "child1_9"
275+
},
276+
{
277+
"key": "child0_0"
278+
},
279+
{
280+
"key": "child0_1"
281+
},
282+
{
283+
"key": "child0_2"
284+
},
285+
{
286+
"key": "child0_3"
287+
},
288+
{
289+
"key": "child0_4"
290+
},
291+
{
292+
"key": "child0_5"
293+
},
294+
{
295+
"key": "child0_6"
296+
},
297+
{
298+
"key": "child0_7"
299+
},
300+
{
301+
"key": "child0_8"
302+
},
303+
{
304+
"key": "child0_9"
10305
}
11-
],
12-
"path": [
13-
"Super"
14306
]
15307
}
16-
],
17-
"data": {
18-
"Super": null
19308
}
20309
},
21310
"RelationAndFieldTraversalWithParent": {
22311
"errors": [
23312
{
24-
"message": "AQL: query would use more memory than allowed [node #17: TraversalNode] [node #18: CalculationNode] [node #19: FilterNode] [node #20: CalculationNode] [node #34: SubqueryEndNode] [node #31: SubqueryStartNode] [node #13: FilterNode] [node #23: CalculationNode] [node #24: EnumerateListNode] [node #25: CalculationNode] [node #32: SubqueryEndNode] [node #28: CalculationNode] [node #29: ReturnNode] (while executing)",
313+
"message": "AQL: query would use more memory than allowed [node #14: TraversalNode] [node #15: CalculationNode] [node #22: SubqueryEndNode] [node #18: CalculationNode] [node #19: ReturnNode] (while executing)",
25314
"locations": [
26315
{
27316
"line": 10,

0 commit comments

Comments
 (0)