forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollation_agg_func_enabled.result
297 lines (297 loc) · 17.7 KB
/
collation_agg_func_enabled.result
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
set tidb_cost_model_version=1;
create table t(id int, value varchar(20) charset utf8mb4 collate utf8mb4_general_ci, value1 varchar(20) charset utf8mb4 collate utf8mb4_bin);
insert into t values (1, 'abc', 'abc '),(4, 'Abc', 'abc'),(3,'def', 'def '), (5, 'abc', 'ABC');
desc format='brief' select group_concat(value order by 1) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:group_concat(collation_agg_func.t.value order by collation_agg_func.t.value separator ",")->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select group_concat(value order by 1) from t;
group_concat(value order by 1)
Abc,abc,abc,def
desc format='brief' select group_concat(value) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:group_concat(collation_agg_func.t.value separator ",")->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select group_concat(value) from t;
group_concat(value)
abc,Abc,def,abc
desc format='brief' select group_concat(value collate utf8mb4_bin) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:group_concat(Column#6 separator ",")->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select group_concat(value collate utf8mb4_bin) from t;
group_concat(value collate utf8mb4_bin)
abc,Abc,def,abc
desc format='brief' select group_concat(distinct value order by 1) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:group_concat(distinct collation_agg_func.t.value order by collation_agg_func.t.value separator ",")->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select upper(group_concat(distinct value order by 1)) from t;
upper(group_concat(distinct value order by 1))
ABC,DEF
desc format='brief' select group_concat(distinct value collate utf8mb4_bin order by 1) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:group_concat(distinct Column#6 order by Column#7 separator ",")->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6, cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#7
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select upper(group_concat(distinct value collate utf8mb4_bin order by 1)) from t;
upper(group_concat(distinct value collate utf8mb4_bin order by 1))
ABC,ABC,DEF
desc format='brief' select group_concat(distinct value) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:group_concat(distinct collation_agg_func.t.value separator ",")->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select upper(group_concat(distinct value)) from t;
upper(group_concat(distinct value))
ABC,DEF
desc format='brief' select group_concat(distinct value collate utf8mb4_bin) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:group_concat(distinct Column#6 separator ",")->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select upper(group_concat(distinct value collate utf8mb4_bin)) from t;
upper(group_concat(distinct value collate utf8mb4_bin))
ABC,ABC,DEF
desc format='brief' select count(distinct value) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:count(distinct collation_agg_func.t.value)->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select count(distinct value) from t;
count(distinct value)
2
desc format='brief' select count(distinct value collate utf8mb4_bin) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:count(distinct Column#6)->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select count(distinct value collate utf8mb4_bin) from t;
count(distinct value collate utf8mb4_bin)
3
desc format='brief' select count(distinct value, value1) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:count(distinct collation_agg_func.t.value, collation_agg_func.t.value1)->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select count(distinct value, value1) from t;
count(distinct value, value1)
3
desc format='brief' select count(distinct value collate utf8mb4_bin, value1) from t;
id estRows task access object operator info
StreamAgg 1.00 root funcs:count(distinct Column#6, Column#7)->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6, collation_agg_func.t.value1->Column#7
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select count(distinct value collate utf8mb4_bin, value1) from t;
count(distinct value collate utf8mb4_bin, value1)
4
desc format='brief' select approx_count_distinct(value) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:approx_count_distinct(collation_agg_func.t.value)->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select approx_count_distinct(value) from t;
approx_count_distinct(value)
2
desc format='brief' select approx_count_distinct(value collate utf8mb4_bin) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:approx_count_distinct(Column#6)->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select approx_count_distinct(value collate utf8mb4_bin) from t;
approx_count_distinct(value collate utf8mb4_bin)
3
desc format='brief' select approx_count_distinct(value, value1) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:approx_count_distinct(collation_agg_func.t.value, collation_agg_func.t.value1)->Column#5
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select approx_count_distinct(value, value1) from t;
approx_count_distinct(value, value1)
3
desc format='brief' select approx_count_distinct(value collate utf8mb4_bin, value1) from t;
id estRows task access object operator info
HashAgg 1.00 root funcs:approx_count_distinct(Column#6, Column#7)->Column#5
└─Projection 10000.00 root cast(collation_agg_func.t.value, varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#6, collation_agg_func.t.value1->Column#7
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
select approx_count_distinct(value collate utf8mb4_bin, value1) from t;
approx_count_distinct(value collate utf8mb4_bin, value1)
4
create table tt(a char(10), b enum('a', 'B', 'c'), c set('a', 'B', 'c'), d json) collate utf8mb4_general_ci;
insert into tt values ("a", "a", "a", JSON_OBJECT("a", "a"));
insert into tt values ("A", "A", "A", JSON_OBJECT("A", "A"));
insert into tt values ("b", "b", "b", JSON_OBJECT("b", "b"));
insert into tt values ("B", "B", "B", JSON_OBJECT("B", "B"));
insert into tt values ("c", "c", "c", JSON_OBJECT("c", "c"));
insert into tt values ("C", "C", "C", JSON_OBJECT("C", "C"));
split table tt by (0), (1), (2), (3), (4), (5);
desc format='brief' select min(a) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:min(collation_agg_func.tt.a)->Column#6
└─TopN 1.00 root collation_agg_func.tt.a, offset:0, count:1
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] collation_agg_func.tt.a, offset:0, count:1
└─Selection 9990.00 cop[tikv] not(isnull(collation_agg_func.tt.a))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
desc format='brief' select lower(min(a)) from tt;
id estRows task access object operator info
Projection 1.00 root lower(Column#6)->Column#7
└─StreamAgg 1.00 root funcs:min(collation_agg_func.tt.a)->Column#6
└─TopN 1.00 root collation_agg_func.tt.a, offset:0, count:1
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] collation_agg_func.tt.a, offset:0, count:1
└─Selection 9990.00 cop[tikv] not(isnull(collation_agg_func.tt.a))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select lower(min(a)) from tt;
lower(min(a))
a
desc format='brief' select min(a collate utf8mb4_bin) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:min(Column#8)->Column#6
└─Projection 1.00 root cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#8
└─Projection 1.00 root collation_agg_func.tt.a
└─TopN 1.00 root Column#7, offset:0, count:1
└─Projection 1.00 root collation_agg_func.tt.a, cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#7
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin), offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select min(a collate utf8mb4_bin) from tt;
min(a collate utf8mb4_bin)
A
desc format='brief' select max(a) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:max(collation_agg_func.tt.a)->Column#6
└─TopN 1.00 root collation_agg_func.tt.a:desc, offset:0, count:1
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] collation_agg_func.tt.a:desc, offset:0, count:1
└─Selection 9990.00 cop[tikv] not(isnull(collation_agg_func.tt.a))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(a) from tt;
max(a)
c
desc format='brief' select max(a collate utf8mb4_bin) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:max(Column#8)->Column#6
└─Projection 1.00 root cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#8
└─Projection 1.00 root collation_agg_func.tt.a
└─TopN 1.00 root Column#7:desc, offset:0, count:1
└─Projection 1.00 root collation_agg_func.tt.a, cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#7
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin):desc, offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.a, char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(a collate utf8mb4_bin) from tt;
max(a collate utf8mb4_bin)
c
desc format='brief' select min(b) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:min(Column#8)->Column#6
└─TableReader 1.00 root data:StreamAgg
└─StreamAgg 1.00 cop[tikv] funcs:min(collation_agg_func.tt.b)->Column#8
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select min(b) from tt;
min(b)
a
desc format='brief' select min(b collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
select min(b collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
desc format='brief' select max(b) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:max(Column#8)->Column#6
└─TableReader 1.00 root data:StreamAgg
└─StreamAgg 1.00 cop[tikv] funcs:max(collation_agg_func.tt.b)->Column#8
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(b) from tt;
max(b)
c
desc format='brief' select max(b collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
select max(b collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
desc format='brief' select min(c) from tt;
id estRows task access object operator info
HashAgg 1.00 root funcs:min(collation_agg_func.tt.c)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select min(c) from tt;
min(c)
a
desc format='brief' select min(c collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
select min(c collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
desc format='brief' select max(c) from tt;
id estRows task access object operator info
HashAgg 1.00 root funcs:max(collation_agg_func.tt.c)->Column#6
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(c) from tt;
max(c)
c
desc format='brief' select max(c collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
select max(c collate utf8mb4_bin) from tt;
Error 1235: This version of TiDB doesn't yet support 'use collate clause for enum or set'
desc format='brief' select min(d) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:min(collation_agg_func.tt.d)->Column#6
└─TopN 1.00 root collation_agg_func.tt.d, offset:0, count:1
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] collation_agg_func.tt.d, offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.d, var_string(4294967295))))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select min(d) from tt;
min(d)
{"A": "A"}
desc format='brief' select min(d collate utf8mb4_bin) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:min(Column#8)->Column#6
└─Projection 1.00 root cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#8
└─Projection 1.00 root collation_agg_func.tt.d
└─TopN 1.00 root Column#7, offset:0, count:1
└─Projection 1.00 root collation_agg_func.tt.d, cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#7
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin), offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select min(d collate utf8mb4_bin) from tt;
min(d collate utf8mb4_bin)
{"A": "A"}
desc format='brief' select max(d) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:max(collation_agg_func.tt.d)->Column#6
└─TopN 1.00 root collation_agg_func.tt.d:desc, offset:0, count:1
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] collation_agg_func.tt.d:desc, offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.d, var_string(4294967295))))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(d) from tt;
max(d)
{"c": "c"}
desc format='brief' select max(d collate utf8mb4_bin) from tt;
id estRows task access object operator info
StreamAgg 1.00 root funcs:max(Column#8)->Column#6
└─Projection 1.00 root cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#8
└─Projection 1.00 root collation_agg_func.tt.d
└─TopN 1.00 root Column#7:desc, offset:0, count:1
└─Projection 1.00 root collation_agg_func.tt.d, cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)->Column#7
└─TableReader 1.00 root data:TopN
└─TopN 1.00 cop[tikv] cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin):desc, offset:0, count:1
└─Selection 8000.00 cop[tikv] not(isnull(cast(collation_agg_func.tt.d, longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin)))
└─TableFullScan 10000.00 cop[tikv] table:tt keep order:false, stats:pseudo
select max(d collate utf8mb4_bin) from tt;
max(d collate utf8mb4_bin)
{"c": "c"}