forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_suite_out.json
220 lines (220 loc) · 7.82 KB
/
prepare_suite_out.json
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
[
{
"Name": "TestPlanCacheWithDifferentVariableTypes",
"Cases": [
{
"PrepareStmt": "prepare stmt from \"select ?, ?\"",
"Executes": [
{
"SQL": "execute stmt using @v1, @v2",
"Vars": [
{
"Name": "v1",
"Value": "1"
},
{
"Name": "v2",
"Value": "2"
}
],
"Plan": [
"Projection_3 1.00 root 1->Column#1, 2->Column#2",
"└─TableDual_4 1.00 root rows:1"
],
"LastPlanUseCache": "0",
"Result": [
"1 2"
]
},
{
"SQL": "execute stmt using @v1, @v2",
"Vars": [
{
"Name": "v1",
"Value": "1"
},
{
"Name": "v2",
"Value": "\"abc\""
}
],
"Plan": [
"Projection_3 1.00 root 1->Column#1, abc->Column#2",
"└─TableDual_4 1.00 root rows:1"
],
"LastPlanUseCache": "0",
"Result": [
"1 abc"
]
},
{
"SQL": "execute stmt using @v1, @v2",
"Vars": [
{
"Name": "v1",
"Value": "10"
},
{
"Name": "v2",
"Value": "\"cba\""
}
],
"Plan": [
"Projection_3 1.00 root 10->Column#1, cba->Column#2",
"└─TableDual_4 1.00 root rows:1"
],
"LastPlanUseCache": "1",
"Result": [
"10 cba"
]
}
]
},
{
"PrepareStmt": "prepare stmt from \"select a from t1 where t1.b = ?\"",
"Executes": [
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "3"
}
],
"Plan": [
"Projection_4 10.00 root test.t1.a",
"└─IndexReader_6 10.00 root index:IndexRangeScan_5",
" └─IndexRangeScan_5 10.00 cop[tikv] table:t1, index:b(b, a) range:[3,3], keep order:false, stats:pseudo"
],
"LastPlanUseCache": "0",
"Result": [
"3"
]
},
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "2"
}
],
"Plan": [
"Projection_4 10.00 root test.t1.a",
"└─IndexReader_6 10.00 root index:IndexRangeScan_5",
" └─IndexRangeScan_5 10.00 cop[tikv] table:t1, index:b(b, a) range:[2,2], keep order:false, stats:pseudo"
],
"LastPlanUseCache": "1",
"Result": [
"2"
]
},
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "-200"
}
],
"Plan": [
"Projection_4 10.00 root test.t1.a",
"└─IndexReader_6 10.00 root index:IndexRangeScan_5",
" └─IndexRangeScan_5 10.00 cop[tikv] table:t1, index:b(b, a) range:[-200,-200], keep order:false, stats:pseudo"
],
"LastPlanUseCache": "1",
"Result": null
},
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "\"abc\""
}
],
"Plan": [
"Projection_4 8000.00 root test.t1.a",
"└─IndexReader_10 8000.00 root index:Selection_9",
" └─Selection_9 8000.00 cop[tikv] eq(cast(test.t1.b, double BINARY), 0)",
" └─IndexFullScan_8 10000.00 cop[tikv] table:t1, index:b(b, a) keep order:false, stats:pseudo"
],
"LastPlanUseCache": "0",
"Result": null
}
]
},
{
"PrepareStmt": "prepare stmt from \"select t1.c, t2.c from t1 join t2 on t1.b = t2.b and t1.a = t2.a where t1.b = ?\"",
"Executes": [
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "1"
}
],
"Plan": [
"HashJoin_38 6387.21 root inner join, equal:[eq(test.t1.b, test.t2.b) eq(test.t1.a, test.t2.a)]",
"├─IndexLookUp_63(Build) 99.80 root ",
"│ ├─Selection_62(Build) 99.80 cop[tikv] not(isnull(test.t2.b))",
"│ │ └─IndexRangeScan_60 99.90 cop[tikv] table:t2, index:b(b, a) range:[1 -inf,1 +inf], keep order:false, stats:pseudo",
"│ └─TableRowIDScan_61(Probe) 99.80 cop[tikv] table:t2 keep order:false, stats:pseudo",
"└─IndexLookUp_56(Probe) 99.80 root ",
" ├─Selection_55(Build) 99.80 cop[tikv] not(isnull(test.t1.b))",
" │ └─IndexRangeScan_53 99.90 cop[tikv] table:t1, index:b(b, a) range:[1 -inf,1 +inf], keep order:false, stats:pseudo",
" └─TableRowIDScan_54(Probe) 99.80 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"LastPlanUseCache": "0",
"Result": null
},
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "2"
}
],
"Plan": [
"HashJoin_38 6387.21 root inner join, equal:[eq(test.t1.b, test.t2.b) eq(test.t1.a, test.t2.a)]",
"├─IndexLookUp_63(Build) 99.80 root ",
"│ ├─Selection_62(Build) 99.80 cop[tikv] not(isnull(test.t2.b))",
"│ │ └─IndexRangeScan_60 99.90 cop[tikv] table:t2, index:b(b, a) range:[2 -inf,2 +inf], keep order:false, stats:pseudo",
"│ └─TableRowIDScan_61(Probe) 99.80 cop[tikv] table:t2 keep order:false, stats:pseudo",
"└─IndexLookUp_56(Probe) 99.80 root ",
" ├─Selection_55(Build) 99.80 cop[tikv] not(isnull(test.t1.b))",
" │ └─IndexRangeScan_53 99.90 cop[tikv] table:t1, index:b(b, a) range:[2 -inf,2 +inf], keep order:false, stats:pseudo",
" └─TableRowIDScan_54(Probe) 99.80 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"LastPlanUseCache": "1",
"Result": [
"222 222"
]
},
{
"SQL": "execute stmt using @v1",
"Vars": [
{
"Name": "v1",
"Value": "\"abc\""
}
],
"Plan": [
"HashJoin_38 63744383.74 root inner join, equal:[eq(test.t1.b, test.t2.b) eq(test.t1.a, test.t2.a)]",
"├─TableReader_59(Build) 7984.01 root data:Selection_58",
"│ └─Selection_58 7984.01 cop[tikv] eq(cast(test.t2.b, double BINARY), 0), not(isnull(test.t2.a)), not(isnull(test.t2.b))",
"│ └─TableFullScan_57 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo",
"└─TableReader_52(Probe) 7984.01 root data:Selection_51",
" └─Selection_51 7984.01 cop[tikv] eq(cast(test.t1.b, double BINARY), 0), not(isnull(test.t1.a)), not(isnull(test.t1.b))",
" └─TableFullScan_50 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"LastPlanUseCache": "0",
"Result": null
}
]
}
]
}
]