1[
2    {
3        "testcase": "Unnest scan with array index key only. Explain",
4        "ignore": "index_id",
5        "explain": {
6            "disabled": false,
7            "results": [
8                {
9                    "present": true
10                }
11            ],
12            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 1 END"
13        },
14        "statements":"SELECT v1 FROM orders AS o UNNEST o.a1 AS v1 WHERE o.test_id = \"ua\" AND v1 = 1",
15        "results": [
16        {
17            "v1": 1
18        },
19        {
20            "v1": 1
21        }
22    ]
23    },
24    {
25        "testcase": "Unnest scan with array index key and additional index keys. Explain",
26        "ignore": "index_id",
27        "explain": {
28            "disabled": false,
29            "results": [
30                {
31                    "present": true
32                }
33            ],
34            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 3 END"
35        },
36        "statements":"SELECT v1 FROM orders AS o UNNEST o.a1 AS v1 WHERE o.test_id = \"ua\" AND v1 = 1 AND o.c1 = 10 AND o.c2 between 90 AND 110",
37        "results": [
38        {
39            "v1": 1
40        },
41        {
42            "v1": 1
43        }
44    ]
45    },
46    {
47        "testcase": "Unnest scan with array index key only. Explain",
48        "ignore": "index_id",
49        "explain": {
50            "disabled": false,
51            "results": [
52                {
53                    "present": true
54                }
55            ],
56            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 1 END"
57        },
58        "statements":"SELECT v2 FROM orders AS o UNNEST o.a2 AS v1 UNNEST v1 AS v2 WHERE o.test_id = \"ua\" AND v2 = 1",
59        "results": [
60        {
61            "v2": 1
62        },
63        {
64            "v2": 1
65        }
66    ]
67    },
68    {
69        "testcase": "Unnest scan with array index key and additional index keys. Explain",
70        "ignore": "index_id",
71        "explain": {
72            "disabled": false,
73            "results": [
74                {
75                    "present": true
76                }
77            ],
78            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 3 END"
79        },
80        "statements":"SELECT v2 FROM orders AS o UNNEST o.a2 AS v1 UNNEST v1 AS v2 WHERE o.test_id = \"ua\" AND v2 = 1 AND o.c1 = 10 AND o.c2 BETWEEN 90 AND 110",
81        "results": [
82        {
83            "v2": 1
84        },
85        {
86            "v2": 1
87        }
88    ]
89    },
90    {
91        "testcase": "Unnest scan with array index key only. Explain",
92        "ignore": "index_id",
93        "explain": {
94            "disabled": false,
95            "results": [
96                {
97                    "present": true
98                }
99            ],
100            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 1 END"
101        },
102        "statements":"SELECT v1.id FROM orders AS o UNNEST o.a3 AS v1 WHERE o.test_id = \"ua\" AND v1.id = 1 AND v1.type = \"n\"",
103        "results": [
104        {
105            "id": 1
106        },
107        {
108            "id": 1
109        }
110    ]
111    },
112    {
113        "testcase": "Unnest scan with array index key and additional index keys. Explain",
114        "ignore": "index_id",
115        "explain": {
116            "disabled": false,
117            "results": [
118                {
119                    "present": true
120                }
121            ],
122            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 3 END"
123        },
124        "statements":"SELECT v1.id FROM orders AS o UNNEST o.a3 AS v1 WHERE o.test_id = \"ua\" AND v1.id = 1 AND v1.type = \"n\" AND o.c1 = 10 AND o.c2 BETWEEN 90 AND 110",
125        "results": [
126        {
127            "id": 1
128        },
129        {
130            "id": 1
131        }
132    ]
133    },
134    {
135        "testcase": "Unnest scan with array index key only. Explain",
136        "ignore": "index_id",
137        "explain": {
138            "disabled": false,
139            "results": [
140                {
141                    "present": true
142                }
143            ],
144            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 1 END"
145        },
146        "statements":"SELECT v2.id FROM orders AS o UNNEST o.a4 AS v1 UNNEST v1.aa AS v2 WHERE o.test_id = \"ua\" AND v2.id = 1",
147        "results": [
148        {
149            "id": 1
150        },
151        {
152            "id": 1
153        }
154    ]
155    },
156    {
157        "testcase": "Unnest scan with array index key and additional index keys. Explain",
158        "ignore": "index_id",
159        "explain": {
160            "disabled": false,
161            "results": [
162                {
163                    "present": true
164                }
165            ],
166            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 3 END"
167        },
168        "statements":"SELECT v2.id FROM orders AS o UNNEST o.a4 AS v1 UNNEST v1.aa AS v2 WHERE o.test_id = \"ua\" AND v2.id = 1 AND o.c1 = 10 AND o.c2 BETWEEN 90 AND 110",
169        "results": [
170        {
171            "id": 1
172        },
173        {
174            "id": 1
175        }
176    ]
177    },
178    {
179        "testcase": "Unnest scan with array index key only. Explain",
180        "ignore": "index_id",
181        "explain": {
182            "disabled": false,
183            "results": [
184                {
185                    "present": true
186                }
187            ],
188            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 1 END"
189        },
190        "statements":"SELECT [v2.id,v1,o.c1] FROM orders AS o UNNEST o.a4 AS v1 UNNEST v1.aa AS v2 WHERE o.test_id = \"ua\" AND [v2.id,v1,o.c1] = [1,{\"aa\":[{\"id\":1},{\"id\":1},{\"id\":2}]},10]",
191        "results": [
192        {
193            "$1": [
194                1,
195                {
196                    "aa": [
197                        {
198                            "id": 1
199                        },
200                        {
201                            "id": 1
202                        },
203                        {
204                            "id": 2
205                        }
206                    ]
207                },
208                10
209            ]
210        },
211        {
212            "$1": [
213                1,
214                {
215                    "aa": [
216                        {
217                            "id": 1
218                        },
219                        {
220                            "id": 1
221                        },
222                        {
223                            "id": 2
224                        }
225                    ]
226                },
227                10
228            ]
229        }    ]
230    },
231    {
232        "testcase": "Unnest scan with array index key and additional index keys. Explain",
233        "ignore": "index_id",
234        "explain": {
235            "disabled": false,
236            "results": [
237                {
238                    "present": true
239                }
240            ],
241            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 1 AND ARRAY_LENGTH(v.spans[0].`range`) = 3 END"
242        },
243        "statements":"SELECT [v2.id,v1,o.c1] FROM orders AS o UNNEST o.a4 AS v1 UNNEST v1.aa AS v2 WHERE o.test_id = \"ua\" AND [v2.id,v1,o.c1] = [1,{\"aa\":[{\"id\":1},{\"id\":1},{\"id\":2}]},10] AND o.c1 = 10 AND o.c2 BETWEEN 90 AND 110",
244        "results": [
245        {
246            "$1": [
247                1,
248                {
249                    "aa": [
250                        {
251                            "id": 1
252                        },
253                        {
254                            "id": 1
255                        },
256                        {
257                            "id": 2
258                        }
259                    ]
260                },
261                10
262            ]
263        },
264        {
265            "$1": [
266                1,
267                {
268                    "aa": [
269                        {
270                            "id": 1
271                        },
272                        {
273                            "id": 1
274                        },
275                        {
276                            "id": 2
277                        }
278                    ]
279                },
280                10
281            ]
282        }
283    ]
284    },
285    {
286        "testcase": "Unnest scan with array index key only, OR clause. Explain",
287        "ignore": "index_id",
288        "explain": {
289            "disabled": false,
290            "results": [
291                {
292                    "present": true
293                }
294            ],
295            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'IndexScan3' AND ARRAY_LENGTH(v.spans) = 2 END"
296        },
297        "statements":"SELECT v1 FROM orders AS o UNNEST o.a1 AS v1 WHERE o.test_id = \"ua\" AND (v1 = 1 OR v1 = 2) ORDER BY v1",
298        "Results": [
299        {
300            "v1": 1
301        },
302        {
303            "v1": 1
304        },
305        {
306            "v1": 2
307        },
308        {
309            "v1": 2
310        }
311    ]
312    },
313    {
314        "testcase": "Unnest scan with array index key only, OR clause, two indexes. Explain",
315        "ignore": "index_id",
316        "explain": {
317            "disabled": false,
318            "results": [
319                {
320                    "present": true
321                }
322            ],
323            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'UnionScan' AND ARRAY_LENGTH(v.scans) = 2 END"
324        },
325        "statements":"SELECT v1.id, v1.val FROM orders AS o UNNEST o.a3 AS v1 WHERE o.test_id = \"ua\" AND v1.type = \"n\" AND (v1.id = 1 OR v1.val = 111) ORDER BY v1.id, v1.val",
326        "Results": [
327        {
328            "id": 1,
329            "val": 101
330        },
331        {
332            "id": 1,
333            "val": 101
334        },
335        {
336            "id": 11,
337            "val": 111
338        },
339        {
340            "id": 11,
341            "val": 111
342        }
343    ]
344    }
345
346]
347
348