forked from MaterializeInc/materialize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cardinality.slt
594 lines (516 loc) · 21.6 KB
/
cardinality.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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# 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.
# TEST `EXPLAIN WITH(cardinality)`
# (we test the stats themselves in the second half of this file)
statement ok
CREATE TABLE t (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t2 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE INDEX t_x ON t (x);
statement ok
CREATE INDEX tt_x ON t2 (x);
statement ok
CREATE TABLE cities (name TEXT NOT NULL, state TEXT NOT NULL, pop integer);
statement ok
CREATE TABLE states (state TEXT NOT NULL, pop integer);
statement ok
CREATE INDEX cities_name ON cities (name);
statement ok
CREATE INDEX cities_state ON cities (state);
statement ok
CREATE INDEX cities_name_and_state ON cities (name, state);
statement ok
CREATE INDEX state_state ON states (state);
query T multiline
EXPLAIN WITH(cardinality) SELECT DISTINCT x FROM t
----
Explained Query:
Distinct group_by=[#0] // { cardinality: "materialize.public.t" }
Project (#0) // { cardinality: "materialize.public.t" }
ReadIndex on=t t_x=[*** full scan ***] // { cardinality: "materialize.public.t" }
Used Indexes:
- materialize.public.t_x (*** full scan ***)
EOF
query T multiline
EXPLAIN WITH(cardinality) SELECT * FROM (SELECT DISTINCT ON(t.x) t.x, t.y FROM t) WHERE x = y
----
Explained Query:
Filter (#0 = #1) // { cardinality: "materialize.public.t * icard(#0)^1" }
TopK group_by=[#0] limit=1 // { cardinality: "materialize.public.t" }
ReadIndex on=t t_x=[*** full scan ***] // { cardinality: "materialize.public.t" }
Used Indexes:
- materialize.public.t_x (*** full scan ***)
EOF
query T multiline
EXPLAIN WITH(cardinality) SELECT name, cities.state FROM
cities JOIN states
ON cities.state = states.state
WHERE cities.pop > states.pop / 2;
----
Explained Query:
Project (#0, #1) // { cardinality: "materialize.public.cities * materialize.public.states * 0.33" }
Filter (#2 > (#4 / 2)) // { cardinality: "materialize.public.cities * materialize.public.states * 0.33" }
Join on=(#1 = #3) type=differential // { cardinality: "materialize.public.cities * materialize.public.states" }
ArrangeBy keys=[[#1]] // { cardinality: "materialize.public.cities" }
ReadIndex on=cities cities_state=[differential join] // { cardinality: "materialize.public.cities" }
ArrangeBy keys=[[#0]] // { cardinality: "materialize.public.states" }
ReadIndex on=states state_state=[differential join] // { cardinality: "materialize.public.states" }
Used Indexes:
- materialize.public.cities_state (differential join)
- materialize.public.state_state (differential join)
EOF
query T multiline
EXPLAIN WITH(cardinality) SELECT MAX(t.y) FROM t JOIN t2 ON t.x = t2.x
----
Explained Query:
Return // { cardinality: "3" }
Union // { cardinality: "3" }
Get l0 // { cardinality: "1" }
Map (null) // { cardinality: "2" }
Union // { cardinality: "2" }
Negate // { cardinality: "1" }
Project () // { cardinality: "1" }
Get l0 // { cardinality: "1" }
Constant // { cardinality: "1" }
- ()
With
cte l0 =
Reduce aggregates=[max(#0)] // { cardinality: "1" }
Project (#1) // { cardinality: "materialize.public.t * materialize.public.t2" }
Join on=(#0 = #2) type=differential // { cardinality: "materialize.public.t * materialize.public.t2" }
ArrangeBy keys=[[#0]] // { cardinality: "materialize.public.t" }
ReadIndex on=t t_x=[differential join] // { cardinality: "materialize.public.t" }
ArrangeBy keys=[[#0]] // { cardinality: "materialize.public.t2" }
ReadIndex on=t2 tt_x=[differential join] // { cardinality: "materialize.public.t2" }
Used Indexes:
- materialize.public.t_x (differential join)
- materialize.public.tt_x (differential join)
EOF
query T multiline
EXPLAIN WITH(cardinality) SELECT state, name FROM
(SELECT DISTINCT state FROM cities) grp,
LATERAL (SELECT name FROM cities WHERE state = grp.state ORDER BY pop DESC NULLS LAST LIMIT 3);
----
Explained Query:
Project (#1, #0) // { cardinality: "materialize.public.cities" }
TopK group_by=[#1] order_by=[#2 desc nulls_last] limit=3 // { cardinality: "materialize.public.cities" }
ReadIndex on=cities cities_name=[*** full scan ***] // { cardinality: "materialize.public.cities" }
Used Indexes:
- materialize.public.cities_name (*** full scan ***)
EOF
simple conn=mz_system,user=mz_system
ALTER SYSTEM SET enable_cardinality_estimates = true
----
COMPLETE 0
simple
SET ENABLE_SESSION_CARDINALITY_ESTIMATES TO TRUE
----
COMPLETE 0
statement ok
INSERT INTO t (x, y) VALUES (1, 1), (1, 2), (2, 3), (3, 1)
query T multiline
EXPLAIN WITH(join_impls) SELECT * FROM t as l, t as r WHERE l.x = r.x;
----
Explained Query:
Return
Project (#0, #1, #0, #3)
Join on=(#0 = #2) type=differential
implementation
%0:l0[#0]KA|4| » %1:l0[#0]KA|4|
Get l0
Get l0
With
cte l0 =
ArrangeBy keys=[[#0]]
ReadIndex on=t t_x=[differential join]
Used Indexes:
- materialize.public.t_x (differential join)
EOF
statement ok
INSERT INTO t2 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 200)) AS l, (SELECT generate_series(1, 50)) AS r
query T multiline
EXPLAIN WITH(join_impls) SELECT * FROM t, t2 WHERE t.x = t2.x;
----
Explained Query:
Project (#0, #1, #0, #3)
Join on=(#0 = #2) type=differential
implementation
%0:t[#0]KA|4| » %1:t2[#0]KA|10000|
ArrangeBy keys=[[#0]]
ReadIndex on=t t_x=[differential join]
ArrangeBy keys=[[#0]]
ReadIndex on=t2 tt_x=[differential join]
Used Indexes:
- materialize.public.t_x (differential join)
- materialize.public.tt_x (differential join)
EOF
# regression test drawn from LDBC-BI query 15 for having a selectivity of 0
# TODO(mgree): we could probably trim this down to be tighter, but the optimizer has been too clever for me
statement ok
CREATE TABLE Person_knows_Person (
creationDate timestamp with time zone NOT NULL,
Person1id bigint NOT NULL,
Person2id bigint NOT NULL
)
statement ok
CREATE INDEX Person_knows_Person_Person1id_Person2id ON Person_knows_Person (Person1id, Person2id)
query T multiline
EXPLAIN WITH MUTUALLY RECURSIVE
mm (src bigint, dst bigint, w bigint) AS (SELECT 3::bigint, 4::bigint, 5::bigint),
path (src bigint, dst bigint, w double precision) AS (
SELECT pp.person1id, pp.person2id, 10::double precision / (coalesce(w, 0) + 10)
FROM Person_knows_Person pp left join mm on least(pp.person1id, pp.person2id) = mm.src AND greatest(pp.person1id, pp.person2id) = mm.dst
),
pexists (src bigint, dir bool) AS (
(
SELECT 1::bigint, true
UNION
SELECT 2::bigint, false
)
UNION
(
WITH
ss (src, dir) AS (SELECT src, dir FROM pexists),
ns (src, dir) AS (SELECT p.dst, ss.dir FROM ss, path p WHERE ss.src = p.src),
bb (src, dir) AS (SELECT src, dir FROM ns UNION ALL SELECT src, dir FROM ss),
found (found) AS (
SELECT 1 AS found
FROM bb b1, bb b2
WHERE b1.dir AND (NOT b2.dir) AND b1.src = b2.src
)
SELECT src, dir
FROM ns
WHERE NOT EXISTS (SELECT 1 FROM found)
UNION
SELECT -1, true
WHERE EXISTS (SELECT 1 FROM found)
)
),
pathfound (c bool) AS (
SELECT true AS c
FROM pexists
WHERE src = -1 AND dir
)
SELECT * FROM pexists;
----
Explained Query:
Return
Get l4
With Mutually Recursive
cte l4 =
Distinct group_by=[#0, #1]
Union
Distinct group_by=[#0, #1]
Union
Project (#1, #0)
CrossJoin type=differential
ArrangeBy keys=[[]]
Get l1
ArrangeBy keys=[[]]
Union
Negate
Get l3
Constant
- ()
Project (#1, #0)
Map (true, -1)
Get l3
Constant
- (1, true)
- (2, false)
cte l3 =
Distinct
Project ()
Join on=(#0 = #1) type=differential
ArrangeBy keys=[[#0]]
Project (#0)
Filter #1
Get l2
ArrangeBy keys=[[#0]]
Project (#0)
Filter NOT(#1)
Get l2
cte l2 =
Union
Project (#1, #0)
Get l1
Get l4
cte l1 =
Project (#1, #3)
Join on=(#0 = #2) type=differential
ArrangeBy keys=[[#0]]
Get l4
ArrangeBy keys=[[#0]]
Union
Project (#1, #2)
Get l0
Project (#1, #2)
Join on=(#0 = #3 AND #1 = #4 AND #2 = #5) type=differential
ArrangeBy keys=[[#0..=#2]]
Union
Negate
Distinct group_by=[#0..=#2]
Get l0
Distinct group_by=[#0..=#2]
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
ArrangeBy keys=[[#0..=#2]]
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
cte l0 =
Filter (3 = least(#1, #2)) AND (4 = greatest(#1, #2))
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
Used Indexes:
- materialize.public.person_knows_person_person1id_person2id (*** full scan ***)
EOF
# regression test drawn from LDBC-BI query 15 for having a selectivity of 0
# TODO(mgree): we could probably trim this down to be tighter, but the optimizer has been too clever for me
query T multiline
EXPLAIN WITH MUTUALLY RECURSIVE
mm (src bigint, dst bigint, w bigint) AS (SELECT 3::bigint, 4::bigint, 5::bigint),
path (src bigint, dst bigint, w double precision) AS (
SELECT pp.person1id, pp.person2id, 10::double precision / (coalesce(w, 0) + 10)
FROM Person_knows_Person pp left join mm on least(pp.person1id, pp.person2id) = mm.src AND greatest(pp.person1id, pp.person2id) = mm.dst
),
pexists (src bigint, dir bool) AS (
(
SELECT 1::bigint, true
UNION
SELECT 2::bigint, false
)
UNION
(
WITH
ss (src, dir) AS (SELECT src, dir FROM pexists),
ns (src, dir) AS (SELECT p.dst, ss.dir FROM ss, path p WHERE ss.src = p.src),
bb (src, dir) AS (SELECT src, dir FROM ns UNION ALL SELECT src, dir FROM ss),
found (found) AS (
SELECT 1 AS found
FROM bb b1, bb b2
WHERE b1.dir AND (NOT b2.dir) AND b1.src = b2.src
)
SELECT src, dir
FROM ns
WHERE NOT EXISTS (SELECT 1 FROM found)
UNION
SELECT -1, true
WHERE EXISTS (SELECT 1 FROM found)
)
),
pathfound (c bool) AS (
SELECT true AS c
FROM pexists
WHERE src = -1 AND dir
)
SELECT * FROM pexists;
----
Explained Query:
Return
Get l4
With Mutually Recursive
cte l4 =
Distinct group_by=[#0, #1]
Union
Distinct group_by=[#0, #1]
Union
Project (#1, #0)
CrossJoin type=differential
ArrangeBy keys=[[]]
Get l1
ArrangeBy keys=[[]]
Union
Negate
Get l3
Constant
- ()
Project (#1, #0)
Map (true, -1)
Get l3
Constant
- (1, true)
- (2, false)
cte l3 =
Distinct
Project ()
Join on=(#0 = #1) type=differential
ArrangeBy keys=[[#0]]
Project (#0)
Filter #1
Get l2
ArrangeBy keys=[[#0]]
Project (#0)
Filter NOT(#1)
Get l2
cte l2 =
Union
Project (#1, #0)
Get l1
Get l4
cte l1 =
Project (#1, #3)
Join on=(#0 = #2) type=differential
ArrangeBy keys=[[#0]]
Get l4
ArrangeBy keys=[[#0]]
Union
Project (#1, #2)
Get l0
Project (#1, #2)
Join on=(#0 = #3 AND #1 = #4 AND #2 = #5) type=differential
ArrangeBy keys=[[#0..=#2]]
Union
Negate
Distinct group_by=[#0..=#2]
Get l0
Distinct group_by=[#0..=#2]
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
ArrangeBy keys=[[#0..=#2]]
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
cte l0 =
Filter (3 = least(#1, #2)) AND (4 = greatest(#1, #2))
ReadIndex on=person_knows_person person_knows_person_person1id_person2id=[*** full scan ***]
Used Indexes:
- materialize.public.person_knows_person_person1id_person2id (*** full scan ***)
EOF
# timeouts should work
simple conn=mz_system,user=mz_system
ALTER SYSTEM SET optimizer_oneshot_stats_timeout TO '1us';
----
COMPLETE 0
simple conn=mz_system,user=mz_system
SHOW optimizer_oneshot_stats_timeout;
----
1 us
COMPLETE 1
statement ok
CREATE TABLE t3 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t4 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t5 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t6 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t7 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t8 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t9 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
CREATE TABLE t10 (x INTEGER NOT NULL, y INTEGER NOT NULL);
statement ok
INSERT INTO t3 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 13)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t4 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 47)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t5 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 38)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t6 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 23)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t7 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 23)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t8 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 23)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t9 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 21)) AS l, (SELECT generate_series(1, 13)) AS r
statement ok
INSERT INTO t10 (x, y) SELECT l.*, r.* FROM (SELECT generate_series(1, 20)) AS l, (SELECT generate_series(1, 13)) AS r
# TODO(mgree): Make this reproducible
# query T multiline
# EXPLAIN WITH(join_impls) SELECT * FROM t JOIN t2 ON t.x = t2.x JOIN t3 ON t.x = t3.x JOIN t4 ON t.x = t4.x JOIN t5 ON t.x = t5.x JOIN t6 ON t.x = t6.x JOIN t7 ON t.x = t7.x JOIN t8 ON t.x = t8.x JOIN t9 ON t.x = t9.x JOIN t10 ON t.x = t10.x;
# ----
# Explained Query:
# Project (#0, #1, #0, #3, #0, #5, #0, #7, #0, #9, #0, #11, #0, #13, #0, #15, #0, #17, #0, #19)
# Join on=(eq(#0, #2, #4, #6, #8, #10, #12, #14, #16, #18)) type=delta
# implementation
# %0:t » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %1:t2 » %0:t[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %2:t3 » %0:t[#0]KA » %1:t2[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %3:t4 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %4:t5 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %5:t6 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %6:t7 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %7:t8 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %8:t9[#0]KA » %9:t10[#0]KA
# %8:t9 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %9:t10[#0]KA
# %9:t10 » %0:t[#0]KA » %1:t2[#0]KA » %2:t3[#0]KA » %3:t4[#0]KA » %4:t5[#0]KA » %5:t6[#0]KA » %6:t7[#0]KA » %7:t8[#0]KA » %8:t9[#0]KA
# ArrangeBy keys=[[#0]]
# ReadIndex on=t t_x=[delta join 1st input (full scan)]
# ArrangeBy keys=[[#0]]
# ReadIndex on=t2 tt_x=[delta join lookup]
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t3
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t4
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t5
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t6
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t7
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t8
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t9
# ArrangeBy keys=[[#0]]
# ReadStorage materialize.public.t10
#
# Used Indexes:
# - materialize.public.t_x (delta join 1st input (full scan))
# - materialize.public.tt_x (delta join lookup)
#
# EOF
# restore and make sure we're good
simple conn=mz_system,user=mz_system
ALTER SYSTEM SET optimizer_oneshot_stats_timeout TO '20ms';
----
COMPLETE 0
simple conn=mz_system,user=mz_system
SHOW optimizer_oneshot_stats_timeout;
----
20 ms
COMPLETE 1
query T multiline
EXPLAIN WITH(join_impls) SELECT * FROM t JOIN t2 ON t.x = t2.x JOIN t3 ON t.x = t3.x JOIN t4 ON t.x = t4.x JOIN t5 ON t.x = t5.x JOIN t6 ON t.x = t6.x JOIN t7 ON t.x = t7.x JOIN t8 ON t.x = t8.x JOIN t9 ON t.x = t9.x JOIN t10 ON t.x = t10.x;
----
Explained Query:
Project (#0, #1, #0, #3, #0, #5, #0, #7, #0, #9, #0, #11, #0, #13, #0, #15, #0, #17, #0, #19)
Join on=(eq(#0, #2, #4, #6, #8, #10, #12, #14, #16, #18)) type=delta
implementation
%0:t » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%1:t2 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611|
%2:t3 » %0:t[#0]KA|4| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%3:t4 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %1:t2[#0]KA|10000|
%4:t5 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%5:t6 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%6:t7 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%7:t8 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%8:t9 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %9:t10[#0]KA|260| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
%9:t10 » %0:t[#0]KA|4| » %2:t3[#0]KA|169| » %8:t9[#0]KA|273| » %5:t6[#0]KA|299| » %6:t7[#0]KA|299| » %7:t8[#0]KA|299| » %4:t5[#0]KA|494| » %3:t4[#0]KA|611| » %1:t2[#0]KA|10000|
ArrangeBy keys=[[#0]]
ReadIndex on=t t_x=[delta join 1st input (full scan)]
ArrangeBy keys=[[#0]]
ReadIndex on=t2 tt_x=[delta join lookup]
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t3
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t4
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t5
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t6
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t7
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t8
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t9
ArrangeBy keys=[[#0]]
ReadStorage materialize.public.t10
Used Indexes:
- materialize.public.t_x (delta join 1st input (full scan))
- materialize.public.tt_x (delta join lookup)
EOF