-
Notifications
You must be signed in to change notification settings - Fork 465
/
Copy pathgithub-2969.slt
127 lines (103 loc) · 4.32 KB
/
github-2969.slt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
# Regression test for https://github.com/MaterializeInc/database-issues/issues/2969.
statement ok
CREATE TABLE table_f1 (f1 INTEGER);
statement ok
CREATE TAble table_f4 (f4 INTEGER);
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , LATERAL ( SELECT * FROM ( table_f4 AS a1 LEFT JOIN table_f4 AS a2 ON a1.f4 = a2.f4 ) WHERE a1.f4 <= f1 ) WHERE f1 IS NULL;
----
Explained Query (fast path):
Constant <empty>
Target cluster: quickstart
EOF
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , LATERAL ( SELECT * FROM ( table_f4 AS a1 LEFT JOIN table_f4 AS a2 ON a1.f4 = a2.f4 ) WHERE a1.f4 <= f1 ) WHERE f1 IS NULL;
----
Explained Query (fast path):
Constant <empty>
Target cluster: quickstart
EOF
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , LATERAL ( SELECT * FROM ( table_f4 AS a1 LEFT JOIN table_f4 AS a2 ON a1.f4 = a2.f4 ) WHERE a1.f4 <= f1 ) WHERE f1 IS NULL;
----
Explained Query (fast path):
Constant <empty>
Target cluster: quickstart
EOF
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , LATERAL ( SELECT * FROM ( table_f4 AS a1 LEFT JOIN table_f4 AS a2 ON a1.f4 = a2.f4 ) WHERE a1.f4 <= f1 ) WHERE f1 IS NULL;
----
Explained Query (fast path):
Constant <empty>
Target cluster: quickstart
EOF
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , LATERAL ( SELECT * FROM ( table_f4 AS a1 LEFT JOIN table_f4 AS a2 ON a1.f4 = a2.f4 ) WHERE a1.f4 <= f1 ) WHERE f1 IS NULL;
----
Explained Query (fast path):
Constant <empty>
Target cluster: quickstart
EOF
statement ok
CREATE TAble table_f4_f5_f6 (f4 INTEGER, f5 INTEGER, f6 INTEGER);
statement ok
CREATE TAble table_f5_f6 (f5 INTEGER, f6 INTEGER);
query T multiline
EXPLAIN WITH(arity, join implementations) SELECT * FROM table_f1 , ( table_f4_f5_f6 AS a2 LEFT JOIN table_f5_f6 AS a3 USING ( f5 , f6 ) ) WHERE f5 = f6 AND f4 = f6;
----
Explained Query:
With
cte l0 =
Project (#0..=#2) // { arity: 3 }
Join on=(#1 = #3) type=differential // { arity: 4 }
implementation
%0:table_f4_f5_f6[#1]Kf » %1:table_f5_f6[#0]Kf
ArrangeBy keys=[[#1]] // { arity: 3 }
Filter (#1 = #2) // { arity: 3 }
ReadStorage materialize.public.table_f4_f5_f6 // { arity: 3 }
ArrangeBy keys=[[#0]] // { arity: 1 }
Project (#0) // { arity: 1 }
Filter (#0 = #1) // { arity: 2 }
ReadStorage materialize.public.table_f5_f6 // { arity: 2 }
cte l1 =
Filter (#0 = #1) AND (#0 = #2) AND (#1 = #2) // { arity: 3 }
ReadStorage materialize.public.table_f4_f5_f6 // { arity: 3 }
Return // { arity: 4 }
Project (#0, #2, #3, #1) // { arity: 4 }
CrossJoin type=differential // { arity: 4 }
implementation
%0:table_f1[×] » %1[×]
ArrangeBy keys=[[]] // { arity: 1 }
ReadStorage materialize.public.table_f1 // { arity: 1 }
ArrangeBy keys=[[]] // { arity: 3 }
Union // { arity: 3 }
Negate // { arity: 3 }
Project (#0..=#2) // { arity: 3 }
Join on=(#0 = #3) type=differential // { arity: 4 }
implementation
%0:l1[#0]Kf » %1[#0]Kf
ArrangeBy keys=[[#0]] // { arity: 3 }
Get l1 // { arity: 3 }
ArrangeBy keys=[[#0]] // { arity: 1 }
Project (#0) // { arity: 1 }
Distinct project=[#0, #1] // { arity: 2 }
Project (#1, #2) // { arity: 2 }
Get l0 // { arity: 3 }
Get l1 // { arity: 3 }
Filter (#0 = #1) // { arity: 3 }
Get l0 // { arity: 3 }
Source materialize.public.table_f1
Source materialize.public.table_f4_f5_f6
filter=((#1 = #2))
Source materialize.public.table_f5_f6
filter=((#0 = #1))
Target cluster: quickstart
EOF