diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior index 1e062287ff12..d7bf4ef7f300 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior @@ -3648,7 +3648,7 @@ project ├── immutable ├── stats: [rows=0.3666667] ├── cost: 45.3262257 - ├── fd: ()-->(2,5,21,24), (5)==(24), (24)==(5), (2)==(21), (21)==(2), (3)==(22), (22)==(3), (4)==(23), (23)==(4) + ├── fd: ()-->(2,5,21,24), (3)==(22), (22)==(3), (5)==(24), (24)==(5), (4)==(23), (23)==(4), (2)==(21), (21)==(2) ├── distribution: ap-southeast-2 ├── prune: (2-5,12,21-24) └── inner-join (lookup xyz@xyz_id2_str_abc_id_idx [as=x]) @@ -3657,7 +3657,7 @@ project ├── immutable ├── stats: [rows=0.3666667, distinct(13)=0.366667, null(13)=0, distinct(14)=0.366667, null(14)=0, distinct(15)=0.366667, null(15)=0, distinct(20)=0.366667, null(20)=0, distinct(24)=0.366667, null(24)=0, distinct(25)=0.366667, null(25)=0] ├── cost: 45.302559 - ├── fd: ()-->(2,5,6,14,15,21,24,25), (1)-->(3,4), (1)==(13,20), (13)==(1,20), (5)==(14,24), (14)==(5,24), (6)==(15,25), (15)==(6,25), (20)-->(22,23), (20)==(1,13), (24)==(5,14), (25)==(6,15), (2)==(21), (21)==(2), (3)==(22), (22)==(3), (4)==(23), (23)==(4) + ├── fd: ()-->(2,5,6,14,15,21,24,25), (1)-->(3,4), (20)-->(22,23), (1)==(13,20), (13)==(1,20), (20)==(1,13), (5)==(14,24), (14)==(5,24), (24)==(5,14), (6)==(15,25), (15)==(6,25), (25)==(6,15), (2)==(21), (21)==(2), (3)==(22), (22)==(3), (4)==(23), (23)==(4) ├── distribution: ap-southeast-2 ├── lookup table distribution: ap-southeast-2,ca-central-1,us-east-1 ├── inner-join (lookup abc [as=b]) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain b/pkg/sql/opt/exec/execbuilder/testdata/explain index fbc30e575fe1..febf5658140d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain @@ -2263,7 +2263,7 @@ quality of service: regular query T EXPLAIN (OPT, MEMO) SELECT * FROM tc JOIN t ON k=a ---- -memo (optimized, ~18KB, required=[presentation: info:14] [distribution: test]) +memo (optimized, ~19KB, required=[presentation: info:14] [distribution: test]) ├── G1: (explain G2 [presentation: a:1,b:2,k:8,v:9] [distribution: test]) │ └── [presentation: info:14] [distribution: test] │ ├── best: (explain G2="[presentation: a:1,b:2,k:8,v:9] [distribution: test]" [presentation: a:1,b:2,k:8,v:9] [distribution: test]) @@ -2344,7 +2344,7 @@ TABLE t ├── crdb_internal_origin_timestamp decimal [hidden] [system] └── PRIMARY INDEX t_pkey └── k int not null -memo (optimized, ~18KB, required=[presentation: info:14] [distribution: test]) +memo (optimized, ~19KB, required=[presentation: info:14] [distribution: test]) ├── G1: (explain G2 [presentation: a:1,b:2,k:8,v:9] [distribution: test]) │ └── [presentation: info:14] [distribution: test] │ ├── best: (explain G2="[presentation: a:1,b:2,k:8,v:9] [distribution: test]" [presentation: a:1,b:2,k:8,v:9] [distribution: test]) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_redact b/pkg/sql/opt/exec/execbuilder/testdata/explain_redact index c2b91f0b9bfb..d2e029e4aace 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_redact +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_redact @@ -678,7 +678,7 @@ upsert bc query T EXPLAIN (OPT, MEMO, REDACT) INSERT INTO bc SELECT a::float + 1 FROM a ON CONFLICT (b) DO UPDATE SET b = bc.b + 100 ---- -memo (optimized, ~35KB, required=[presentation: info:25] [distribution: test]) +memo (optimized, ~36KB, required=[presentation: info:25] [distribution: test]) ├── G1: (explain G2 [distribution: test]) │ └── [presentation: info:25] [distribution: test] │ ├── best: (explain G2="[distribution: test]" [distribution: test]) @@ -1539,7 +1539,7 @@ delete f query T EXPLAIN (OPT, MEMO, REDACT) DELETE FROM f WHERE f = 8.5 ---- -memo (optimized, ~16KB, required=[presentation: info:14] [distribution: test]) +memo (optimized, ~17KB, required=[presentation: info:14] [distribution: test]) ├── G1: (explain G2 [distribution: test]) │ └── [presentation: info:14] [distribution: test] │ ├── best: (explain G2="[distribution: test]" [distribution: test]) @@ -2138,7 +2138,7 @@ project query T EXPLAIN (OPT, MEMO, REDACT) SELECT 100, if(e != '', 12.0, 13.0), 'abc', coalesce(e, 'eee'), row(e, e || 'a', now()), 'POINT (1 1)'::GEOMETRY, '[true]'::JSON, false, NULL, e FROM e ---- -memo (optimized, ~8KB, required=[presentation: info:17] [distribution: test]) +memo (optimized, ~9KB, required=[presentation: info:17] [distribution: test]) ├── G1: (explain G2 [presentation: ?column?:8,if:9,?column?:10,coalesce:11,row:12,geometry:13,jsonb:14,bool:15,?column?:16,e:1] [distribution: test]) │ └── [presentation: info:17] [distribution: test] │ ├── best: (explain G2="[presentation: ?column?:8,if:9,?column?:10,coalesce:11,row:12,geometry:13,jsonb:14,bool:15,?column?:16,e:1] [distribution: test]" [presentation: ?column?:8,if:9,?column?:10,coalesce:11,row:12,geometry:13,jsonb:14,bool:15,?column?:16,e:1] [distribution: test]) @@ -2435,7 +2435,7 @@ project query T EXPLAIN (OPT, MEMO, REDACT) SELECT * FROM bc JOIN f ON b = f + 1 ---- -memo (optimized, ~27KB, required=[presentation: info:14] [distribution: test]) +memo (optimized, ~28KB, required=[presentation: info:14] [distribution: test]) ├── G1: (explain G2 [presentation: b:1,c:2,f:7] [distribution: test]) │ └── [presentation: info:14] [distribution: test] │ ├── best: (explain G2="[presentation: b:1,c:2,f:7] [distribution: test]" [presentation: b:1,c:2,f:7] [distribution: test]) @@ -2820,7 +2820,7 @@ project query T EXPLAIN (OPT, MEMO, REDACT) SELECT f, g FROM f, LATERAL (SELECT count(DISTINCT c + f + 1) * 2 AS g FROM bc WHERE b * f < 10) ---- -memo (optimized, ~33KB, required=[presentation: info:16] [distribution: test]) +memo (optimized, ~35KB, required=[presentation: info:16] [distribution: test]) ├── G1: (explain G2 [presentation: f:1,g:15] [distribution: test]) │ └── [presentation: info:16] [distribution: test] │ ├── best: (explain G2="[presentation: f:1,g:15] [distribution: test]" [presentation: f:1,g:15] [distribution: test]) @@ -3099,7 +3099,7 @@ anti-join-apply query T EXPLAIN (OPT, MEMO, REDACT) SELECT * FROM a WHERE a > ALL (SELECT c::int + 2 FROM bc WHERE b > a::float * 3) ---- -memo (optimized, ~22KB, required=[presentation: info:15] [distribution: test]) +memo (optimized, ~23KB, required=[presentation: info:15] [distribution: test]) ├── G1: (explain G2 [presentation: a:1] [distribution: test]) │ └── [presentation: info:15] [distribution: test] │ ├── best: (explain G2="[presentation: a:1] [distribution: test]" [presentation: a:1] [distribution: test]) @@ -3426,7 +3426,7 @@ top-k query T EXPLAIN (OPT, MEMO, REDACT) SELECT * FROM cd ORDER BY regexp_replace(c, '[0-9]', 'd') LIMIT 3 ---- -memo (optimized, ~7KB, required=[presentation: info:9] [distribution: test]) +memo (optimized, ~8KB, required=[presentation: info:9] [distribution: test]) ├── G1: (explain G2 [presentation: c:1,d:2] [ordering: +8 opt(2)] [distribution: test]) │ └── [presentation: info:9] [distribution: test] │ ├── best: (explain G2="[presentation: c:1,d:2] [ordering: +8 opt(2)] [distribution: test]" [presentation: c:1,d:2] [ordering: +8 opt(2)] [distribution: test]) @@ -3618,7 +3618,7 @@ scalar-group-by query T EXPLAIN (OPT, MEMO, REDACT) SELECT covar_pop(d, d + 1) FROM d ---- -memo (optimized, ~7KB, required=[presentation: info:8] [distribution: test]) +memo (optimized, ~8KB, required=[presentation: info:8] [distribution: test]) ├── G1: (explain G2 [presentation: covar_pop:7] [distribution: test]) │ └── [presentation: info:8] [distribution: test] │ ├── best: (explain G2="[presentation: covar_pop:7] [distribution: test]" [presentation: covar_pop:7] [distribution: test]) @@ -3927,7 +3927,7 @@ create-table query T EXPLAIN (OPT, MEMO, REDACT) CREATE TABLE t (col STRING CHECK (col != 'secret')) ---- -memo (optimized, ~3KB, required=[presentation: info:1] [distribution: test]) +memo (optimized, ~4KB, required=[presentation: info:1] [distribution: test]) ├── G1: (explain G2 [distribution: test]) │ └── [presentation: info:1] [distribution: test] │ ├── best: (explain G2="[distribution: test]" [distribution: test]) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/join b/pkg/sql/opt/exec/execbuilder/testdata/join index 76fbdad42379..4ae22a13c0f9 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/join +++ b/pkg/sql/opt/exec/execbuilder/testdata/join @@ -2235,7 +2235,7 @@ EXPLAIN (OPT, MEMO) SELECT * FROM (VALUES (1, 10), (2, 20), (3, 30)) as v(x, y) INNER STRAIGHT JOIN t119035 ON a > x ---- -memo (optimized, ~10KB, required=[presentation: info:10] [distribution: test]) +memo (optimized, ~11KB, required=[presentation: info:10] [distribution: test]) ├── G1: (explain G2 [presentation: x:1,y:2,k:3,a:4,b:5] [distribution: test]) │ └── [presentation: info:10] [distribution: test] │ ├── best: (explain G2="[presentation: x:1,y:2,k:3,a:4,b:5] [distribution: test]" [presentation: x:1,y:2,k:3,a:4,b:5] [distribution: test]) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_limit b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_limit index 631d7f249baf..11708cc9720a 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_limit +++ b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_limit @@ -293,7 +293,7 @@ project ├── stats: [rows=1] ├── cost: 29.125 ├── key: () - ├── fd: ()-->(1,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1,8), (1)==(8), (8)==(1) ├── distribution: test ├── inner-join (lookup b) │ ├── columns: a.x:1 b.x:8 diff --git a/pkg/sql/opt/memo/testdata/logprops/delete b/pkg/sql/opt/memo/testdata/logprops/delete index b722a8754ecb..c0d82b18de23 100644 --- a/pkg/sql/opt/memo/testdata/logprops/delete +++ b/pkg/sql/opt/memo/testdata/logprops/delete @@ -152,7 +152,7 @@ DELETE FROM abcde WHERE b=c RETURNING *; project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int) ├── volatile, mutations - ├── fd: (2)==(3), (3)==(2), (2)-->(4) + ├── fd: (2)-->(4), (2)==(3), (3)==(2) ├── prune: (1-4) └── delete abcde ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int) rowid:5(int!null) @@ -165,7 +165,7 @@ project │ └── rowid:13 => rowid:5 ├── volatile, mutations ├── key: (5) - ├── fd: (2)==(3), (3)==(2), (5)-->(1-4), (2)-->(4) + ├── fd: (5)-->(1-4), (2)-->(4), (2)==(3), (3)==(2) └── select ├── columns: a:9(int!null) b:10(int!null) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid) ├── key: (13) diff --git a/pkg/sql/opt/memo/testdata/logprops/insert b/pkg/sql/opt/memo/testdata/logprops/insert index 1699737c8a15..4094fee032b2 100644 --- a/pkg/sql/opt/memo/testdata/logprops/insert +++ b/pkg/sql/opt/memo/testdata/logprops/insert @@ -85,7 +85,7 @@ project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) ├── cardinality: [0 - 10] ├── volatile, mutations - ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) + ├── fd: ()-->(3), (1)-->(4), (1)==(2), (2)==(1) ├── prune: (1-4) └── insert abcde ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) rowid:5(int!null) @@ -104,7 +104,7 @@ project │ └── rowid_default:15 => rowid:5 ├── cardinality: [0 - 10] ├── volatile, mutations - ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) + ├── fd: ()-->(3), (1)-->(4), (1)==(2), (2)==(1) └── project ├── columns: d_comp:17(int!null) y:10(int!null) c_default:14(int!null) rowid_default:15(int) e_default:16(int) ├── cardinality: [0 - 10] @@ -158,7 +158,7 @@ INSERT INTO abcde (a, b) SELECT y, y FROM xyz ORDER BY y, z RETURNING * project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) ├── volatile, mutations - ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) + ├── fd: ()-->(3), (1)-->(4), (1)==(2), (2)==(1) ├── prune: (1-4) └── insert abcde ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) rowid:5(int!null) @@ -176,7 +176,7 @@ project │ ├── d_comp:17 => d:4 │ └── rowid_default:15 => rowid:5 ├── volatile, mutations - ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) + ├── fd: ()-->(3), (1)-->(4), (1)==(2), (2)==(1) └── project ├── columns: d_comp:17(int!null) y:10(int!null) c_default:14(int!null) rowid_default:15(int) e_default:16(int) ├── volatile diff --git a/pkg/sql/opt/memo/testdata/logprops/join b/pkg/sql/opt/memo/testdata/logprops/join index 7407c9356fb9..70794588b01d 100644 --- a/pkg/sql/opt/memo/testdata/logprops/join +++ b/pkg/sql/opt/memo/testdata/logprops/join @@ -2463,7 +2463,7 @@ inner-join (hash) ├── cardinality: [0 - 1] ├── multiplicity: left-rows(exactly-one), right-rows(exactly-one) ├── key: () - ├── fd: ()-->(1-4,7-10), (7)==(1), (1)==(7), (2)==(8), (8)==(2), (3)==(9), (9)==(3), (4)==(10), (10)==(4) + ├── fd: ()-->(1-4,7-10), (1)==(7), (7)==(1), (2)==(8), (8)==(2), (3)==(9), (9)==(3), (4)==(10), (10)==(4) ├── prune: (2-4,8-10) ├── select │ ├── columns: xysd.x:1(int!null) xysd.y:2(int) xysd.s:3(string) xysd.d:4(decimal!null) @@ -2560,7 +2560,7 @@ inner-join (hash) ├── columns: k:1(int!null) v:2(int) r1:3(int!null) r2:4(int) x:7(int!null) y:8(int) s:9(string) d:10(decimal!null) x:13(int!null) y:14(int) s:15(string) d:16(decimal!null) ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) ├── key: (1) - ├── fd: (1)-->(2-4), (7)-->(8-10), (9,10)~~>(7,8), (13)-->(14-16), (15,16)~~>(13,14), (7)==(3,13), (13)==(3,7), (8)==(14), (14)==(8), (9)==(15), (15)==(9), (10)==(16), (16)==(10), (3)==(7,13) + ├── fd: (1)-->(2-4), (7)-->(8-10), (9,10)~~>(7,8), (13)-->(14-16), (15,16)~~>(13,14), (3)==(7,13), (7)==(3,13), (13)==(3,7), (8)==(14), (14)==(8), (9)==(15), (15)==(9), (10)==(16), (16)==(10) ├── prune: (1,2,4,8-10,14-16) ├── interesting orderings: (+1) (+7) (-9,+10,+7) (+13) (-15,+16,+13) ├── scan fk @@ -2609,7 +2609,7 @@ inner-join (hash) ├── columns: k:1(int!null) v:2(int) r1:3(int!null) r2:4(int) x:7(int!null) t:13(int!null) ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) ├── key: (1) - ├── fd: (1)-->(2-4), (7)==(3,13), (13)==(3,7), (3)==(7,13) + ├── fd: (1)-->(2-4), (3)==(7,13), (7)==(3,13), (13)==(3,7) ├── prune: (1,2,4,7) ├── interesting orderings: (+1) (+(7|13)) ├── scan fk @@ -3394,12 +3394,12 @@ project │ │ │ ├── outer: (2) │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(8-10,14-16,22), (10)==(9,15), (8)==(16), (16)==(8), (15)==(9,10), (14)==(22), (22)==(14), (9)==(10,15) + │ │ │ ├── fd: ()-->(8-10,14-16,22), (9)==(10,15), (10)==(9,15), (15)==(9,10), (8)==(16), (16)==(8), (14)==(22), (22)==(14) │ │ │ ├── interesting orderings: (+(9|10)) (+22) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: col1_8:8(bytes!null) col1_11:9(string!null) col1_12:10(string!null) col2_1:14(int4!null) col2_2:15(string!null) col2_3:16(bytes!null) table3_119441.col3_16:22(int!null) │ │ │ │ ├── outer: (2) - │ │ │ │ ├── fd: ()-->(9,10,15), (9)==(10,15), (10)==(9,15), (8)==(16), (16)==(8), (15)==(9,10), (14)==(22), (22)==(14) + │ │ │ │ ├── fd: ()-->(9,10,15), (9)==(10,15), (10)==(9,15), (15)==(9,10), (8)==(16), (16)==(8), (14)==(22), (22)==(14) │ │ │ │ ├── limit hint: 1.00 │ │ │ │ ├── interesting orderings: (+(9|10)) (+22) │ │ │ │ ├── top-k @@ -3413,7 +3413,7 @@ project │ │ │ │ │ └── prune: (22) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: col1_8:8(bytes!null) col1_11:9(string!null) col1_12:10(string!null) col2_1:14(int4) col2_2:15(string!null) col2_3:16(bytes!null) - │ │ │ │ │ ├── fd: (9)==(10,15), (10)==(9,15), (8)==(16), (16)==(8), (15)==(9,10) + │ │ │ │ │ ├── fd: (9)==(10,15), (10)==(9,15), (15)==(9,10), (8)==(16), (16)==(8) │ │ │ │ │ ├── prune: (14) │ │ │ │ │ ├── interesting orderings: (+(9|10)) │ │ │ │ │ ├── scan table2_119441 diff --git a/pkg/sql/opt/memo/testdata/logprops/limit b/pkg/sql/opt/memo/testdata/logprops/limit index cf5a1c0fc79b..19a05503e1c3 100644 --- a/pkg/sql/opt/memo/testdata/logprops/limit +++ b/pkg/sql/opt/memo/testdata/logprops/limit @@ -39,7 +39,7 @@ limit ├── columns: x:1(int!null) y:2(int!null) z:3(float!null) s:4(string) ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-4), (2)==(1), (1)==(2) + ├── fd: ()-->(1-4), (1)==(2), (2)==(1) ├── prune: (1-4) ├── interesting orderings: (+(1|2)) (-4,+3,+(1|2)) ├── project @@ -288,7 +288,7 @@ sort │ │ ├── k: 1 │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(11-13,16-18), (16)==(11), (13)==(18), (18)==(13), (12)==(17), (17)==(12), (11)==(16) + │ │ ├── fd: ()-->(11-13,16-18), (11)==(16), (16)==(11), (13)==(18), (18)==(13), (12)==(17), (17)==(12) │ │ ├── interesting orderings: (+(12|17)) │ │ └── inner-join (cross) │ │ ├── columns: t2.a:11(int!null) t2.b:12(int!null) t2.c:13(int!null) t3.a:16(int!null) t3.b:17(int!null) t3.c:18(int!null) diff --git a/pkg/sql/opt/memo/testdata/logprops/max1row b/pkg/sql/opt/memo/testdata/logprops/max1row index bb303c8a77ba..899b220ca0e5 100644 --- a/pkg/sql/opt/memo/testdata/logprops/max1row +++ b/pkg/sql/opt/memo/testdata/logprops/max1row @@ -63,7 +63,7 @@ select ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3), (3)==(2), (2)==(3) + ├── fd: ()-->(1-3), (2)==(3), (3)==(2) ├── scan abc │ ├── columns: a:1(int!null) b:2(int) c:3(int) │ ├── key: (1) diff --git a/pkg/sql/opt/memo/testdata/logprops/scan b/pkg/sql/opt/memo/testdata/logprops/scan index 1400445d7228..673f42a3822f 100644 --- a/pkg/sql/opt/memo/testdata/logprops/scan +++ b/pkg/sql/opt/memo/testdata/logprops/scan @@ -422,13 +422,13 @@ SELECT * FROM computed project ├── columns: i:1(int!null) s:2(string) d:3(decimal) c_i_expr:4(string!null) c_s:5(string) c_d:6(decimal) c_d_expr:7(string) ├── key: (1) - ├── fd: (1,4)-->(2,3,5-7), (3,7)~~>(1,2,4-6), (1)-->(4), (3)==(6), (6)==(3), (2)~~>(1,3-7), (2)==(5), (5)==(2) + ├── fd: (1,4)-->(2,3,5-7), (3,7)~~>(1,2,4-6), (1)-->(4), (2)~~>(1,3-7), (3)==(6), (6)==(3), (2)==(5), (5)==(2) ├── prune: (1-7) ├── interesting orderings: (+4,+1) (+7,+(3|6),+4,+1) └── project ├── columns: c_s:5(string) i:1(int!null) s:2(string) d:3(decimal) c_i_expr:4(string!null) c_d:6(decimal) c_d_expr:7(string) crdb_internal_mvcc_timestamp:8(decimal) tableoid:9(oid) ├── key: (1) - ├── fd: (1,4)-->(2,3,6-9), (3,7)~~>(1,2,4,6,8,9), (1)-->(4), (3)==(6), (6)==(3), (2)~~>(1,3,4,6-9), (2)==(5), (5)==(2) + ├── fd: (1,4)-->(2,3,6-9), (3,7)~~>(1,2,4,6,8,9), (1)-->(4), (2)~~>(1,3,4,6-9), (3)==(6), (6)==(3), (2)==(5), (5)==(2) ├── prune: (1-9) ├── interesting orderings: (+4,+1) (+7,+(3|6),+4,+1) ├── scan computed @@ -451,7 +451,7 @@ project │ │ └── cast: STRING [type=string] │ │ └── variable: d:3 [type=decimal] │ ├── key: (1) - │ ├── fd: (1,4)-->(2,3,6-9), (3,7)~~>(1,2,4,6,8,9), (1)-->(4), (3)==(6), (6)==(3), (2)~~>(1,3,4,6-9) + │ ├── fd: (1,4)-->(2,3,6-9), (3,7)~~>(1,2,4,6,8,9), (1)-->(4), (2)~~>(1,3,4,6-9), (3)==(6), (6)==(3) │ ├── prune: (1-4,6-9) │ └── interesting orderings: (+4,+1) (+7,+(3|6),+4,+1) └── projections diff --git a/pkg/sql/opt/memo/testdata/logprops/set b/pkg/sql/opt/memo/testdata/logprops/set index c793369eeb77..35d267f10574 100644 --- a/pkg/sql/opt/memo/testdata/logprops/set +++ b/pkg/sql/opt/memo/testdata/logprops/set @@ -53,7 +53,7 @@ intersect ├── left columns: xy.x:1(int) xy.y:2(int) xy.x:1(int) ├── right columns: v:6(int) u:5(int) rowid:7(int) ├── key: (12) - ├── fd: ()-->(11), (10)==(12), (12)==(10), (12)-->(10,11) + ├── fd: ()-->(11), (12)-->(10,11), (10)==(12), (12)==(10) ├── interesting orderings: (+12) ├── project │ ├── columns: xy.x:1(int!null) xy.y:2(int) @@ -369,7 +369,7 @@ distinct-on ├── columns: a:11(int!null) b:12(int) c:13(int!null) ├── grouping columns: a:11(int!null) ├── key: (11) - ├── fd: (11)==(13), (13)==(11), (11)-->(12,13) + ├── fd: (11)-->(12,13), (11)==(13), (13)==(11) ├── prune: (12,13) ├── union-all │ ├── columns: a:11(int!null) b:12(int) c:13(int!null) @@ -496,7 +496,7 @@ intersect-all ├── left columns: a:1(int!null) b:2(int) c:3(int) ├── right columns: a:6(int) b:7(int) c:8(int) ├── key: (1) - ├── fd: (1)==(2,3), (3)==(1,2), (2)==(1,3) + ├── fd: (1)==(2,3), (2)==(1,3), (3)==(1,2) ├── interesting orderings: (+1) ├── select │ ├── columns: a:1(int!null) b:2(int) c:3(int!null) @@ -681,7 +681,7 @@ intersect-all ├── right columns: column1:6(int) column2:7(int) column3:8(int) ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(9-11), (11)==(9,10), (9)==(10,11), (10)==(9,11) + ├── fd: ()-->(9-11), (9)==(10,11), (10)==(9,11), (11)==(9,10) ├── interesting orderings: (+(9|10|11)) ├── project │ ├── columns: coalesce:5(int!null) xy.x:1(int!null) @@ -715,7 +715,7 @@ except-all ├── left columns: xy.x:1(int) xy.x:1(int) coalesce:5(int) ├── right columns: column1:6(int) column2:7(int) column3:8(int) ├── key: (10) - ├── fd: (11)==(9,10), (9)==(10,11), (10)==(9,11) + ├── fd: (9)==(10,11), (10)==(9,11), (11)==(9,10) ├── interesting orderings: (+(9|10|11)) ├── project │ ├── columns: coalesce:5(int!null) xy.x:1(int!null) diff --git a/pkg/sql/opt/memo/testdata/logprops/update b/pkg/sql/opt/memo/testdata/logprops/update index 8e74b00d878c..4ba6f7901468 100644 --- a/pkg/sql/opt/memo/testdata/logprops/update +++ b/pkg/sql/opt/memo/testdata/logprops/update @@ -251,7 +251,7 @@ UPDATE abcde SET a=1 WHERE b=c RETURNING *; project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int) ├── volatile, mutations - ├── fd: ()-->(1), (2)==(3), (3)==(2), (2)-->(4) + ├── fd: ()-->(1), (2)-->(4), (2)==(3), (3)==(2) ├── prune: (1-4) └── update abcde ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int) rowid:5(int!null) @@ -267,12 +267,12 @@ project │ └── rowid:13 => rowid:5 ├── volatile, mutations ├── key: (5) - ├── fd: ()-->(1), (2)==(3), (3)==(2), (5)-->(2-4), (2)-->(4) + ├── fd: ()-->(1), (5)-->(2-4), (2)-->(4), (2)==(3), (3)==(2) └── project ├── columns: d_comp:19(int!null) a:9(int!null) b:10(int!null) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid) a_new:17(int!null) e_default:18(int!null) ├── immutable ├── key: (13) - ├── fd: ()-->(17,18), (13)-->(9-12,14-16), (10,11)-->(12), (10)==(11), (11)==(10), (11)-->(19) + ├── fd: ()-->(17,18), (13)-->(9-12,14-16), (10,11)-->(12), (11)-->(19), (10)==(11), (11)==(10) ├── prune: (9-19) ├── interesting orderings: (+13 opt(17,18)) ├── project diff --git a/pkg/sql/opt/memo/testdata/memo b/pkg/sql/opt/memo/testdata/memo index a27ba6177385..d903c2cf200a 100644 --- a/pkg/sql/opt/memo/testdata/memo +++ b/pkg/sql/opt/memo/testdata/memo @@ -128,7 +128,7 @@ WHERE a.y>1 AND a.x::string=b.x ORDER BY y LIMIT 10 ---- -memo (optimized, ~26KB, required=[presentation: y:2,x:6,c:11] [ordering: +2]) +memo (optimized, ~27KB, required=[presentation: y:2,x:6,c:11] [ordering: +2]) ├── G1: (project G2 G3 y x) │ ├── [presentation: y:2,x:6,c:11] [ordering: +2] │ │ ├── best: (project G2="[ordering: +2]" G3 y x) @@ -268,7 +268,7 @@ memo (optimized, ~9KB, required=[presentation: x:1]) memo SELECT x, y FROM a UNION SELECT x+1, y+1 FROM a ---- -memo (optimized, ~9KB, required=[presentation: x:13,y:14]) +memo (optimized, ~10KB, required=[presentation: x:13,y:14]) ├── G1: (union G2 G3) (union G2 G3 ordering=+13,+14) │ └── [presentation: x:13,y:14] │ ├── best: (union G2 G3) @@ -413,7 +413,7 @@ memo (optimized, ~6KB, required=[presentation: array_cat_agg:6]) memo SELECT DISTINCT info FROM [EXPLAIN SELECT 123 AS k] ---- -memo (optimized, ~9KB, required=[presentation: info:3]) +memo (optimized, ~10KB, required=[presentation: info:3]) ├── G1: (distinct-on G2 G3 cols=(3)) │ └── [presentation: info:3] │ ├── best: (distinct-on G2 G3 cols=(3)) diff --git a/pkg/sql/opt/memo/testdata/stats/inverted-geo b/pkg/sql/opt/memo/testdata/stats/inverted-geo index 81ae197dfc40..ebb66618acc6 100644 --- a/pkg/sql/opt/memo/testdata/stats/inverted-geo +++ b/pkg/sql/opt/memo/testdata/stats/inverted-geo @@ -91,7 +91,7 @@ project memo SELECT i FROM t WHERE st_intersects('LINESTRING(0.5 0.5, 0.7 0.7)', g) ORDER BY i LIMIT 1 ---- -memo (optimized, ~14KB, required=[presentation: i:1]) +memo (optimized, ~15KB, required=[presentation: i:1]) ├── G1: (project G2 G3 i) │ └── [presentation: i:1] │ ├── best: (project G2 G3 i) @@ -195,7 +195,7 @@ project memo SELECT i FROM t WHERE st_intersects('LINESTRING(100 100, 150 150)', g) ORDER BY i LIMIT 1 ---- -memo (optimized, ~14KB, required=[presentation: i:1]) +memo (optimized, ~15KB, required=[presentation: i:1]) ├── G1: (project G2 G3 i) │ └── [presentation: i:1] │ ├── best: (project G2 G3 i) diff --git a/pkg/sql/opt/memo/testdata/stats/set b/pkg/sql/opt/memo/testdata/stats/set index 47c035dd1b1f..c81a26d5e3c1 100644 --- a/pkg/sql/opt/memo/testdata/stats/set +++ b/pkg/sql/opt/memo/testdata/stats/set @@ -257,7 +257,7 @@ intersect ├── right columns: z:7(int) b.x:6(int) rowid:9(int) ├── stats: [rows=2.000001, distinct(12-14)=2, null(12-14)=0] ├── key: (14) - ├── fd: ()-->(13), (12)==(14), (14)==(12), (14)-->(12,13) + ├── fd: ()-->(13), (14)-->(12,13), (12)==(14), (14)==(12) ├── project │ ├── columns: a.x:1(int!null) a.y:2(int) │ ├── stats: [rows=5000, distinct(1,2)=5000, null(1,2)=0] diff --git a/pkg/sql/opt/memo/testdata/stats/update b/pkg/sql/opt/memo/testdata/stats/update index e1e9906fb9b5..8b07701262d0 100644 --- a/pkg/sql/opt/memo/testdata/stats/update +++ b/pkg/sql/opt/memo/testdata/stats/update @@ -172,7 +172,7 @@ with &2 (q) │ ├── volatile, mutations │ ├── stats: [rows=632.3046, distinct(11)=632.305, null(11)=0] │ ├── key: (3) - │ ├── fd: ()-->(2,11-13), (2)==(11), (11)==(2), (3)-->(1) + │ ├── fd: ()-->(2,11-13), (3)-->(1), (2)==(11), (11)==(2) │ ├── distinct-on │ │ ├── columns: x:6(int) child.c:7(int) rowid:8(int!null) child.crdb_internal_mvcc_timestamp:9(decimal) child.tableoid:10(oid) parent.p:11(int!null) parent.crdb_internal_mvcc_timestamp:12(decimal) parent.tableoid:13(oid) │ │ ├── grouping columns: rowid:8(int!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q02 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q02 index d396cd2281a8..4fb4576e7c6d 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q02 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q02 @@ -120,14 +120,14 @@ project │ │ │ │ ├── columns: s_suppkey:12(int!null) s_name:13(char!null) s_address:14(varchar!null) s_nationkey:15(int!null) s_phone:16(char!null) s_acctbal:17(float!null) s_comment:18(varchar!null) ps_partkey:21(int!null) ps_suppkey:22(int!null) ps_supplycost:24(float!null) n_nationkey:28(int!null) n_name:29(char!null) n_regionkey:30(int!null) r_regionkey:34(int!null) r_name:35(char!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) s_suppkey:46(int!null) s_nationkey:49(int!null) n_nationkey:55(int!null) n_regionkey:57(int!null) r_regionkey:61(int!null) r_name:62(char!null) │ │ │ │ ├── stats: [rows=233690.5, distinct(12)=9920, null(12)=0, distinct(13)=9990, null(13)=0, distinct(14)=10000, null(14)=0, distinct(15)=5, null(15)=0, distinct(16)=10000, null(16)=0, distinct(17)=9967, null(17)=0, distinct(18)=9934, null(18)=0, distinct(21)=110568, null(21)=0, distinct(22)=9920, null(22)=0, distinct(24)=76388.7, null(24)=0, distinct(28)=5, null(28)=0, distinct(29)=5, null(29)=0, distinct(30)=1, null(30)=0, distinct(34)=1, null(34)=0, distinct(35)=0.996222, null(35)=0, distinct(39)=110568, null(39)=0, distinct(40)=1844.81, null(40)=0, distinct(42)=75888.9, null(42)=0, distinct(46)=1844.81, null(46)=0, distinct(49)=5, null(49)=0, distinct(55)=5, null(55)=0, distinct(57)=1, null(57)=0, distinct(61)=1, null(61)=0, distinct(62)=0.996222, null(62)=0, distinct(21,22)=113914, null(21,22)=0] │ │ │ │ ├── key: (22,39,46) - │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (39,40)-->(42), (46)-->(49), (55)-->(57), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) + │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (39,40)-->(42), (46)-->(49), (55)-->(57), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── save-table-name: q2_inner_join_8 │ │ │ │ │ ├── columns: s_suppkey:12(int!null) s_name:13(char!null) s_address:14(varchar!null) s_nationkey:15(int!null) s_phone:16(char!null) s_acctbal:17(float!null) s_comment:18(varchar!null) ps_partkey:21(int!null) ps_suppkey:22(int!null) ps_supplycost:24(float!null) n_nationkey:28(int!null) n_name:29(char!null) n_regionkey:30(int!null) r_regionkey:34(int!null) r_name:35(char!null) │ │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) │ │ │ │ │ ├── stats: [rows=161290.3, distinct(12)=9920, null(12)=0, distinct(13)=9990, null(13)=0, distinct(14)=10000, null(14)=0, distinct(15)=5, null(15)=0, distinct(16)=10000, null(16)=0, distinct(17)=9967, null(17)=0, distinct(18)=9934, null(18)=0, distinct(21)=111321, null(21)=0, distinct(22)=9920, null(22)=0, distinct(24)=80888.4, null(24)=0, distinct(28)=5, null(28)=0, distinct(29)=5, null(29)=0, distinct(30)=1, null(30)=0, distinct(34)=1, null(34)=0, distinct(35)=0.996222, null(35)=0, distinct(21,22)=140582, null(21,22)=0] │ │ │ │ │ ├── key: (21,22) - │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15) + │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15) │ │ │ │ │ ├── scan partsupp │ │ │ │ │ │ ├── save-table-name: q2_scan_9 │ │ │ │ │ │ ├── columns: ps_partkey:21(int!null) ps_suppkey:22(int!null) ps_supplycost:24(float!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q05 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q05 index c0253301079c..19dd2df49c56 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q05 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q05 @@ -71,7 +71,7 @@ sort │ │ ├── columns: c_custkey:1(int!null) c_nationkey:4(int!null) o_orderkey:11(int!null) o_custkey:12(int!null) o_orderdate:15(date!null) l_orderkey:22(int!null) l_suppkey:24(int!null) l_extendedprice:27(float!null) l_discount:28(float!null) s_suppkey:40(int!null) s_nationkey:43(int!null) n_nationkey:49(int!null) n_name:50(char!null) n_regionkey:51(int!null) r_regionkey:55(int!null) r_name:56(char!null) │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) │ │ ├── stats: [rows=12896.98, distinct(1)=12897, null(1)=0, distinct(4)=5, null(4)=0, distinct(11)=12527.8, null(11)=0, distinct(12)=12897, null(12)=0, distinct(15)=365, null(15)=0, distinct(22)=12527.8, null(22)=0, distinct(24)=1843.11, null(24)=0, distinct(27)=12576, null(27)=0, distinct(28)=11, null(28)=0, distinct(40)=1843.11, null(40)=0, distinct(43)=5, null(43)=0, distinct(49)=5, null(49)=0, distinct(50)=5, null(50)=0, distinct(51)=1, null(51)=0, distinct(55)=1, null(55)=0, distinct(56)=0.996222, null(56)=0, distinct(27,28)=12601.8, null(27,28)=0] - │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(43,49) + │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (4)==(43,49), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1) │ │ ├── inner-join (lookup lineitem) │ │ │ ├── save-table-name: q5_lookup_join_5 │ │ │ ├── columns: c_custkey:1(int!null) c_nationkey:4(int!null) o_orderkey:11(int!null) o_custkey:12(int!null) o_orderdate:15(date!null) l_orderkey:22(int!null) l_suppkey:24(int!null) l_extendedprice:27(float!null) l_discount:28(float!null) n_nationkey:49(int!null) n_name:50(char!null) n_regionkey:51(int!null) r_regionkey:55(int!null) r_name:56(char!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q07 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q07 index 5aadac10ecee..d04aa3cedcb1 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q07 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q07 @@ -114,7 +114,7 @@ sort │ │ │ │ │ ├── key columns: [1] = [12] │ │ │ │ │ ├── stats: [rows=322646, distinct(1)=529.63, null(1)=0, distinct(4)=1.29975, null(4)=0, distinct(10)=290857, null(10)=0, distinct(12)=529.63, null(12)=0, distinct(13)=7, null(13)=0, distinct(49)=1.29975, null(49)=0, distinct(50)=1.33333, null(50)=0, distinct(55)=1.29975, null(55)=0, distinct(56)=1.33333, null(56)=0] │ │ │ │ │ ├── key: (10,13,55) - │ │ │ │ │ ├── fd: (1)-->(4), (49)-->(50), (55)-->(56), (4)==(49), (49)==(4), (10,13)-->(12), (1)==(12), (12)==(1) + │ │ │ │ │ ├── fd: (1)-->(4), (49)-->(50), (55)-->(56), (10,13)-->(12), (4)==(49), (49)==(4), (1)==(12), (12)==(1) │ │ │ │ │ ├── inner-join (lookup supplier@s_nk) │ │ │ │ │ │ ├── save-table-name: q7_lookup_join_9 │ │ │ │ │ │ ├── columns: s_suppkey:1(int!null) s_nationkey:4(int!null) n1.n_nationkey:49(int!null) n1.n_name:50(char!null) n2.n_nationkey:55(int!null) n2.n_name:56(char!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 index 77cdd560427e..3fce3f3e1260 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 @@ -94,7 +94,7 @@ sort │ │ │ │ ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null) c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) n2.n_nationkey:66(int!null) n2.n_name:67(char!null) r_regionkey:72(int!null) r_name:73(char!null) │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ │ ├── stats: [rows=4312.133, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(12)=3497.16, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=4233.58, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=3497.16, null(23)=0, distinct(26)=4275.82, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=4233.58, null(39)=0, distinct(40)=3992.96, null(40)=0, distinct(43)=728.995, null(43)=0, distinct(50)=3992.96, null(50)=0, distinct(53)=5, null(53)=0, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(66)=25, null(66)=0, distinct(67)=25, null(67)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0, distinct(26,27)=4278.28, null(26,27)=0, distinct(26,27,67)=4295.19, null(26,27,67)=0] - │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (66)-->(67), (15)==(66), (66)==(15), (1)==(22), (22)==(1) + │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (66)-->(67), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (15)==(66), (66)==(15), (1)==(22), (22)==(1) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── save-table-name: q8_inner_join_7 │ │ │ │ │ ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null) c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) r_regionkey:72(int!null) r_name:73(char!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q09 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q09 index 37a5a3e10270..c30f65694cdc 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q09 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q09 @@ -80,13 +80,13 @@ sort │ │ ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) o_orderkey:46(int!null) o_orderdate:50(date!null) n_nationkey:57(int!null) n_name:58(char!null) │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ ├── stats: [rows=2450.416, distinct(1)=1065.01, null(1)=0, distinct(2)=2405.95, null(2)=0, distinct(12)=1064.52, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=1066.43, null(21)=0, distinct(22)=1065.01, null(22)=0, distinct(23)=1064.52, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=958.165, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=958.326, null(39)=0, distinct(40)=958.326, null(40)=0, distinct(42)=956.829, null(42)=0, distinct(46)=1066.43, null(46)=0, distinct(50)=957.145, null(50)=0, distinct(57)=25, null(57)=0, distinct(58)=25, null(58)=0, distinct(50,58)=1548.5, null(50,58)=0, distinct(25-27,42)=958.326, null(25-27,42)=0] - │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (57)-->(58), (15)==(57), (57)==(15), (1)==(22,39) + │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (57)-->(58), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21), (15)==(57), (57)==(15) │ │ ├── inner-join (hash) │ │ │ ├── save-table-name: q9_inner_join_5 │ │ │ ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) o_orderkey:46(int!null) o_orderdate:50(date!null) │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) │ │ │ ├── stats: [rows=2450.416, distinct(1)=1223.85, null(1)=0, distinct(2)=2405.95, null(2)=0, distinct(12)=1224.18, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=1227.35, null(21)=0, distinct(22)=1223.85, null(22)=0, distinct(23)=1224.18, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1058.35, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1058.59, null(39)=0, distinct(40)=1058.59, null(40)=0, distinct(42)=1056.39, null(42)=0, distinct(46)=1227.35, null(46)=0, distinct(50)=1056.85, null(50)=0] - │ │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (1)==(22,39) + │ │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21) │ │ │ ├── scan supplier@s_nk │ │ │ │ ├── save-table-name: q9_scan_6 │ │ │ │ ├── columns: s_suppkey:12(int!null) s_nationkey:15(int!null) @@ -103,21 +103,21 @@ sort │ │ │ │ ├── key columns: [21] = [46] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── stats: [rows=2430.813, distinct(1)=1535.46, null(1)=0, distinct(2)=2387.05, null(2)=0, distinct(21)=1535.6, null(21)=0, distinct(22)=1535.46, null(22)=0, distinct(23)=1220.18, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1219.79, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1220.18, null(39)=0, distinct(40)=1220.18, null(40)=0, distinct(42)=1216.52, null(42)=0, distinct(46)=1535.6, null(46)=0, distinct(50)=1217.29, null(50)=0] - │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (1)==(22,39) + │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (46)-->(50), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21) │ │ │ │ ├── inner-join (lookup lineitem) │ │ │ │ │ ├── save-table-name: q9_lookup_join_8 │ │ │ │ │ ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) │ │ │ │ │ ├── key columns: [21 24] = [21 24] │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── stats: [rows=2430.813, distinct(1)=2429.06, null(1)=0, distinct(2)=2387.05, null(2)=0, distinct(21)=1535.6, null(21)=0, distinct(22)=2429.06, null(22)=0, distinct(23)=1536.11, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1535.27, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1536.11, null(39)=0, distinct(40)=1536.11, null(40)=0, distinct(42)=1528.33, null(42)=0] - │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (22)==(1,39), (39)==(1,22), (1)==(22,39) + │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22) │ │ │ │ │ ├── inner-join (lookup lineitem@l_pk_sk) │ │ │ │ │ │ ├── save-table-name: q9_lookup_join_9 │ │ │ │ │ │ ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_linenumber:24(int!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) │ │ │ │ │ │ ├── key columns: [39 40] = [22 23] │ │ │ │ │ │ ├── stats: [rows=812.7722, distinct(1)=807.834, null(1)=0, distinct(2)=807.748, null(2)=0, distinct(21)=812.556, null(21)=0, distinct(22)=812.772, null(22)=0, distinct(23)=812.772, null(23)=0, distinct(24)=7, null(24)=0, distinct(39)=812.772, null(39)=0, distinct(40)=812.772, null(40)=0, distinct(42)=809.246, null(42)=0] │ │ │ │ │ │ ├── key: (21,24) - │ │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (1)==(22,39), (39)==(1,22), (21,24)-->(22,23), (22)==(1,39), (23)==(40), (40)==(23) + │ │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (21,24)-->(22,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (23)==(40), (40)==(23) │ │ │ │ │ │ ├── inner-join (merge) │ │ │ │ │ │ │ ├── save-table-name: q9_merge_join_10 │ │ │ │ │ │ │ ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q10 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q10 index 7d62fb950063..4ac6f0bf960e 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q10 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q10 @@ -83,7 +83,7 @@ top-k │ │ ├── columns: c_custkey:1(int!null) c_name:2(varchar!null) c_address:3(varchar!null) c_nationkey:4(int!null) c_phone:5(char!null) c_acctbal:6(float!null) c_comment:8(varchar!null) o_orderkey:11(int!null) o_custkey:12(int!null) o_orderdate:15(date!null) l_orderkey:22(int!null) l_extendedprice:27(float!null) l_discount:28(float!null) l_returnflag:30(char!null) n_nationkey:40(int!null) n_name:41(char!null) │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ ├── stats: [rows=79341.61, distinct(1)=32163.1, null(1)=0, distinct(2)=45059.5, null(2)=0, distinct(3)=45057.1, null(3)=0, distinct(4)=25, null(4)=0, distinct(5)=45059.5, null(5)=0, distinct(6)=44685.4, null(6)=0, distinct(8)=45034, null(8)=0, distinct(11)=35816.5, null(11)=0, distinct(12)=32163.1, null(12)=0, distinct(15)=92, null(15)=0, distinct(22)=35816.5, null(22)=0, distinct(27)=39572.9, null(27)=0, distinct(28)=11, null(28)=0, distinct(30)=1, null(30)=0, distinct(40)=25, null(40)=0, distinct(41)=25, null(41)=0, distinct(27,28)=39820, null(27,28)=0] - │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (40)-->(41), (4)==(40), (40)==(4) + │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (40)-->(41), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(40), (40)==(4) │ │ ├── inner-join (hash) │ │ │ ├── save-table-name: q10_inner_join_5 │ │ │ ├── columns: c_custkey:1(int!null) c_name:2(varchar!null) c_address:3(varchar!null) c_nationkey:4(int!null) c_phone:5(char!null) c_acctbal:6(float!null) c_comment:8(varchar!null) o_orderkey:11(int!null) o_custkey:12(int!null) o_orderdate:15(date!null) l_orderkey:22(int!null) l_extendedprice:27(float!null) l_discount:28(float!null) l_returnflag:30(char!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q19 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q19 index 24f96fd2f6d3..efb4ce2af9d3 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q19 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q19 @@ -78,7 +78,7 @@ scalar-group-by │ │ ├── grouping columns: l_orderkey:1(int!null) l_linenumber:4(int!null) p_partkey:19(int!null) │ │ ├── stats: [rows=182.3692, distinct(1)=182.304, null(1)=0, distinct(2)=182.369, null(2)=0, distinct(4)=13.9999, null(4)=0, distinct(5)=182.369, null(5)=0, distinct(6)=182.369, null(6)=0, distinct(7)=182.369, null(7)=0, distinct(14)=182.369, null(14)=0, distinct(15)=182.369, null(15)=0, distinct(19)=163.44, null(19)=0, distinct(22)=182.369, null(22)=0, distinct(24)=182.369, null(24)=0, distinct(25)=182.369, null(25)=0, distinct(1,4,19)=182.369, null(1,4,19)=0] │ │ ├── key: (1,4,19) - │ │ ├── fd: (2)==(19), (19)==(2), (1,4,19)-->(2,5-7,14,15,22,24,25) + │ │ ├── fd: (1,4,19)-->(2,5-7,14,15,22,24,25), (2)==(19), (19)==(2) │ │ ├── union-all │ │ │ ├── save-table-name: q19_union_all_5 │ │ │ ├── columns: l_orderkey:1(int!null) l_partkey:2(int!null) l_linenumber:4(int!null) l_quantity:5(float!null) l_extendedprice:6(float!null) l_discount:7(float!null) l_shipinstruct:14(char!null) l_shipmode:15(char!null) p_partkey:19(int!null) p_brand:22(char!null) p_size:24(int!null) p_container:25(char!null) @@ -148,7 +148,7 @@ scalar-group-by │ │ │ ├── grouping columns: l_orderkey:61(int!null) l_linenumber:64(int!null) p_partkey:79(int!null) │ │ │ ├── stats: [rows=486.9996, distinct(61)=486.233, null(61)=0, distinct(62)=487, null(62)=0, distinct(64)=14, null(64)=0, distinct(65)=487, null(65)=0, distinct(66)=487, null(66)=0, distinct(67)=487, null(67)=0, distinct(74)=487, null(74)=0, distinct(75)=487, null(75)=0, distinct(79)=401.84, null(79)=0, distinct(82)=487, null(82)=0, distinct(84)=487, null(84)=0, distinct(85)=487, null(85)=0, distinct(61,64,79)=487, null(61,64,79)=0] │ │ │ ├── key: (61,64,79) - │ │ │ ├── fd: (62)==(79), (79)==(62), (61,64,79)-->(62,65-67,74,75,82,84,85) + │ │ │ ├── fd: (61,64,79)-->(62,65-67,74,75,82,84,85), (62)==(79), (79)==(62) │ │ │ ├── union-all │ │ │ │ ├── save-table-name: q19_union_all_12 │ │ │ │ ├── columns: l_orderkey:61(int!null) l_partkey:62(int!null) l_linenumber:64(int!null) l_quantity:65(float!null) l_extendedprice:66(float!null) l_discount:67(float!null) l_shipinstruct:74(char!null) l_shipmode:75(char!null) p_partkey:79(int!null) p_brand:82(char!null) p_size:84(int!null) p_container:85(char!null) diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q21 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q21 index ec9067d95bdc..af2d9bb54f02 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q21 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q21 @@ -106,7 +106,7 @@ top-k │ │ │ │ │ ├── key columns: [1] = [12] │ │ │ │ │ ├── stats: [rows=241984.5, distinct(1)=399.935, null(1)=0, distinct(2)=399.992, null(2)=0, distinct(4)=1, null(4)=0, distinct(10)=223798, null(10)=0, distinct(12)=399.935, null(12)=0, distinct(13)=7, null(13)=0, distinct(39)=1, null(39)=0, distinct(40)=1, null(40)=0] │ │ │ │ │ ├── key: (10,13) - │ │ │ │ │ ├── fd: ()-->(40), (1)-->(2,4), (4)==(39), (39)==(4), (10,13)-->(12), (1)==(12), (12)==(1) + │ │ │ │ │ ├── fd: ()-->(40), (1)-->(2,4), (10,13)-->(12), (4)==(39), (39)==(4), (1)==(12), (12)==(1) │ │ │ │ │ ├── inner-join (lookup supplier) │ │ │ │ │ │ ├── save-table-name: q21_lookup_join_8 │ │ │ │ │ │ ├── columns: s_suppkey:1(int!null) s_name:2(char!null) s_nationkey:4(int!null) n_nationkey:39(int!null) n_name:40(char!null) diff --git a/pkg/sql/opt/norm/testdata/rules/combo b/pkg/sql/opt/norm/testdata/rules/combo index c57b57a213a4..f36227aa858f 100644 --- a/pkg/sql/opt/norm/testdata/rules/combo +++ b/pkg/sql/opt/norm/testdata/rules/combo @@ -489,7 +489,7 @@ INNER JOIN a a3 ON a2.k = a3.k INNER JOIN a a4 ON a3.k = a4.k INNER JOIN a a5 ON a4.k = a5.k ---- -https://raduberinde.github.io/optsteps.html#eJzsXd1y2ziWvt-nwPrKXlFqEZRsSVOu6t50utYpr5ONM3sz6epiO_I2E1nKSvLs9G7t1NQ8Qy776fpJpvgjiQTxcwCBJKCc3LhCEhSJc86Hg_N9AP_v7P4_bs9mZ_cvb1--eEf-hfzw9vW_k5jE4fvlzd3dy7fk1eubu_QAJa_vSBwOPpHr7A97PsrO0_x8VD8_ys5H-flR_fw4Oz_Kz48Hn86Cs7vV-un75PHxbHbW7_dJ_M3NMtkm8eL9stfrkZ8P__32W9IPSS8MxpR8--37Ze_zevVx_rB9v-yR37_89vuXv_3-5W_kYbV4flpuZuTTLPzn5fNiQZIZJY-ziGxmI_JxNiafZpPdiSl5nIVDspmFIfk4C2naaLw7GV6mZ6_Ss5P07JR8mlG6v2dEHmd0RDYzOiYfZ_QyPTvdnY2G6U-GZDOLKPk4i6LqQ36a_zoj52FApxfVE48f0uMX_f775-Ewmp_T_vgiIOdRMLr461-LY2FAg-zo5HDdtB_SILzsh9OARn16GUTDfhSlF4XDIAwPjSfBNEgvHWeX0vRSOt1dOgbd8CoIJ6UbZheOg_AyqN9xcnF9fR6OA0rTV81_4vr6fHI4MM2uuAxoFETD7IrL9Mi0dGCYXXIV0FEQhfkTZEeGpSNhdmQS0HEQ0exI_tNh6QjNjkyD9GXyN8l_nB6OUArpAToK6LjWA3mHps9d7gFK8xdOOyF7YRrl7xdeFu9HR8XbhFfF29Bx8ezhpHh2elk8aTjdPekU8qRRmN6A_6S5oYJoeLjj_kmzH42G-yelxd0OT0pH2RF6eFKae2p0eFJ6WXj3l8K7k-Vyvu5_XCVLcv5LvPklO53948RvCj-7EI7DQRrFcThIAzkOB2ksx-EgDec4HDysP_z8U7LcztfLePHT058fHn7aJk_zzTZ--jy7TK_Yxj8v5qvkw-wqQ68dAsR0kIJATAcZDsR0kEFBTAcZGsRUfuswSi_Z3zscZdC3h5A4GmQoEkeDDEjiaJBhSRwNMjiJI_nt6TC9ZH97GmbIucegeDTIYCgeDTIkikeDDIzi0SDDo3ikuP1Vesnh9pMMkfcgFo8HGY7F40EGZfF4kKFZPB6kgJb-ld4-GqWX7G8fjTnGfnpebJPPi-Qh2f46I4v547a_Xv3P5nz-l_hhu_i1v1rOLwKyTv7rl-LE_87Xq_5q3X9arec872GAlTlbR9crPrrmx6v4OhKi6e5cCT7Dyz4NOWi5A8rirG_4GGbRTYcBvQqi7KVp_uvR4UiY4RkNAzoJogwTaP7ro9KREs6mkDXhwOoOS3dnmwLSq90LDHevNNk9brh73BLYptg65mDrDkr7-yb20TQ9Mjo8Ls29d3x4XDrhub0Mdv-O6OsI-oqNYg0l_y4ASyq5yGHMrAJmFS2rUMngJAOSDEIy8MhgIwOMDCoykMjgIQOGRyNhFQYZDGQAkEE_BvoY3JP4AwBMEFPAmKLsPNuxL4CAcKy-1lUkKMFACQNKAFCO_nLol-O-HPTliC-HeznWy4FejvJyiKu7tBxMD-vVZiNuckpBBX3JnXdOwN3SoI9CH2HzEC9JTP4Ub67j8EdVq5bNqvk4hQGU7178-WJgBZNupebd2qFXc_tW7dq8vrXpt_sbJ4vtfL2RX06qbXIvLWrFs5D8afW8na-vz1MYfFgtN9t1nCy3m-vzb8IZOf_m7o-3t6RPfrwQ249n7khp7rqduxm1-eEjGVu5gaM5EgpvDrMsa9IsQory_iwc721aJJxVs07KZv0D-SYcV-wckMcP17xxmmNRnuVHakc5mLzl2RnX1typFM_Iunl__a4K67JmLax5veunQ6wWUykmXseMZSnlWDY3Zz73yqcl4bhiW55RxxLjH6zZVimSb8aprMM_zPRLQqXbiQzHWqyw0_WuL_YW2xUHqxarGii12JRjsdxKRQVtWljvx_fLnHq7T54-L5LHX-_jp_l_xuuX__0cL5JtMt_syDjJBRk9F4xpiaEje4aOa2PXGDpubST1BHmGiQwdMnQ-M3REztARFsu9nnr6XSNufFisGfvY-lPthgywMmddrTF5g4_I0HnA0NXcXga7p1T48xt9xUaxhpIyhk50kcOYiQxdgwydyB8AYIKYolHrU3Se7diXMXSKa11FApcZOkWX8hg6QZNTCiroS5YZOliLRhk62COwDJ28VesMndbjHBg6UDMzhk6_W6l5t3bo1UKGTr9vbfptrWDcl1xOqm3sM3S8Xzkv7n5zT76_uX93c_fiXb7G5MV39-_Os5t-d09u7t5NLi7I67fVw__6-vXtBfTB_kC26Uh6IfYvEYOoi9rdZBViBhHoI2YMouDmNc_jXse6XFsMIvswIgZR4SitMYiK5ygxiCpzmDGI7F0V1mXN2iqDuP95EYMoMn5rDKLoAUoMorDDzRjEmklYw7EW65BBfLVKlj_sCc4Kd1g5hawhsobIGiJr6PZ02O-6NbKGyBoia4isIaIvsoY-YCayhsgaeo4pyBoia4isIbKGyBoia-gha9gJn6e_7hDweMgrygAAeUXkFZFXRF6RyA3HWqwDXvHN8-aXnDS8WW5Xr1bJ8nb-uN1Ri6KzFXbxCtlFZBeRXUR20bVps9_1bWQXkV1EdhHZRURfZBd9wExkF5Fd9BxTkF1EdhHZRU_YRRntYrpr6L7VfFGUsmRX-8JFynvqKC5Sa2fOBm9ttDls6_YzeSrNrWKbt6bWvqbu0IxIj4sdxCbwWlhU24xfaO3WS86362dAxoakNZLWSFojaY2kdZuk9dv50-rP87vV9u55sXixWn5ItslquSOtRWcL0voqI60vkbRG0hpJayStXavG-E2bIGmNpDWS1khaI_oiae0DZiJpjaS155iCpDWS1khae0Jawx7htOhnrWY2l8IqOGJQYzc7-bi-Pooj1hMTQEhA57hAM0oQCWaxdzW4_hqZWnVsI1OLTC0ytcjUts_UvlwkT8ky3s7vi5Q2p2hrhwtu9jLjZkPkZpGbRW4WuVnXig5-swPIzSI3i9wscrOIvsjN-oCZyM0iN-s5piA3i9wscrOecLPABcW7Qhbs6pPc3BjEAZoxulq3ZnsX1Lj1TjZ5Ks2-bp3R3bNuekwq7nMNNT3yrMizIs-KPCvyrMizAnjW2_nj9rvNZvWQxNv5q1Wy3LxN54w7vlV4uuBdQ-RdkXdF3hV5VzcLCn5X_pF3Rd4VeVfkXRF9kXf1ATORd22Qd2WLrRIwYUurBqwS4g-kJigogCNHexIcrcK6vGiCMYFeBxX0JcscLayFCxytCS_oGCHowjbOx22i3fV-yro7KDfSdYBxvUNqsvGhFfau2iNs-YSmG4zBDbQZ1ZMdQgVZCTLxYvxocEvtPROvyGxYJl43q-km6xZHLbCTzJh4wc1hGxmQ6sWtMfH6GrQIuvlB6-6g9VRgLLfjHFpbx-t9cL1jV4GKfFDjgRoP1HigxgM1Hqjx4HOYqPFAjYfDpQjUeKDGAzUeqPGQazz6rNvLyrc6fCxCdOcQLebeUQiCQhAnhSAKPhpBxYK6oyK_UFzraqy6zB1pkBRqqt4Vjl6XnLdDLWvS8Z3z8GAC3m73wCn3U-LaG8-eFH3YDIfPKeArrmyXtccsqd1titShLmhxghEPfdcjIxP2I-AV86iuQXWNU_tcmG1c0ZVMwqCLAUFpRyYh_w3YphYdyyRgMiChAkskkwBP4FuugImzLFVHmMkk2Lsq5FWsF7Qqk9DQRI8MNNHdZOvaabUdu8PUR4LrnPICpWAKRTUoquHaF0U1KKpBUU3nopq-XFTTE5yuEbtIvnRek2x8yKzJAVB04xd-oujGd9GNiAJH-O0cfsVGqQhfRBc5DG5I6XQgfAEqATqXAIC5_yNZbSjb3x3Nr-b3LXWBxuY4p0Ds-Z42i2xjWSLAKWCJLmldFIDpMabHtvcdNNY-IDbaW0ncjJgCvk4ZZU6nmBMrjI0yJ8C7oswJZU4oc9LqYJQ5faUyJ8V4A9zlpSttiw5Uy3IpO9oWwc3NvuHUqrZFocaqq9xE2hZ1cb4tok5cGhC-rJm2pc-ajpWwsZZtVdsCWTk01lk51HLFCF7hsWNNhcqLvcAN2wrDNRM2vVk_LzPF0u38cftitdjsJE2cEyhmQjETipk8FDMRhVqpNnIjXf4V0C7mxkbjObO_U2UUq8Wxw-IJPwYjpL48oL5qiHZEBodOj07vhdPXRgKVMKp7AZDuLyu3zFLVa4z3CBHfRQQktj78h6lV56lVs4QhYD0dypFweDqZ4QnlSChHQjkSypFQjtRiZKIcCeVIKEdCORLKkTScA-VIXsiR2CeC7qTTlWhF8RySOoAd0Qp7V81vjrUqWqn9vEK0ku2yw1WtlM5UZCtjlK3USQ-UraBs5euUrfg7wfS93N6uDEXLFFodq9FNFuQbyGMjUXBaRIFN8QbmMZjHOJnHEPFUNQRt-mpPMCGcDmpIHSDfv1PLTzD36nzDQrtkRA3K97Nsq9vwuJbLwReTobAD8zXf8zXIBwkFQwCOBNY_xXAkYh_9oQcUdpyisENhbHion2DEQ9-1mcgUc8iwBijsuJZ_cFQh7JC36kbYofVMB2EHqNkRwg79Do7MO7jTkDcNSjvCDuAnZfmfTnJD2KHx8V_JZ7K6EnboQLUsl7Ij7IB9mkxwHesAne4zA91GpithByx55tUB7Ag7jvxKmhM7zXDGFSziYxHfwSK-aImgctNxIoInf-dAvte_pQayuv04EY4J0uuwQIwFYl8LxFLHhqLlCRaOGp-HQDqyCXATT3Qgl2Pl-JQqxxCLa2LACUKB1gs3GLLiwpVGKywp70rKGp3G1pUBTbspLus_2KHCDG97RJnZsNOjIzu9e3w4KnjtlJ4BPwTbIteFIjRk6JJ_zV_qfB190l_6TMBUzU5hWvYLGl7CukeHn_knYueo75rNd6iOts7mP4yqOmGnbC3dI1vmAKzlXVyZ-HKRPCXLeJutQfzj8sN8_SbXQN7OH7e7RYqKi4r1iuNsveLQx_WKffEKF9T5O1JLQ4qgAYqA4_aUOYFuj24PdfsuFtXW0pqvYV1mbUFLY-syMYa_shj2ZegSBQDFNZoYAO4NYpK5t48rKmsvtJ_wWV1H6dpwC5fMoWAMEcWvIVUkz1SunhHm3_4Snr4LxqQGsrrSh5uGcRCRl5ChYIyFNRSMeSAYkzo2FC1PUCXS8sIVfkc2AW7QlTHgDBAFY94KxiAW18SAE4QCrRduMGTFmhONVigYu-auQZZ2mnwhMrdpN4Ix_QcTLUmWtbW2Lhnc6fXFyXqd3j0-HBW8dgRjgB-CrWJ0QTAGGbrkS5elztfR-mXpMwFTNTuCMdkvaHgJ6x4drmkmYueoL2zmO1RHq5v5D6OqTtgRjEmXMcscgLW8EyueDQ3oQJFf_E5CHSnW7bFu3-6ybPAio5OcJ7YsLrc99VTcXQIzWCM64RqRwtjwUD_BiIe-azORKZ5SwhpgKeiau3YQWgWSt-qmAKT1TKLFgvbLPvodXF8i6Eqxx6CLAUFpp8Qj_w3FOh83CjuK8Ua-CLDzco4OVMtyKTtFHMHNYX7AOkCHa_0OT1Eo85LVUrRO8beqw-b1nWyyH5CdyypXExbAXDROZtFw33gKaZzBedH6cRaF-9bhENI8GwWK5ptZRA_NQ2HzUqBmg0fR_OMsig7NO1pNNyS9MBiNTmY1HcXVdFiHcaoOU3fSIudAJ3XFSRvSeDXiqrhSTXOlGsWVau5FHA4LAnetzkfRXd1wV98GCCKemX9tq8D8Y5MVq8B4O-Ujm4zDVRdssmGYaaWBzcSkSrTBrQtjmOEwyxlm1bwrfvGvcYnFKfRh3afsstX4WcML1JFcKNYaHYFnJxmSrXzWEKTwknHVqBwBKkfMJCNOaUV0RSL21SFmspDW9SCC0VQcXPixUPxYqFbg4cdC8WOhjqiz8GOhInewps6y42uCUcmDL5GCxGht-TvbjVwdWvUiUvUmlQ5N1ViqQ1M1VujQVM0VOjT5J06VOjSVCu7I5vtez33WUP2Xg5Cp-i-HLmP1X454xuq_HCi7Vv-NRqQXBtHkVNR_RbqAvDkW9E0K-jyt3sQlqV7N_rUOrtm_1uN1-9dtULd_3Sp1-7dkJ57b17287tN1D676Kwrr9IR11bmZE_GBiOsd4gqca-KcCg6xt2HsZYyNmjWfxDRyzRq3jIdiGhwJDiOByDu-TjGN8iXbEILIiu9IhQGpMDMOzCnyS5f1sk93mfFcjhFc2sxWM5SWGc3Q1RYDbeZGWt4BjkeV0JhHNzWaGuFEptGJjMiWQL2RG0IjsMLoCKwnzB2RvysxSarm0H0kTAg4cLfxCDh4t3EJOHi3cQk4OO3JJeDgtKdR832v5yONIe2Zj0ymtGc-nhnTnvkwaEx75qOnGe35Zv28nN8_xMsXq8VmR3MyB3NaM5r4S2uKiqHOsJqYPjScPtixs9CqaEPkEbvgEWsvXUU35iRC3OmGh1VeD3EOObsWODv1m_hXl5L3Ka_Oi3Upf4NVp8aIoOoAqJoRSG7VDw2eQrkGXklD2V_uKLmjJFawxIklTvslTni3ydcYmNQowd3Gq1HCu41bo4R3G7dGyW1uvUa5X3XxZpc4Mqsx9scrlcp8--X-Ptvs8asGHpcvcbrnf2bSV5S1akWcr6GsJZTHWy9roet36fqMIdlKh1rTC610KJS0nLTXpNJReyEn1MlNVTrkfapb6cBAdCAQW58dA0WzZvNS6SxSFO-VWaT0g7qqWaSqsXQWqWqsmEWqmpssdIfPIsHdxptFgruNN4uEdxt3FgnvNrhQBj6LBHcbbxYJ7jbeLBLebdxZJLzbuLNIuL6IO4vss03YWWRPkmL0bGQXnJscEovecTlFj5dOSJ_av0xC2H-TC-5JzB_cyh84JqoLc61mDeLbcR3nyFyBE8LMd9nMMgRJO8XX2EzzAklL5TfYTLMBSO_wt6wxywFAvSPYqMZ05Af1jkDeaqpsNRW1mutZzaWspmN7TzKsnwVnL__yebFaz79PHh_PZmd5tfjtfLX-MF-_WiXLvaC1eqyoEo9KVWKBogxrwziudlwbFtfGrJTFpBWxI2U_XMXPSSWu0vwDC1_OBxig5mW53AWpdNkrcqnqW6alLdOqlnlBy7yWZV7GMq1gmRavzOtW5iUr82qVaaHKtEZlXp4yr0yZF6W8rjnJiml5kv1vq2SzLWQXP6xXTzdp-pym17uMW3IBJ_3u89Lv3mmsMcNE3P88wetEvM8npE8qERf23-SCexITcbcCrDxccseC44PMDiNx2LuW51HWoV1ZWw-BtXWDtAKSXRyZZJzy3IuD2oy2wFRWYKooMBcTmOsIzCUEpuoBU-GAuWbAXC5grhQwFQmY6gPMpQHmqgBzQYBcC8AGNucSAc2nGaq8BgpiTzs4eU2UVJ52OEpfXfq9CThrpx158leXf0tCh6DTDDLpq0v3mdHh4rTjqWcQSEcQajh5x7mFG3MLophbWMib7ZBGB5dzY27hvW5HMcUIgVMM-HYK6rmTYn6hUdJRGK5v13Di23HrLPZ5KzZLE86rpEmxdLUvnMXSztLk-a98Ja8OYaWZpUlfXbpKV4eb0s7S5K8uX4ELp6E0szT5q8tX1-owTtpZ2tn__9M_AgAA__9V3MKw +https://raduberinde.github.io/optsteps.html#eJzsXd1y2ziWvt-nwPrKXlFqERRtSVOu6t50utYpr5ONM3szmepiO_I2E1nKSvLsZLd2amqeIZfzdP0kU_yRRIL4OYBAEmROblwBCYjEwflwcL4P4P-d3f_H7dn87P7l7csX78i_kJ_evv53EpHIf7-6ubt7-Za8en1zlxRQ8vqORP7oE7lO_7DXg_Q6za4H1euT9HqQXZ9Ur4fp9Ul2PRx9OvPO7tabpx_jx8ez-dlwOCTRdzereBdHy_erwWBAfjn-9_vvydAnA98LKfn--_erwefN-uPiYfd-NSC_ff37b1__-tvXv5KH9fL5abWdk09z_59Xz8slieeUPM4Dsp1PyMd5SD7Np_sLM_I498dkO_d98nHu06RSuL_oXyZXr5Kr0-TqjHyaU3poMyCPczoh2zkNycc5vUyuzvZXg3Hykz7ZzgNKPs6DoPyQnxZf5uTc9-jsonzh8UNSfjEcvn8ej4PFOR2GFx45D7zJxV_-kpf5HvXS0unxvtnQp55_OfRnHg2G9NILxsMgSG7yx57vHytPvZmX3Bqmt9LkVjrb3xqCGrzy_GmhwfTG0PMvvWqLlEJapBOPhpUWswf0aOCVWpxBWgx8L6CCFrMH9IKxl907vbi-PvfD9LdmeTdcX59PjwWUZgXJTbP8IQ4FNClI_-9fJg8bjNM2LpOS2bGABlmBf5kXBONDAc0NlTZy5dGJF_hZT6cl42MJneQl_lVeEvjHEjpJa2UlU4-GSSckJdkr-scSGuYl_jQvCeixhKajy89KZkn355bPXpMeS-hlXuLP8pIgOJbQy3x0f81Hd7xaLTbDj-t4Rc5_jba_ppfTfxz_TeBn78KRP0q8OPJHiSNH_ijx5cgfJe4c-aOHzYdffo5Xu8VmFS1_fvrTw8PPu_hpsd1FT5_nl8kdu-iX5WIdf5hfpei1R4CIjhIQiOgoxYGIjlIoiOgoRYOIypv2g-SWQ9v-JIW-A4REwShFkSgYpUASBaMUS6JglMJJFMibp-PklkPz1E-R84BB0WSUwlA0GaVIFE1GKRhFk1GKR9FE0fxVcsux-WmKyAcQi8JRimNROEqhLApHKZpF4SgBtOSvtPlgktxyaD4IOcZ-el7u4s_L-CHefZmT5eJxN9ys_2d7vvhz9LBbfhmuV4sLj2zi__o1v_C_i816uN4Mn9abBW_0MMDKXK2i6xUfXbPyMr5OhGi6v1aAT_9ySH0OWu6BMr9axMcEwqYcONxj4P5qAQATvAs5eLeHt_wqIlyNCJfUSkvo2KNXXpA-Ic3eNCiUXO1LxnlJMDmW0HS8-WkJ9T069TLL0exNJ4WS6b7Ez0uC8FhCp7xhL4PdvyH6OoK-YqNYQ8m_CcCSSm7qA2YeAbCMfmXoK8NcGePKAMeAGYNkDIwxiMXAFYNVDCwxmMQAEoM9DPAwqMMADIMuDLRIxgMATBBTwJii7Dzbvi-AAD9U3-scEuRuXfDpggsX_LforkVfLXpm0S2LTlj0wKK_FZ2t6FpFv1J3adGZHjbr7VZcpU9OBX3J_eicgrulxjEKfYTtQ7QiEflDtL2O_D-qajVsVs3HyQ2gfPf8z1cDK5h0KzXv1hZHNbdv1UOb17c2x-2h4Xi5W2y28ttJuU42SvNc8dwnf1g_7xab6_MEBh_Wq-1uE8Wr3fb6_Dt_Ts6_u_v97S0Zkj9eiO3HM3egNHfVzu3M2nz3kcytXMfRnAmFjcMsy5o09ZA8vT_3w4NN8xC5bNZp0ay_I9_5YcnOHnn8cM2bpzkW5Vl-oh4oR5M3vDrj2pq7lOIZWXcVU21VYV3WrLk1r_f9dPTVfF3E-GvIWJZSjmUzcxYXUn5Ysi3PqKHE-EdrNpWK5JtxJuvwD3P9NFyhOZHhWIvldrre98XBYvu0XdliZQMlFptxLJZZqZjkozSxWEa93cdPn5fx45f76Gnxn9Hm5X8_R8t4Fy-2ezJOckNKz3khLTB05MDQcW3sGkPHzY0kI0EeYSJDhwxdd_PX2eiWMHSExfJOLz27nSOufVqsGPvU_FOlQQZYmavO5ZiQoes8wrnH0FWGvQx2-5T46zb6io1iDSVlDJ3opj5gJjJ0-gydaDwAwAQxRSPXp-g8274vY-gU9zqHBB1g6BRdymPoBFX65FTQlywydLAatTJ0sEdgGTp5rcYZOq3HOTJ0oGpmDJ1-t1Lzbm1xVAsZOv2-tTluKwnjoeR2Uq5jn6Hj_cp53vrNPfnx5v7dzd2Ld9kekxc_3L87Txv94Z7c3L2bXlyQ12_Lxf_6-vXtBfTBfkd2yUx6IR5fIgZRF7XbiSrEDCJwjJgxiILGKyOPex875JpiENmHETGIioHSGIOoeI4Cg6gyhxmDyLaqsC5r1kYZxMPPixhEkfEbYxBFD1BgEIUdbsYgVkzCGo61WIsM4qt1vPrpQHCWuMPSJWQNkTVE1rBzOXVkDTuUt0bWsAMZcGQN3UI4ZA0RfZE1dBszkTVE1tBNTEHWEFlDZA2RNUTWEFnDDrKGrfB5-vsOAY-HvKIMAJBXRF4ReUXkFYnccKzFWuAV3zxvf81Iw5vVbv1qHa9uF4-7PbUoulpiF6-QXUR2EdnFDuTekV3sUH4b2cUOZMqRXXQL4ZBdRPRFdtFtzER2EdlFNzEF2UVkF5Fd7Ai7KKNdTE8NPdRaLPNUluzurnCR8p46iYvUOpmzxqaNDodt3H4mT6V5VGz91tQ619QdmhHpcfEAsQm8FjbV1jMutE7rJee7zTMgYkPSGklrJK2RtEbSuknS-u3iaf2nxd16d_e8XL5Yrz7Eu3i92pPWoqs5aX2VktaXSFojaY2kdQcoHSStO0SbIGndAQIGSWu3EA5Ja0RfJK3dxkwkrZG0dhNTkLRG0hpJ646Q1rBH6Bf9rFXN5lZYBUcMquxmJ5_W1ydxxHpiAggJ6BwXaEYJIsEsHl017r9Gplbt28jUIlOLTC0ytc0ztS-X8VO8inaL-zykzSjaSnHOzV6m3KyP3Cxys8jNdoC5QG62Q-wAcrMd4BmQm3UL4ZCbRfRFbtZtzERuFrlZNzEFuVnkZpGb7Qg3C9xQvE9kwe7u5eHGIA7QjNHVaprtXVDlxjvZ5Kk0-7pxRvfAuukxqXjONdT0yLMiz4o8K_KsyLMizwrgWW8Xj7sfttv1QxztFq_W8Wr7Nlkz7vlW4eWcd_WRd0XeFXnXzrASyLt2KPOPvGsHOATkXd1COORdEX2Rd3UbM5F31edd2WSrBEzY1KoBq4T4A8kJChLgyNH2gqNVWJfnTTAmsNNOBX3JIkcLq-ECR2vCCzpGCLpwjPNph2i3fZ6y7gnKtXQdYF5vkZqsfWqFvav2DFu8oDkMQnAFbUa1t1OoICpBJl6MHzUeqX1g4hWRDcvE60Y17UTdYq8FdpIZEy9oHHaQASnf3BgTr69BC6CHHzQ-HLSeCozldgaH1tHxeh9cb3moQEU-qPFAjQdqPFDjgRoP1HigxgM1Hp1LRaDGAzUeqPFwC-Hc03gM2WEvS9_q8LEI0a1DtJh7RyEICkGcFIIo-GgEFQvqjpL8QnGvc77aAe5Ig6RQU_WucPS65LwdalmTjm-dhwcT8Ha7B06594lrrz16UvRhPRw-J4GvuLMh1h6jpEaiJDZqVru6oEYPPR76rid6JuxHwDvmUV2D6hqnzrkwO7iiLZmEQRcDnNKOTEL-G7BDLVqWScBkQEIFlkgmAV7AN5wBE0dZqo4wk0mwrSrkVewoaFQmoaGJnhhootuJ1rXDajt2h6mPBPc5NQqUgikU1aCohmtfFNWgqAZFNRdti2qGclHNQHC5Quwi-dJ6TrL2KbMiB0DRDYpuOo6AHRPdiChwhN_W4VdslJLwRXRTH8ANKR17whegEqB1CQCY-z-R1Yay_e3R_Gp-31IXaByO0wdir-ths8g2liUCnASW6BZ3RQEYHmN4DDx30Fj7gNhobydxPWIK-D5l9xENY2KUOaHMCWVOKHNCmRPKnNyUOSnmG-ApL21pW3SgWhZL2dG2CBo3-4ZTo9oWhRqrqnITaVvUyfmmiDpxakD4smbaliFrOlbCxlq2UW0LZOdQqLNzqOGMETzDY8eaCpUXe4MbthW6aypserN5XqWKpdvF4-7FerndS5o4F1DMhGImNhmJYibnc5XiE4IqrDnS5a2nFpubRM2NjcZz5nyn0ixW8eM-iCeQ-nJrOnGP-qog2gkRHA56HPSdGPSVmUAljGpfAKT7y8ojs1T5GuMzQsStiIDE1of_MLRqPbSqlzAE7Kdzn7zH6QmnJ5QjOYONKEdCORLKkZzyeJQjoRwJ5UgoR7LglChHQjmSSsrwDcmR2CeCnqTTlmhF8RySPIAd0QrbquY3xxoVrVR-XiFaSU_Z4apWCldKspUQZStV0gNlKyhbcS6n1YhspbsLzK6n25uVoWiZQqtjNbrJgnwDeWwE1X4RBTbFGxjHYBzjnMsBpBqiJW0dggnhclBD6gD5_p1afoKxV-sHFtolIypQflhlWz2Gx7VYDr6ZzH0aFOM1tyYP9-I1yAcJBVMAzgTWP8VwImKf_KEH9xENhR2nn71o7Oo99Hjou9bjmWIOGVYBhR3X8g-OKoQd8lrtCDu0nuko7ABVO0HYod_BgXkHt-rypk5pR9gB_KQs_9NJbgg7ND7-K_lMVlvCDh2olsVSdoQdsE-TCe5jB0Cr58xAj5FpS9gBC555eQA7wo4Tv5LmxEkznHkFk_iYxHcuDyPeIqg8dJyI4Km7a6Cu57-lBrJ6_DgRzgnS-9xNp2CC2C1gci9BLB3YULTsYeKo9nUIpCPrADfxQgdyu7tQh5lj_cwxxOKaGNBDKNB64RpdVpy40qiFKeV9Slmj09i8MqBqO8ll_Qc7ZpjhdU9IMxt2enBip7ePDyc5r53UM-CHYEfkupCEhkxd8q_5SwdfS5_0lz4TMFSzk5iW_YLGKGGHR4uf-SfiwVE9NZs_oFo6Opv_MKrshJ20tfSMbNkAYC3v4s7El8v4KV5Fu3QP4u9XHxabN5kG8nbxuNtvUlTclO9XDNP9iuMu7lccine4oM4fKYJ-ZuISzOIMe8pcwGGvGPY4SGsdpCLuar-pthLWfAv7MisbWmrbl_lt-DBOXR1DhcrWHWb-QgfAScyh4Spde3dxR2XlhQ4LPqv7KF2bbuGSORSM4ZTaLYwSyTOVu2eE8Xd3Cc-uC8akBrK604cbhnEQkReQOamiQMGYW8DknmBMOrChaNlDlUjDG1f4HVkHuEF3xoAjQEegDgVjp2415ltcEwN6CAVaL1yjy4o1Jxq1UDB2zd2DLO00-UZkbtV2BGP6Dybakiyra21fMrjTq5uT9Tq9fXw4yXntCMYAPwTbxeiCYAwydcm3LksHX0v7l6XPBAzV7AjGZL-gMUrY4dHinmYiHhzVjc38AdXS7mb-w6iyE3YEY9JtzLIBwFreiR3PhgZ0IMkvfiehjhTz9pjManZbNniTUS_XiQ2Ly20vPRWtS2AGc0Q9zhEpjA139R56PPRd6_FM8ZISVgFTQdfcvYPQLJC8VjsJIK1nEm0WtJ_20e_g6hZBV5I9Bl0McEo7KR75byj2-biR2FHMN_JNgK2nc3SgWhZL2UniCBqHjQN2ALS41-_4FLkyL16vRPsU_14esFl-J13se2Q_ZJW7CXNgzivH82B8qDyDVE7hPK_9OA_8Q21_DKmezgJ59e08oMfqvrB6wVHTySOv_nEeBMfqLe2mG5OB700mvdlNR3E3HeZhnMrDVAdpHnP0dpDikKp1SBHcqaazU43iTjWcFlzzYeG-svJ6tKfDFQdXzRMEEa_Mv7VdYN1jkxW7wHgn5SObjIjSBpts6GZaYWA9PqkSbXDzwh1zM3SKZqZZNe-KX_yrXWLRhz6sjim7bDV-1hB1JPhZQxc_awhSeMm4alSOAJUjZpIRp7QiuiIR--oQM1lI43oQwWwqdi78WCh-LFTL8fBjofixUEfUWfixUNFwsKbOsjPWBLNSB75EChKjNTXe2W7k6tDKN5HyaFLp0FSVpTo0VWWFDk1VXaFDk3_iVKlDU6ngTqx-6PVszBqq_zIQMlX_ZdBlrP7LEM9Y_ZcBZdvqv8mEDHwvmPZF_ZeHC8ibY0LfllZv6pJUD-1fM6GDwjq4sK68NnPCPxBxO-ZxQhnc1DkVHI6EmrGXMTZq1rokppFr1rhpPBTToP-LTwX_tsU0ypdsQggiS74jFQakwsw4MKfIL13Wyz7dZcZzOUZwaTNb9VBaZjRDW0cMNBkbaY0OsD-qhMY8uqnW0AgDmWaWtIoJwAU5K1B3BjmvQh_rCdMi8ncFJklVHXqOhAkBB-42HgEH7zYuAQfvNi4BB6c9uQQcnPY0qn7o9WymMaQ9s5nJlPbM5jNj2jObBo1pz2z2NKM932yeV4v7h2j1Yr3c7mlOpjCjNYNpd2lNUTLUGVYTw4eawwc7dhZaFW2IPGIbPGLlpcvoxlxEiOuve1jl9RDnkLNrgLNTv0n38lLyPuXleTEv1V1n1ckxIqg6AKpmBJJb-UODp1DugVfSUPa3O0palPgKpjgxxWk_xQnvNvkeA5McJbjbeDlKeLdxc5TwbuPmKLnVrecoD7su3uwDR2Y3xqG8lKnMjl8eHqLNAT9r0OH0JS73uh-ZDBVprUoS51tIawnl8dbTWjj02xz6jCHZTIda0wvNdCiUtJyw1yTTUXkhJ9TJdWU65H2qm-lAR3TAERtfHQNFs2brUukqUuTvpVWk9IO6qlWkqrJ0FamqrFhFqqqbbHSHryLB3cZbRYK7jbeKhHcbdxUJ7za4UAa-igR3G28VCe423ioS3m3cVSS827irSLi-iLuKHLJV2FXkQBJiDGxEF5xGjoHF4LSYYsALJ6RP3b1IQth_0wvuRYwf3IofOCaqCnOtRg3i5rgD58RYgePCzHfZzCIEST3F19hM4wJJTeU32EyjAUjv8I-sMYsBQL0jOKjGdOYH9Y5A3mqqbDUVtZrrWc2lrKZz-0AyrZ95Zy___Hm53ix-jB8fz-ZnWbb47WK9-bDYvFrHq4OgtVyWZ4knhSyxQFGGuWGcV1vODYtzY1bSYtKM2ImyH67ip1eBqzT-wMSX8w4GyHlZTndBMl32klyq_JZpass0q2We0DLPZZmnsUwzWKbJK_O8lXnKyjxbZZqoMs1RmaenzDNT5kmpTuecZMm0LMj-t3W83eWyi58266ebJHxOwut9xC25gRN-D3nh96Afe8wwEO9-nNDpQHzIJ6R7FYgL-296wb2IgbhbDlacLrlzwelOZoeROJ5dyxtR1qFdmVv3gbl1g7ACEl2cGGT0ee3FQW1GW2AqKzBVFJiLCcx1BOYSAlP1gKlwwFwzYC4XMFcKmIoETPUB5tIAc1WAuSBArgVgHZtzi4Dm03RVXgUFsaftnLwqSipP2x2lry793gSctdP2PPmry78loUPQaTqZ9NWl58zocHHa_jQwcKQTCDVcvOPawo21BVGsLSzEzXZIo-OQc2Nt0XndjmKJ4QOXGPDjFNRrJ8X6QiOlozDc0K7hxM1x8yz2eSs2ShOuq6RBsXS3L5zF0o7S5PGvfCevDmGlGaVJX126S1eHm9KO0uSvLt-BC6ehNKM0-avLd9fqME7aUdrZ___TPwIAAP__j1rCsA== # Exploration patterns with varying costs. optsteps diff --git a/pkg/sql/opt/norm/testdata/rules/decorrelate b/pkg/sql/opt/norm/testdata/rules/decorrelate index 6f9209318c28..20cf8952c550 100644 --- a/pkg/sql/opt/norm/testdata/rules/decorrelate +++ b/pkg/sql/opt/norm/testdata/rules/decorrelate @@ -823,7 +823,7 @@ project ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8), (1)==(8), (8)==(1) ├── select │ ├── columns: k:1!null i:2 f:3 s:4 j:5 │ ├── key: (1) @@ -956,7 +956,7 @@ project ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,8,9), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8,9), (1)==(8), (8)==(1) ├── scan a │ ├── columns: k:1!null i:2 f:3 s:4 j:5 │ ├── key: (1) @@ -1452,7 +1452,7 @@ project │ │ ├── columns: k:1!null x:8 u:12 │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) │ │ ├── key: (1) - │ │ ├── fd: (8)==(12), (12)==(8), (1)-->(8,12) + │ │ ├── fd: (1)-->(8,12), (8)==(12), (12)==(8) │ │ ├── scan a │ │ │ ├── columns: k:1!null │ │ │ └── key: (1) @@ -1577,7 +1577,7 @@ select │ │ ├── columns: k:2!null i:3!null x:9!null y:10!null │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(2,3,9,10), (9)==(2), (3)==(10), (10)==(3), (2)==(9) + │ │ ├── fd: ()-->(2,3,9,10), (2)==(9), (9)==(2), (3)==(10), (10)==(3) │ │ ├── inner-join (hash) │ │ │ ├── columns: k:2!null i:3!null x:9!null y:10!null │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) @@ -2690,7 +2690,7 @@ group-by (hash) │ │ ├── inner-join (cross) │ │ │ ├── columns: x:1!null y:2 k:5!null i:6 i:13!null f:14!null column21:21!null │ │ │ ├── immutable - │ │ │ ├── fd: (1)-->(2), (2)-->(21), (14)==(21), (21)==(14), (5)-->(6) + │ │ │ ├── fd: (1)-->(2), (2)-->(21), (5)-->(6), (14)==(21), (21)==(14) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: x:1!null y:2 i:13!null f:14!null column21:21!null │ │ │ │ ├── immutable @@ -2979,7 +2979,7 @@ project │ ├── left-join (hash) │ │ ├── columns: k:1!null i:2 f:3 s:4 j:5 x:8!null u:12 v:13 │ │ ├── key: (1,12) - │ │ ├── fd: (1)-->(2-5), (1)==(8), (8)==(1), (12)-->(13) + │ │ ├── fd: (1)-->(2-5), (12)-->(13), (1)==(8), (8)==(1) │ │ ├── select │ │ │ ├── columns: k:1!null i:2 f:3 s:4 j:5 x:8!null │ │ │ ├── key: (1) @@ -3237,11 +3237,11 @@ group-by (hash) ├── select │ ├── columns: k:1!null i:2!null f:3 s:4 j:5 x:8!null u:12!null v:13!null row_num:16!null │ ├── key: (1,12) - │ ├── fd: (1)-->(2-5), (12)-->(13), (2)==(13), (13)==(2), (1,8,12)-->(16), (8)==(12), (12)==(8) + │ ├── fd: (1)-->(2-5), (12)-->(13), (1,8,12)-->(16), (2)==(13), (13)==(2), (8)==(12), (12)==(8) │ ├── window partition=(1,8) │ │ ├── columns: k:1!null i:2!null f:3 s:4 j:5 x:8!null u:12!null v:13!null row_num:16 │ │ ├── key: (1,8,12) - │ │ ├── fd: (1)-->(2-5), (12)-->(13), (2)==(13), (13)==(2), (1,8,12)-->(16) + │ │ ├── fd: (1)-->(2-5), (12)-->(13), (1,8,12)-->(16), (2)==(13), (13)==(2) │ │ ├── inner-join (cross) │ │ │ ├── columns: k:1!null i:2!null f:3 s:4 j:5 x:8!null u:12!null v:13!null │ │ │ ├── key: (1,8,12) @@ -3302,7 +3302,7 @@ project │ ├── left-join-apply │ │ ├── columns: x:1!null u:5 uv.v:6 k:9 i:10 f:11 row_num:16 │ │ ├── key: (1,9) - │ │ ├── fd: (1,5)-->(6), (1,9)-->(10,11), (1,5,9)-->(16), (5)==(9), (9)==(5) + │ │ ├── fd: (1,5)-->(6), (1,9)-->(10,11,16), (5)==(9), (9)==(5) │ │ ├── scan xy │ │ │ ├── columns: x:1!null │ │ │ └── key: (1) @@ -4137,7 +4137,7 @@ project ├── columns: k:1!null i:2!null f:3 s:4 j:5 y:9!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-5,9), (9)==(2), (2)==(9) + ├── fd: ()-->(1-5,9), (2)==(9), (9)==(2) ├── limit │ ├── columns: k:1!null i:2 f:3 s:4 j:5 y:9 │ ├── cardinality: [0 - 1] @@ -4764,7 +4764,7 @@ project ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,12), (12)==(1), (1)==(12) + ├── fd: ()-->(1-5,12), (1)==(12), (12)==(1) ├── scan a │ ├── columns: k:1!null i:2 f:3 s:4 j:5 │ ├── key: (1) @@ -4797,7 +4797,7 @@ project ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8), (1)==(8), (8)==(1) ├── scan a │ ├── columns: k:1!null i:2 f:3 s:4 j:5 │ ├── key: (1) @@ -4885,7 +4885,7 @@ project ├── fd: ()-->(23) ├── inner-join (hash) │ ├── columns: t1.i:2!null t2.i:9!null "?column?":22!null - │ ├── fd: ()-->(2,9,22), (2)==(9,22), (22)==(2,9), (9)==(2,22) + │ ├── fd: ()-->(2,9,22), (2)==(9,22), (9)==(2,22), (22)==(2,9) │ ├── inner-join (hash) │ │ ├── columns: t1.i:2!null "?column?":22!null │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) @@ -4943,11 +4943,11 @@ project ├── fd: ()-->(31) ├── inner-join (hash) │ ├── columns: t1.i:2!null t2.i:9!null "?column?":22!null "?column?":30!null - │ ├── fd: ()-->(2,9,22,30), (2)==(9,22,30), (30)==(2,9,22), (22)==(2,9,30), (9)==(2,22,30) + │ ├── fd: ()-->(2,9,22,30), (2)==(9,22,30), (9)==(2,22,30), (22)==(2,9,30), (30)==(2,9,22) │ ├── inner-join (hash) │ │ ├── columns: t1.i:2!null "?column?":22!null "?column?":30!null │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ ├── fd: ()-->(2,22,30), (2)==(22,30), (30)==(2,22), (22)==(2,30) + │ │ ├── fd: ()-->(2,22,30), (2)==(22,30), (22)==(2,30), (30)==(2,22) │ │ ├── inner-join (hash) │ │ │ ├── columns: t1.i:2!null "?column?":30!null │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) @@ -5062,7 +5062,7 @@ project ├── fd: ()-->(19) ├── inner-join (hash) │ ├── columns: t1.i:2!null t2.i:9!null x:15!null - │ ├── fd: ()-->(2,9,15), (2)==(9,15), (15)==(2,9), (9)==(2,15) + │ ├── fd: ()-->(2,9,15), (2)==(9,15), (9)==(2,15), (15)==(2,9) │ ├── inner-join (hash) │ │ ├── columns: t1.i:2!null x:15!null │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) @@ -7332,7 +7332,7 @@ SELECT * FROM xy_decimal INNER JOIN LATERAL (SELECT a, a+x FROM ab_decimal) ON a project ├── columns: x:1!null y:2 a:5!null "?column?":10!null ├── immutable - ├── fd: (1)-->(2), (1)==(5), (5)==(1), (5)-->(10) + ├── fd: (1)-->(2), (5)-->(10), (1)==(5), (5)==(1) ├── inner-join (hash) │ ├── columns: x:1!null y:2 a:5!null │ ├── multiplicity: left-rows(zero-or-more), right-rows(zero-or-one) diff --git a/pkg/sql/opt/norm/testdata/rules/inline b/pkg/sql/opt/norm/testdata/rules/inline index 20741a97f9d9..250699b598d0 100644 --- a/pkg/sql/opt/norm/testdata/rules/inline +++ b/pkg/sql/opt/norm/testdata/rules/inline @@ -1637,7 +1637,7 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,8), (8)==(1), (1)==(8) + │ ├── fd: ()-->(1,8), (1)==(8), (8)==(1) │ ├── scan a │ │ ├── columns: k:1!null │ │ └── key: (1) diff --git a/pkg/sql/opt/norm/testdata/rules/join b/pkg/sql/opt/norm/testdata/rules/join index c1db74ba5fc3..fd72055a30cb 100644 --- a/pkg/sql/opt/norm/testdata/rules/join +++ b/pkg/sql/opt/norm/testdata/rules/join @@ -912,7 +912,7 @@ project ├── columns: k:1!null i:2 f:3!null s:4 j:5 x:8!null y:9 "?column?":16 ├── immutable ├── key: (8) - ├── fd: (1)-->(2-5), (1,8)-->(9,16), (1)==(8), (8)==(1), (8)-->(16) + ├── fd: (1)-->(2-5), (1,8)-->(9,16), (8)-->(16), (1)==(8), (8)==(1) ├── scan a │ ├── columns: k:1!null i:2 f:3!null s:4 j:5 │ ├── key: (1) @@ -1338,25 +1338,25 @@ inner-join (hash) ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,8,9,12-14,17-19,22,23), (8)==(1,12,17,22), (17)==(1,8,12,22), (1)==(8,12,17,22), (22)==(1,8,12,17), (12)==(1,8,17,22) + ├── fd: ()-->(1-5,8,9,12-14,17-19,22,23), (1)==(8,12,17,22), (8)==(1,12,17,22), (12)==(1,8,17,22), (17)==(1,8,12,22), (22)==(1,8,12,17) ├── inner-join (hash) │ ├── columns: k:1!null i:2 f:3!null s:4 j:5 b.x:8!null b.y:9 c.x:12!null c.y:13!null c.z:14!null d.x:17!null d.y:18!null d.z:19!null │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1-5,8,9,12-14,17-19), (12)==(1,8,17), (8)==(1,12,17), (17)==(1,8,12), (1)==(8,12,17) + │ ├── fd: ()-->(1-5,8,9,12-14,17-19), (1)==(8,12,17), (8)==(1,12,17), (12)==(1,8,17), (17)==(1,8,12) │ ├── inner-join (hash) │ │ ├── columns: k:1!null i:2 f:3!null s:4 j:5 b.x:8!null b.y:9 c.x:12!null c.y:13!null c.z:14!null │ │ ├── cardinality: [0 - 1] │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ ├── key: () - │ │ ├── fd: ()-->(1-5,8,9,12-14), (1)==(8,12), (12)==(1,8), (8)==(1,12) + │ │ ├── fd: ()-->(1-5,8,9,12-14), (1)==(8,12), (8)==(1,12), (12)==(1,8) │ │ ├── inner-join (hash) │ │ │ ├── columns: k:1!null i:2 f:3!null s:4 j:5 b.x:8!null b.y:9 │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1-5,8,9), (8)==(1), (1)==(8) + │ │ │ ├── fd: ()-->(1-5,8,9), (1)==(8), (8)==(1) │ │ │ ├── select │ │ │ │ ├── columns: k:1!null i:2 f:3!null s:4 j:5 │ │ │ │ ├── cardinality: [0 - 1] @@ -1551,7 +1551,7 @@ inner-join (hash) ├── columns: b_x:1!null c_x:5!null x:10!null y:11!null z:12!null ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: (10) - ├── fd: (1)==(5,10), (5)==(1,10), (10)-->(11,12), (10)==(1,5) + ├── fd: (10)-->(11,12), (1)==(5,10), (5)==(1,10), (10)==(1,5) ├── inner-join (hash) │ ├── columns: b.x:1!null c.x:5!null │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) @@ -1579,7 +1579,7 @@ inner-join (hash) ├── columns: x:1!null y:2 x:5!null y:6!null z:7!null x:10!null y:11!null z:12!null ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: (10) - ├── fd: (1)-->(2), (5)-->(6,7), (10)-->(11,12), (5)==(1,10), (10)==(1,5), (1)==(5,10) + ├── fd: (1)-->(2), (5)-->(6,7), (10)-->(11,12), (1)==(5,10), (5)==(1,10), (10)==(1,5) ├── scan b │ ├── columns: b.x:1!null b.y:2 │ ├── key: (1) @@ -1642,7 +1642,7 @@ inner-join (hash) ├── columns: x:1!null y:2!null z:3!null x:6!null y:7!null z:8!null ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: (6) - ├── fd: (1)-->(3), (1)==(2,6,7), (2)==(1,6,7), (6)-->(8), (6)==(1,2,7), (7)==(1,2,6) + ├── fd: (1)-->(3), (6)-->(8), (1)==(2,6,7), (2)==(1,6,7), (6)==(1,2,7), (7)==(1,2,6) ├── select │ ├── columns: c.x:1!null c.y:2!null c.z:3!null │ ├── key: (1) @@ -1673,7 +1673,7 @@ inner-join (hash) ├── columns: x:1!null y:2!null z:3!null x:6!null y:7!null z:8!null ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: (6) - ├── fd: (1)-->(3), (1)==(2,6,7), (2)==(1,6,7), (6)-->(8), (6)==(1,2,7), (7)==(1,2,6) + ├── fd: (1)-->(3), (6)-->(8), (1)==(2,6,7), (2)==(1,6,7), (6)==(1,2,7), (7)==(1,2,6) ├── select │ ├── columns: c.x:1!null c.y:2!null c.z:3!null │ ├── key: (1) @@ -1930,7 +1930,7 @@ inner-join (hash) ├── columns: k:1!null i:2 f:3!null s:4 j:5 k:8!null i:9 f:10!null s:11 j:12 k:15!null i:16 f:17!null s:18 j:19 ├── multiplicity: left-rows(one-or-more), right-rows(one-or-more) ├── key: (1,8) - ├── fd: (8)-->(9-12), (8)==(15), (15)==(8), (9)==(16), (16)==(9), (10)==(3,17), (17)==(3,10), (11)==(18), (18)==(11), (12)==(19), (19)==(12), (1)-->(2-5), (3)==(10,17) + ├── fd: (8)-->(9-12), (1)-->(2-5), (8)==(15), (15)==(8), (9)==(16), (16)==(9), (3)==(10,17), (10)==(3,17), (17)==(3,10), (11)==(18), (18)==(11), (12)==(19), (19)==(12) ├── project │ ├── columns: a2.k:15!null a2.i:16 a2.f:17!null a2.s:18 a2.j:19 a.k:8!null a.i:9 a.f:10!null a.s:11 a.j:12 │ ├── key: (8) @@ -3189,7 +3189,7 @@ project ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) ├── immutable ├── key: (1) - ├── fd: (1)-->(2,9), (5)-->(6), (5)==(9), (9)==(5) + ├── fd: (1)-->(2,6,9), (5)-->(6), (5)==(9), (9)==(5) ├── project │ ├── columns: column9:9 x:1!null y:2 │ ├── immutable @@ -3584,7 +3584,7 @@ inner-join (hash) ├── columns: x:1!null y:2!null k:5!null i:6 f:7!null s:8 j:9 u:12!null v:13 ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: (12) - ├── fd: (1)-->(2), (5)-->(6-9), (2)==(5), (5)==(2), (12)-->(13), (1)==(12), (12)==(1) + ├── fd: (1)-->(2), (5)-->(6-9), (12)-->(13), (2)==(5), (5)==(2), (1)==(12), (12)==(1) ├── inner-join (hash) │ ├── columns: x:1!null y:2!null k:5!null i:6 f:7!null s:8 j:9 │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) diff --git a/pkg/sql/opt/norm/testdata/rules/limit b/pkg/sql/opt/norm/testdata/rules/limit index cf4d8370c84c..529d5cdeea8d 100644 --- a/pkg/sql/opt/norm/testdata/rules/limit +++ b/pkg/sql/opt/norm/testdata/rules/limit @@ -659,7 +659,7 @@ ordinality ├── columns: k:1!null i:2!null f:3!null s:4 j:5 ordinality:8!null ├── cardinality: [0 - 10] ├── key: (1) - ├── fd: (1)-->(2-5,8), (2)==(3), (3)==(2), (8)-->(1-5) + ├── fd: (1)-->(2-5,8), (8)-->(1-5), (2)==(3), (3)==(2) ├── ordering: +(2|3) [actual: +2] └── limit ├── columns: k:1!null i:2!null f:3!null s:4 j:5 diff --git a/pkg/sql/opt/norm/testdata/rules/prune_cols b/pkg/sql/opt/norm/testdata/rules/prune_cols index 6f55e568d4c3..bd52e123825a 100644 --- a/pkg/sql/opt/norm/testdata/rules/prune_cols +++ b/pkg/sql/opt/norm/testdata/rules/prune_cols @@ -985,7 +985,7 @@ project └── inner-join (cross) ├── columns: k:1!null i:2!null x:7!null x:11!null y:12!null ├── key: (7,11) - ├── fd: (1)-->(2), (1)==(7), (7)==(1), (11)-->(12) + ├── fd: (1)-->(2), (11)-->(12), (1)==(7), (7)==(1) ├── inner-join (hash) │ ├── columns: k:1!null i:2 x:7!null │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) diff --git a/pkg/sql/opt/norm/testdata/rules/reject_nulls b/pkg/sql/opt/norm/testdata/rules/reject_nulls index 18fb20f23247..c646cfb01a9f 100644 --- a/pkg/sql/opt/norm/testdata/rules/reject_nulls +++ b/pkg/sql/opt/norm/testdata/rules/reject_nulls @@ -767,7 +767,7 @@ inner-join (hash) ├── columns: k:1!null i:2 f:3 s:4 x:7!null y:8!null u:11!null v:12 ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) ├── key: (7) - ├── fd: (1)-->(2-4), (7)-->(8), (1)==(7), (7)==(1), (11)-->(12), (8)==(11), (11)==(8) + ├── fd: (1)-->(2-4), (7)-->(8), (11)-->(12), (1)==(7), (7)==(1), (8)==(11), (11)==(8) ├── inner-join (hash) │ ├── columns: k:1!null i:2 f:3 s:4 x:7!null y:8!null │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) @@ -849,7 +849,7 @@ inner-join (hash) ├── columns: k:1!null i:2 f:3 s:4 x:7!null y:8!null u:11!null v:12 ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) ├── key: (7) - ├── fd: (1)-->(2-4), (7)-->(8), (1)==(7), (7)==(1), (11)-->(12), (8)==(11), (11)==(8) + ├── fd: (1)-->(2-4), (7)-->(8), (11)-->(12), (1)==(7), (7)==(1), (8)==(11), (11)==(8) ├── inner-join (hash) │ ├── columns: k:1!null i:2 f:3 s:4 x:7!null y:8 │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) @@ -974,7 +974,7 @@ inner-join-apply │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(5-9), (6)==(5), (5)==(6) + │ ├── fd: ()-->(5-9), (5)==(6), (6)==(5) │ ├── values │ │ ├── columns: column1:5 │ │ ├── outer: (2) @@ -1136,7 +1136,7 @@ left-join-apply │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(5-7), (6)==(5), (5)==(6) + │ ├── fd: ()-->(5-7), (5)==(6), (6)==(5) │ ├── values │ │ ├── columns: column1:5 │ │ ├── outer: (1) diff --git a/pkg/sql/opt/norm/testdata/rules/scalar b/pkg/sql/opt/norm/testdata/rules/scalar index 50acaa42c5ff..31dd59800849 100644 --- a/pkg/sql/opt/norm/testdata/rules/scalar +++ b/pkg/sql/opt/norm/testdata/rules/scalar @@ -1791,7 +1791,7 @@ project │ ├── columns: b.k:1!null a.k:8!null array_agg:17!null │ ├── grouping columns: b.k:1!null │ ├── key: (1) - │ ├── fd: (1)==(8), (8)==(1), (1)-->(8,17) + │ ├── fd: (1)-->(8,17), (1)==(8), (8)==(1) │ ├── project │ │ ├── columns: a.k:8!null b.k:1!null │ │ ├── key: (1) diff --git a/pkg/sql/opt/norm/testdata/rules/select b/pkg/sql/opt/norm/testdata/rules/select index 923ba5f6475c..7ab3275b6737 100644 --- a/pkg/sql/opt/norm/testdata/rules/select +++ b/pkg/sql/opt/norm/testdata/rules/select @@ -307,7 +307,7 @@ inner-join (hash) ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1-5,8-12), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8-12), (1)==(8), (8)==(1) ├── select │ ├── columns: a.k:1!null a.i:2 f:3 s:4 j:5 │ ├── cardinality: [0 - 1] @@ -1322,12 +1322,12 @@ SELECT * FROM (SELECT k, i, max(s) m FROM a GROUP BY k, i) a WHERE i=k AND m='fo select ├── columns: k:1!null i:2!null m:8!null ├── key: (1) - ├── fd: ()-->(8), (1)==(2), (2)==(1), (1)-->(2) + ├── fd: ()-->(8), (1)-->(2), (1)==(2), (2)==(1) ├── group-by (hash) │ ├── columns: k:1!null i:2!null max:8 │ ├── grouping columns: k:1!null │ ├── key: (1) - │ ├── fd: (1)==(2), (2)==(1), (1)-->(2,8) + │ ├── fd: (1)-->(2,8), (1)==(2), (2)==(1) │ ├── select │ │ ├── columns: k:1!null i:2!null s:4 │ │ ├── key: (1) diff --git a/pkg/sql/opt/norm/testdata/rules/with b/pkg/sql/opt/norm/testdata/rules/with index b6564722ea2c..a3cb55e2ed9c 100644 --- a/pkg/sql/opt/norm/testdata/rules/with +++ b/pkg/sql/opt/norm/testdata/rules/with @@ -2051,7 +2051,7 @@ project │ │ ├── cardinality: [0 - 1] │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ ├── key: () - │ │ ├── fd: ()-->(5-8), (7)==(6), (6)==(7) + │ │ ├── fd: ()-->(5-8), (6)==(7), (7)==(6) │ │ ├── select │ │ │ ├── columns: i:5!null j:6 │ │ │ ├── cardinality: [0 - 1] @@ -2346,7 +2346,7 @@ with &2 (nested) │ │ ├── cardinality: [0 - 1] │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ ├── key: () - │ │ ├── fd: ()-->(7,8), (8)==(7), (7)==(8) + │ │ ├── fd: ()-->(7,8), (7)==(8), (8)==(7) │ │ ├── select │ │ │ ├── columns: i:7!null │ │ │ ├── cardinality: [0 - 1] @@ -2437,7 +2437,7 @@ with &1 (parent) │ │ ├── cardinality: [0 - 1] │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ ├── key: () - │ │ ├── fd: ()-->(7,8), (8)==(7), (7)==(8) + │ │ ├── fd: ()-->(7,8), (7)==(8), (8)==(7) │ │ ├── select │ │ │ ├── columns: i:7!null │ │ │ ├── cardinality: [0 - 1] @@ -2513,7 +2513,7 @@ project │ │ ├── columns: i:5!null j:6!null x:7!null y:8!null │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(5-8), (8)==(6), (6)==(8) + │ │ ├── fd: ()-->(5-8), (6)==(8), (8)==(6) │ │ ├── inner-join (hash) │ │ │ ├── columns: i:5!null j:6!null x:7!null y:8!null │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(zero-or-one) diff --git a/pkg/sql/opt/props/equiv_set.go b/pkg/sql/opt/props/equiv_set.go index 515fbb11b004..fc07c5dd7de8 100644 --- a/pkg/sql/opt/props/equiv_set.go +++ b/pkg/sql/opt/props/equiv_set.go @@ -14,9 +14,11 @@ import ( // EquivGroups describes a set of equivalence groups of columns. It can answer // queries about which columns are equivalent to one another. Equivalence groups // are always non-empty and disjoint. -// -// TODO(drewk): incorporate EquivGroups into FuncDepSets. type EquivGroups struct { + // groups contains the equiv groups in no particular order. It should never be + // accessed outside the EquivSet methods. Each ColSet should be considered + // immutable once it becomes part of the groups slice. To update an equiv + // group, replace it with a new ColSet. groups []opt.ColSet } @@ -182,11 +184,9 @@ func (eq *EquivGroups) AddFromFDs(fdset *FuncDepSet) { if buildutil.CrdbTestBuild { defer eq.verify() } - for i := range fdset.deps { - fd := &fdset.deps[i] - if fd.equiv { - eq.AddNoCopy(fd.from.Union(fd.to)) - } + for i := range fdset.equiv.groups { + // It's safe to not copy here because the equiv groups are immutable. + eq.AddNoCopy(fdset.equiv.groups[i]) } } @@ -342,6 +342,12 @@ func (eq *EquivGroups) removeTrivialGroups() { } } +// testOnlySetGroup is used to set the equiv group at a particular index. It is +// only allowed during tests. +func (eq *EquivGroups) testOnlySetGroup(idx int, newGroup opt.ColSet) { + eq.groups[idx] = newGroup +} + // verify asserts that the EquivGroups invariants are maintained. It should only // be used in test builds, and should be sprinkled even in read-only methods to // catch cases where a ColSet (e.g. one returned by Group()) is incorrectly diff --git a/pkg/sql/opt/props/func_dep.go b/pkg/sql/opt/props/func_dep.go index 136084c3a977..68c54bb43084 100644 --- a/pkg/sql/opt/props/func_dep.go +++ b/pkg/sql/opt/props/func_dep.go @@ -413,7 +413,7 @@ import ( // section above, this library takes a simplified approach so that it // doesn't need to allocate virtual columns in property derivation code. type FuncDepSet struct { - // deps contains the functional dependencies that have a non-trivial + // deps contains the non-equiv functional dependencies that have a non-trivial // determinant and dependant (i.e. not empty, with no overlapping columns): // // (a)-->(b,c) @@ -427,6 +427,9 @@ type FuncDepSet struct { // all referencing sets are treated as immutable. deps []funcDep + // equiv tracks the equivalencies separately from deps as an optimization. + equiv EquivGroups + // hasKey is: // - strictKey if the relation has no duplicate rows, which means at least // one subset of its columns form a key (all columns, if no other subset). @@ -483,11 +486,6 @@ type funcDep struct { // can map to different dependant values. See the NULL Values section in the // FuncDeps comment for more details. strict bool - - // equiv is true if the value of the determinant equals the value of each of - // the dependant columns, and false if there's no known equality relationship. - // If equiv is true, the determinant may only consist of a single column. - equiv bool } // StrictKey returns a strict key for the relation, if there is one. @@ -512,7 +510,7 @@ func (f *FuncDepSet) LaxKey() (_ opt.ColSet, ok bool) { // Empty is true if the set contains no FDs and no key. func (f *FuncDepSet) Empty() bool { - return len(f.deps) == 0 && f.hasKey == noKey + return len(f.deps) == 0 && f.equiv.Empty() && f.hasKey == noKey } // ColSet returns all columns referenced by the FD set. @@ -523,6 +521,9 @@ func (f *FuncDepSet) ColSet() opt.ColSet { cols.UnionWith(fd.from) cols.UnionWith(fd.to) } + for i := 0; i < f.equiv.GroupCount(); i++ { + cols.UnionWith(f.equiv.Group(i)) + } if f.hasKey != noKey { // There are cases where key columns don't show up in FDs. For example: // lax-key(2,3); ()-->(1) @@ -541,6 +542,7 @@ func (f *FuncDepSet) CopyFrom(fdset *FuncDepSet) { // Make certain to copy FDs to the slice owned by this set. f.deps = f.deps[:0] f.deps = append(f.deps, fdset.deps...) + f.equiv.CopyFrom(&fdset.equiv) f.key = fdset.key f.hasKey = fdset.hasKey } @@ -558,32 +560,27 @@ func (f *FuncDepSet) RemapFrom(fdset *FuncDepSet, oldCols, newCols opt.ColList) f.ProjectCols(colSet.Intersection(fromSet)) } n := 0 - var newEquivCols []opt.ColSet for i := 0; i < len(f.deps); i++ { - remappedFrom := opt.TranslateColSetStrict(f.deps[i].from, oldCols, newCols) - remappedTo := opt.TranslateColSetStrict(f.deps[i].to, oldCols, newCols) - if f.deps[i].equiv && remappedFrom.Len() != 1 { - // The original "from" column maps to more than one "to" column. Remove - // this FD, and keep track of the set of equivalent columns to be handled - // after the loop. - remappedFrom.UnionWith(remappedTo) - newEquivCols = append(newEquivCols, remappedFrom) - continue - } - f.deps[i].from = remappedFrom - f.deps[i].to = remappedTo + f.deps[i].from = opt.TranslateColSetStrict(f.deps[i].from, oldCols, newCols) + f.deps[i].to = opt.TranslateColSetStrict(f.deps[i].to, oldCols, newCols) if n != i { f.deps[n] = f.deps[i] } n++ } f.deps = f.deps[:n] + f.equiv.TranslateColsStrict(oldCols, newCols) f.key = opt.TranslateColSetStrict(f.key, oldCols, newCols) - if len(newEquivCols) > 0 { - for i := range newEquivCols { - f.addEquivalency(newEquivCols[i]) + var seenOldCols opt.ColSet + for i := range oldCols { + // If a "from" column maps to more than one "to" column, it is possible that + // there will be a new equivalency between the "to" columns that can be used + // to reduce the key. + if seenOldCols.Contains(oldCols[i]) { + f.tryToReduceKey(opt.ColSet{} /* notNullCols */) + break } - f.tryToReduceKey(opt.ColSet{} /* notNullCols */) + seenOldCols.Add(oldCols[i]) } } @@ -647,10 +644,10 @@ func (f *FuncDepSet) ReduceCols(cols opt.ColSet) opt.ColSet { var removed opt.ColSet cols = cols.Copy() for i, ok := cols.Next(0); ok; i, ok = cols.Next(i + 1) { - // First check if the column is present in any "to" set of a dependency. - // If not, then it is not redundant and must remain in the set. This is - // a fast-path to avoid the more expensive functional-dependency-closure - // test below, when possible. + // First check if the column is present in any "to" set of a dependency or + // is involved in an equivalency. If not, then it is not redundant and must + // remain in the set. This is a fast-path to avoid the more expensive + // functional-dependency-closure test below, when possible. inToSet := false for j := range f.deps { if f.deps[j].to.Contains(i) { @@ -658,7 +655,7 @@ func (f *FuncDepSet) ReduceCols(cols opt.ColSet) opt.ColSet { break } } - if !inToSet { + if !inToSet && !f.equiv.ContainsCol(i) { continue } @@ -695,14 +692,20 @@ func (f *FuncDepSet) InClosureOf(cols, in opt.ColSet) bool { // will be duplicates, since all other columns will be equal. func (f *FuncDepSet) ComputeClosure(cols opt.ColSet) opt.ColSet { cols = cols.Copy() - for i := 0; i < len(f.deps); i++ { - fd := &f.deps[i] - - if fd.strict && fd.from.SubsetOf(cols) && !fd.to.SubsetOf(cols) { - cols.UnionWith(fd.to) + for { + restart := false + cols = f.equiv.ComputeEquivClosureNoCopy(cols) + for i := 0; i < len(f.deps); i++ { + fd := &f.deps[i] + if fd.strict && fd.from.SubsetOf(cols) && !fd.to.SubsetOf(cols) { + cols.UnionWith(fd.to) - // Restart iteration to get transitive closure. - i = -1 + // Restart iteration to get transitive closure. + restart = true + } + } + if !restart { + break } } return cols @@ -710,20 +713,7 @@ func (f *FuncDepSet) ComputeClosure(cols opt.ColSet) opt.ColSet { // AreColsEquiv returns true if the two given columns are equivalent. func (f *FuncDepSet) AreColsEquiv(col1, col2 opt.ColumnID) bool { - if col1 == col2 { - return true - } - for i := range f.deps { - fd := &f.deps[i] - - if fd.equiv && fd.strict { - if (fd.from.Contains(col1) && fd.to.Contains(col2)) || - (fd.from.Contains(col2) && fd.to.Contains(col1)) { - return true - } - } - } - return false + return f.equiv.AreColsEquiv(col1, col2) } // ComputeEquivClosure returns the equivalence closure of the given columns. The @@ -748,15 +738,7 @@ func (f *FuncDepSet) ComputeEquivClosure(cols opt.ColSet) opt.ColSet { // be used when it is ok to mutate the argument. This avoids allocations when // columns overflow the small set of intsets.Fast. func (f *FuncDepSet) ComputeEquivClosureNoCopy(cols opt.ColSet) opt.ColSet { - // Don't need to get transitive closure, because equivalence closures are - // already maintained for every column. - for i := range f.deps { - fd := &f.deps[i] - if fd.equiv && fd.from.SubsetOf(cols) && !fd.to.SubsetOf(cols) { - cols.UnionWith(fd.to) - } - } - return cols + return f.equiv.ComputeEquivClosureNoCopy(cols) } // AddStrictKey adds an FD for a new key. The given key columns are reduced to a @@ -777,7 +759,7 @@ func (f *FuncDepSet) AddStrictKey(keyCols, allCols opt.ColSet) { // Ensure we have candidate key (i.e. has no columns that are functionally // determined by other columns). keyCols = f.ReduceCols(keyCols) - f.addDependency(keyCols, allCols, true /* strict */, false /* equiv */) + f.addDependency(keyCols, allCols, true /* strict */) // Try to use the new FD to reduce any existing key first. f.tryToReduceKey(opt.ColSet{} /* notNullCols */) @@ -803,7 +785,7 @@ func (f *FuncDepSet) AddLaxKey(keyCols, allCols opt.ColSet) { // Ensure we have candidate key (i.e. has no columns that are functionally // determined by other columns). - f.addDependency(keyCols, allCols, false /* strict */, false /* equiv */) + f.addDependency(keyCols, allCols, false /* strict */) // TODO(radu): without null column information, we cannot reduce lax keys (see // tryToReduceKey). Consider passing that information (or storing it with the @@ -836,39 +818,10 @@ func (f *FuncDepSet) AddLaxKey(keyCols, allCols opt.ColSet) { func (f *FuncDepSet) MakeMax1Row(cols opt.ColSet) { // Remove all FDs except for equivalency FDs with columns that are a subset // of cols. - copyIdx := 0 - for i := range f.deps { - fd := &f.deps[i] - - // Skip non-equivalence dependencies. - if !fd.equiv { - continue - } - - // If fd is an equivalence dependency, from has a single column. - fromCol, ok := fd.from.Next(0) - if !ok { - panic(errors.AssertionFailedf("equivalence dependency from cannot be empty")) - } - - // Add a new equivalence dependency with the same from column and the to - // columns that are present in cols. - if cols.Contains(fromCol) && fd.to.Intersects(cols) { - f.deps[copyIdx] = funcDep{ - from: fd.from, - to: fd.to.Intersection(cols), - strict: true, - equiv: true, - } - copyIdx++ - } - } - f.deps = f.deps[:copyIdx] - + f.deps = f.deps[:0] + f.equiv.ProjectCols(cols) if !cols.Empty() { f.deps = append(f.deps, funcDep{to: cols, strict: true}) - // The constant FD must be the first in the set. - f.deps[0], f.deps[len(f.deps)-1] = f.deps[len(f.deps)-1], f.deps[0] } f.setKey(opt.ColSet{}, strictKey) } @@ -901,9 +854,9 @@ func (f *FuncDepSet) MakeNotNull(notNullCols opt.ColSet) { } if firstLaxFD != nil { - f.addDependency(firstLaxFD.from, firstLaxFD.to, true /* strict */, false /* equiv */) + f.addDependency(firstLaxFD.from, firstLaxFD.to, true /* strict */) for i := range otherLaxFDs { - f.addDependency(otherLaxFDs[i].from, otherLaxFDs[i].to, true /* strict */, false /* equiv */) + f.addDependency(otherLaxFDs[i].from, otherLaxFDs[i].to, true /* strict */) } } @@ -918,7 +871,7 @@ func (f *FuncDepSet) MakeNotNull(notNullCols opt.ColSet) { // (a)==(b) // (b)==(a) func (f *FuncDepSet) AddEquivalency(a, b opt.ColumnID) { - if a == b { + if f.AreColsEquiv(a, b) { return } @@ -931,7 +884,7 @@ func (f *FuncDepSet) AddEquivalency(a, b opt.ColumnID) { // AddStrictDependency adds a new strict dependency to the set. func (f *FuncDepSet) AddStrictDependency(from, to opt.ColSet) { - f.addDependency(from, to, true /* strict */, false /* equiv */) + f.addDependency(from, to, true /* strict */) f.tryToReduceKey(opt.ColSet{} /* notNullCols */) } @@ -971,30 +924,27 @@ func (f *FuncDepSet) addConstantsNoKeyReduction(cols opt.ColSet) { f.deps[0].to = cols } - // Remove any other FDs made redundant by adding the constants. + // Remove any other non-equiv FDs made redundant by adding the constants. n := 1 for i := 1; i < len(f.deps); i++ { fd := &f.deps[i] - // Always retain equivalency information, even for constants. - if !fd.equiv { - if fd.strict { - // Constant columns can be removed from the determinant of a strict - // FD. If all determinant columns are constant, then the entire FD - // can be removed, since this means that the dependant columns must - // also be constant (and were part of constant closure added to the - // constant FD above). - if !fd.removeFromCols(cols) { - continue - } - } - - // Dependant constants are redundant, so remove them. - if !fd.removeToCols(cols) { + if fd.strict { + // Constant columns can be removed from the determinant of a strict + // FD. If all determinant columns are constant, then the entire FD + // can be removed, since this means that the dependant columns must + // also be constant (and were part of constant closure added to the + // constant FD above). + if !fd.removeFromCols(cols) { continue } } + // Dependant constants are redundant, so remove them. + if !fd.removeToCols(cols) { + continue + } + if n != i { f.deps[n] = f.deps[i] } @@ -1019,7 +969,7 @@ func (f *FuncDepSet) AddSynthesizedCol(from opt.ColSet, col opt.ColumnID) { var colSet opt.ColSet colSet.Add(col) - f.addDependency(from, colSet, true /* strict */, false /* equiv */) + f.addDependency(from, colSet, true /* strict */) f.tryToReduceKey(opt.ColSet{} /* notNullCols */) } @@ -1057,7 +1007,7 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // won't be lost. Also, track list of un-projected columns that are part of // non-equivalent determinants. It's possible these can be mapped to // equivalent columns. - var constCols, detCols, equivCols opt.ColSet + var constCols, detCols opt.ColSet for i := range f.deps { fd := &f.deps[i] @@ -1068,31 +1018,22 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // Add closures to dependants containing un-projected columns. if !fd.to.SubsetOf(cols) { - // Equivalence dependencies already maintain closure, so skip them. - if !fd.equiv { - fd.to = f.ComputeClosure(fd.to) - // Maintain the invariant that from and to columns don't overlap. - fd.to.DifferenceWith(fd.from) - } + fd.to = f.ComputeClosure(fd.to) + // Maintain the invariant that from and to columns don't overlap. + fd.to.DifferenceWith(fd.from) } // Track list of un-projected columns that can possibly be mapped to // equivalent columns. - if !fd.equiv && !fd.from.SubsetOf(cols) { + if !fd.from.SubsetOf(cols) { detCols.UnionWith(fd.from) - detCols.DifferenceWith(cols) - } - - // Track all columns that have equivalent alternates that are part of the - // projection. - if fd.equiv && fd.to.Intersects(cols) { - equivCols.UnionWith(fd.from) } } // Construct equivalence map that supports substitution of an equivalent // column in place of a removed column. - detCols.IntersectionWith(equivCols) + detCols.DifferenceWith(cols) + detCols.IntersectionWith(f.ComputeEquivClosure(cols)) equivMap := f.makeEquivMap(detCols, cols) // If constants were found, then normalize constants to preserve FDs in a @@ -1109,6 +1050,9 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { f.AddConstants(constCols) } + // Forget all equivalencies that involve un-projected columns. + f.equiv.ProjectCols(cols) + // During second pass, remove all dependencies with un-projected columns. var newFDs []funcDep n := 0 @@ -1119,7 +1063,7 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // constant columns from dependants for nicer presentation. if !fd.to.SubsetOf(cols) { fd.to = fd.to.Intersection(cols) - if !fd.isConstant() && !fd.equiv { + if !fd.isConstant() { fd.to.DifferenceWith(constCols) } if !fd.removeToCols(fd.from) { @@ -1129,12 +1073,6 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // Try to substitute equivalent columns for removed determinant columns. if !fd.from.SubsetOf(cols) { - if fd.equiv { - // Always discard equivalency with removed determinant, since other - // equivalencies will already include this column. - continue - } - // Start with "before" list of columns that need to be mapped, and try // to find an "after" list containing equivalent columns. var afterCols opt.ColSet @@ -1151,7 +1089,7 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // Dependency can be remapped using equivalencies. from := fd.from.Union(afterCols) from.DifferenceWith(beforeCols) - newFDs = append(newFDs, funcDep{from: from, to: fd.to, strict: fd.strict, equiv: fd.equiv}) + newFDs = append(newFDs, funcDep{from: from, to: fd.to, strict: fd.strict}) } continue } @@ -1165,7 +1103,7 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { for i := range newFDs { fd := &newFDs[i] - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) + f.addDependency(fd.from, fd.to, fd.strict) } // Ensure that key still determines all other columns. @@ -1179,9 +1117,13 @@ func (f *FuncDepSet) ProjectCols(cols opt.ColSet) { // "compatible", meaning that they operate on the same relations, with the same // keys, same columns, etc. func (f *FuncDepSet) AddFrom(fdset *FuncDepSet) { + for i := 0; i < fdset.equiv.GroupCount(); i++ { + // NOTE: the ColSet of an equiv group is immutable. + f.addEquivalency(fdset.equiv.Group(i)) + } for i := range fdset.deps { fd := &fdset.deps[i] - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) + f.addDependency(fd.from, fd.to, fd.strict) } f.tryToReduceKey(opt.ColSet{} /* notNullCols */) } @@ -1189,11 +1131,9 @@ func (f *FuncDepSet) AddFrom(fdset *FuncDepSet) { // AddEquivFrom is similar to AddFrom, except that it only adds equivalence // dependencies from the given set to this set. func (f *FuncDepSet) AddEquivFrom(fdset *FuncDepSet) { - for i := range fdset.deps { - fd := &fdset.deps[i] - if fd.equiv { - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) - } + for i := 0; i < fdset.equiv.GroupCount(); i++ { + // NOTE: the ColSet of an equiv group is immutable. + f.addEquivalency(fdset.equiv.Group(i)) } f.tryToReduceKey(opt.ColSet{} /* notNullCols */) } @@ -1205,10 +1145,11 @@ func (f *FuncDepSet) AddEquivFrom(fdset *FuncDepSet) { // concatenated, rather than simplified via calls to addDependency (except for // case of constant columns). func (f *FuncDepSet) MakeProduct(inner *FuncDepSet) { + f.equiv.AppendFromDisjoint(&inner.equiv) for i := range inner.deps { fd := &inner.deps[i] if fd.isConstant() { - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) + f.addDependency(fd.from, fd.to, fd.strict) } else { f.deps = append(f.deps, *fd) } @@ -1254,12 +1195,14 @@ func (f *FuncDepSet) MakeProduct(inner *FuncDepSet) { // 5. If both the outer and inner inputs of the apply join have keys, then the // concatenation of those keys is a key on the apply join result. func (f *FuncDepSet) MakeApply(inner *FuncDepSet) { + for i := 0; i < inner.equiv.GroupCount(); i++ { + // NOTE: the ColSet of an equiv group is immutable. + f.addEquivalency(inner.equiv.Group(i)) + } for i := range inner.deps { fd := &inner.deps[i] - if fd.equiv { - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) - } else if !fd.isConstant() && f.hasKey == strictKey { - f.addDependency(f.key.Union(fd.from), fd.to, fd.strict, fd.equiv) + if !fd.isConstant() && f.hasKey == strictKey { + f.addDependency(f.key.Union(fd.from), fd.to, fd.strict) } // TODO(radu): can we use a laxKey here? } @@ -1562,7 +1505,7 @@ func (f *FuncDepSet) nullExtendRightRows(rightCols, notNullInputCols opt.ColSet) // Rule #2, described above. Note that this rule does not apply to // equivalence FDs, which remain valid. - if fd.strict && !fd.equiv && !fd.from.Intersects(notNullInputCols) { + if fd.strict && !fd.from.Intersects(notNullInputCols) { newFDs = append(newFDs, funcDep{from: fd.from, to: fd.to}) continue } @@ -1582,9 +1525,28 @@ func (f *FuncDepSet) nullExtendRightRows(rightCols, notNullInputCols opt.ColSet) } f.deps = f.deps[:n] + // Equivalence is maintained between columns from the same side of the join, + // but not between columns on either side. An equiv group that only references + // one side is left as-is. A group that references both sides is split into + // two equiv groups (which may be empty). In addition, lax dependencies are + // added from each row-supplying column to all null-extended columns. + // + // Add the lax dependencies from row-supplying to null-extended cols. + for i := 0; i < f.equiv.GroupCount(); i++ { + group := f.equiv.Group(i) + if group.Intersects(rightCols) && !group.SubsetOf(rightCols) { + left, right := group.Intersection(rightCols), group.Difference(rightCols) + left.ForEach(func(col opt.ColumnID) { + newFDs = append(newFDs, funcDep{from: opt.MakeColSet(col), to: right}) + }) + } + } + // Split the equiv groups that reference both sides of the join. + f.equiv.PartitionBy(rightCols) + for i := range newFDs { fd := &newFDs[i] - f.addDependency(fd.from, fd.to, fd.strict, fd.equiv) + f.addDependency(fd.from, fd.to, fd.strict) } } @@ -1593,13 +1555,9 @@ func (f *FuncDepSet) nullExtendRightRows(rightCols, notNullInputCols opt.ColSet) // from each equivalency group. func (f *FuncDepSet) EquivReps() opt.ColSet { var reps opt.ColSet - - // Equivalence closures are already maintained for every column. - for i := 0; i < len(f.deps); i++ { - fd := &f.deps[i] - if fd.equiv && !fd.to.Intersects(reps) { - reps.UnionWith(fd.from) - } + for i := 0; i < f.equiv.GroupCount(); i++ { + col, _ := f.equiv.Group(i).Next(0) + reps.Add(col) } return reps } @@ -1622,7 +1580,7 @@ func (f *FuncDepSet) ensureKeyClosure(cols opt.ColSet) { // If we have a strict key, we add a strict dependency; otherwise we add a // lax dependency. strict := f.hasKey == strictKey - f.addDependency(f.key, cols, strict, false /* equiv */) + f.addDependency(f.key, cols, strict) } } } @@ -1655,19 +1613,17 @@ func (f *FuncDepSet) Verify() { panic(errors.AssertionFailedf("expected constant FD to be strict: %s", redact.Safe(f))) } } + } - if fd.equiv { - if !fd.strict { - panic(errors.AssertionFailedf("expected equivalency to be strict: %s (%d)", f, i)) - } + for i := 0; i < f.equiv.GroupCount(); i++ { + group := f.equiv.Group(i) - if fd.from.Len() != 1 { - panic(errors.AssertionFailedf("expected equivalence determinant to be single col: %s (%d)", redact.Safe(f), redact.Safe(i))) - } + if group.Len() <= 1 { + panic(errors.AssertionFailedf("expected equivalence group to be more than one col: %s", redact.Safe(group))) + } - if !f.ComputeEquivClosure(fd.from).Equals(fd.from.Union(fd.to)) { - panic(errors.AssertionFailedf("expected equivalence dependants to be its closure: %s (%d)", redact.Safe(f), redact.Safe(i))) - } + if !f.ComputeEquivClosure(group).Equals(group) { + panic(errors.AssertionFailedf("expected equivalence group to be its closure: %s", redact.Safe(group))) } } @@ -1711,7 +1667,7 @@ func (f FuncDepSet) String() string { b.WriteString("lax-") } fmt.Fprintf(&b, "key%s", f.key) - if len(f.deps) > 0 { + if len(f.deps) > 0 || !f.equiv.Empty() { b.WriteString("; ") } } @@ -1721,12 +1677,25 @@ func (f FuncDepSet) String() string { } func (f FuncDepSet) formatFDs(b *strings.Builder) { + needComma := false for i := range f.deps { - if i != 0 { + if needComma { b.WriteString(", ") } + needComma = true f.deps[i].format(b) } + for i := 0; i < f.equiv.GroupCount(); i++ { + group := f.equiv.Group(i) + group.ForEach(func(col opt.ColumnID) { + if needComma { + b.WriteString(", ") + } + needComma = true + from := opt.MakeColSet(col) + fmt.Fprintf(b, "%s==%s", from, group.Difference(from)) + }) + } } // colsAreKey returns true if the given columns contain a strict or lax key for @@ -1778,7 +1747,10 @@ func (f *FuncDepSet) inClosureOf(cols, in opt.ColSet, strict bool) bool { return true } - in = in.Copy() + in = f.ComputeEquivClosure(in) + if cols.SubsetOf(in) { + return true + } // Lax dependencies are not transitive (see figure 2.1 in the paper for // properties that hold for lax dependencies), so only include them if they @@ -1791,40 +1763,39 @@ func (f *FuncDepSet) inClosureOf(cols, in opt.ColSet, strict bool) bool { if fd.from.SubsetOf(in) && !fd.to.SubsetOf(in) { laxIn.UnionWith(fd.to) - // Equivalencies are always transitive. - if fd.equiv { - in.UnionWith(fd.to) - - // Restart iteration to get transitive closure. - i = -1 - } - // Short-circuit if the "laxIn" set now contains all the columns. if cols.SubsetOf(laxIn) { return true } } } - // Use the set that includes columns reached via lax dependencies. - in = laxIn + in = f.ComputeEquivClosureNoCopy(laxIn) } // Now continue with full transitive closure of strict dependencies. - for i := 0; i < len(f.deps); i++ { - fd := &f.deps[i] - - if fd.strict && fd.from.SubsetOf(in) && !fd.to.SubsetOf(in) { - in.UnionWith(fd.to) + for { + restart := false + if cols.SubsetOf(in) { + return true + } + for i := 0; i < len(f.deps); i++ { + fd := &f.deps[i] + if fd.strict && fd.from.SubsetOf(in) && !fd.to.SubsetOf(in) { + in.UnionWith(fd.to) - // Short-circuit if the "in" set now contains all the columns. - if cols.SubsetOf(in) { - return true + // Short-circuit if the "in" set now contains all the columns. + if cols.SubsetOf(in) { + return true + } + // Restart iteration to get transitive closure. + restart = true } - - // Restart iteration to get transitive closure. - i = -1 } + if !restart { + break + } + in = f.ComputeEquivClosureNoCopy(in) } return false } @@ -1832,18 +1803,12 @@ func (f *FuncDepSet) inClosureOf(cols, in opt.ColSet, strict bool) bool { // addDependency adds a new dependency into the set. If another FD implies the // new FD, then it's not added. If it can be merged with an existing FD, that is // done. Otherwise, a brand new FD is added to the set. -func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict, equiv bool) { +func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict bool) { // Fast-path for trivial no-op dependency. if to.SubsetOf(from) { return } - // Delegate equivalence dependency. - if equiv { - f.addEquivalency(from.Union(to)) - return - } - if strict { // Reducing the columns yields a "stronger" dependency. from = f.ReduceCols(from) @@ -1858,13 +1823,18 @@ func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict, equiv bool) { return } + // Non-constant FDs are weaker than equivalence constraints. + if f.equiv.AreAllColsEquiv(to.Union(from)) { + return + } + // Any column in the "from" set is already an implied "to" column, so no // need to include it. if to.Intersects(from) { to = to.Difference(from) } - newFD := funcDep{from: from, to: to, strict: strict, equiv: equiv} + newFD := funcDep{from: from, to: to, strict: strict} // Merge the new dependency into the existing set. n := 0 @@ -1883,7 +1853,6 @@ func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict, equiv bool) { fd.from = from fd.to = to fd.strict = strict - fd.equiv = equiv // Keep searching, in case there's another implied FD. added = true @@ -1891,7 +1860,7 @@ func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict, equiv bool) { if fd.implies(&newFD) { // The new FD does not add any additional information. added = true - } else if fd.strict == strict && fd.equiv == equiv && fd.from.Equals(from) { + } else if fd.strict == strict && fd.from.Equals(from) { // The new FD can at least add its determinant to an existing FD. fd.to = fd.to.Union(to) added = true @@ -1913,16 +1882,13 @@ func (f *FuncDepSet) addDependency(from, to opt.ColSet, strict, equiv bool) { } // addEquivalency adds a new equivalency into the set. -// NOTE: The given equiv column set may be mutated. +// NOTE: The caller must consider the given ColSet as immutable, since it may +// be added directly to the EquivSet groups slice. func (f *FuncDepSet) addEquivalency(equiv opt.ColSet) { - var addConst bool - var found opt.ColSet - - // Start by finding complete set of all columns that are equivalent to the - // given set. - equiv = f.ComputeEquivClosureNoCopy(equiv) + equiv = f.equiv.AddNoCopy(equiv) n := 0 + var addConst bool for i := 0; i < len(f.deps); i++ { fd := &f.deps[i] @@ -1933,18 +1899,10 @@ func (f *FuncDepSet) addEquivalency(equiv opt.ColSet) { } } else if fd.from.SubsetOf(equiv) { // All determinant columns are equivalent to one another. - if fd.equiv { - // Ensure that each equivalent column directly maps to all other - // columns in the group. - fd.to = fd.to.Union(equiv) - fd.to.DifferenceWith(fd.from) - found.UnionWith(fd.from) - } else { - // Remove dependant columns that are equivalent, because equivalence - // is a stronger relationship than a strict or lax dependency. - if !fd.removeToCols(equiv) { - continue - } + // Remove dependant columns that are equivalent, because equivalence + // is a stronger relationship than a strict or lax dependency. + if !fd.removeToCols(equiv) { + continue } } @@ -1959,21 +1917,6 @@ func (f *FuncDepSet) addEquivalency(equiv opt.ColSet) { // Ensure that all equivalent columns are marked as constant. f.addConstantsNoKeyReduction(equiv) } - - if !equiv.SubsetOf(found) { - add := equiv.Difference(found) - deps := make([]funcDep, 0, len(f.deps)+add.Len()) - deps = append(deps, f.deps...) - - for id, ok := add.Next(0); ok; id, ok = add.Next(id + 1) { - fd := funcDep{strict: true, equiv: true} - fd.from.Add(id) - fd.to = equiv.Copy() - fd.to.Remove(id) - deps = append(deps, fd) - } - f.deps = deps - } } // setKey updates the key that the set is currently maintaining. @@ -2046,10 +1989,10 @@ func (f *funcDep) isConstant() bool { // is true when: // - the determinant is a subset of the given FD's determinant // - the dependant is a superset of the given FD's dependant -// - the FD is at least as strict and equivalent as the given FD +// - the FD is at least as strict as the given FD func (f *funcDep) implies(fd *funcDep) bool { if f.from.SubsetOf(fd.from) && fd.to.SubsetOf(f.to) { - if (f.strict || !fd.strict) && (f.equiv || !fd.equiv) { + if f.strict || !fd.strict { return true } } @@ -2064,7 +2007,6 @@ func (f *funcDep) removeFromCols(remove opt.ColSet) bool { f.from = f.from.Difference(remove) } return !f.isConstant() - } // removeToCols removes columns in the given set from this FD's dependant set. @@ -2078,17 +2020,10 @@ func (f *funcDep) removeToCols(remove opt.ColSet) bool { } func (f *funcDep) format(b *strings.Builder) { - if f.equiv { - if !f.strict { - panic(errors.AssertionFailedf("lax equivalent columns are not supported")) - } - fmt.Fprintf(b, "%s==%s", f.from, f.to) + if f.strict { + fmt.Fprintf(b, "%s-->%s", f.from, f.to) } else { - if f.strict { - fmt.Fprintf(b, "%s-->%s", f.from, f.to) - } else { - fmt.Fprintf(b, "%s~~>%s", f.from, f.to) - } + fmt.Fprintf(b, "%s~~>%s", f.from, f.to) } } diff --git a/pkg/sql/opt/props/func_dep_rand_test.go b/pkg/sql/opt/props/func_dep_rand_test.go index 729c36d5da25..0b87e2f86508 100644 --- a/pkg/sql/opt/props/func_dep_rand_test.go +++ b/pkg/sql/opt/props/func_dep_rand_test.go @@ -164,26 +164,26 @@ func (tr testRelation) checkKey(key opt.ColSet, typ keyType) error { return nil } -// checkFD verifies that a certain FD holds for the test relation. -func (tr testRelation) checkFD(dep funcDep) error { - if dep.equiv { - // An equivalence FD is easy to check row-by-row. - for _, r := range tr { - c, _ := dep.from.Next(0) - val := r.value(c) - fail := false - dep.to.ForEach(func(col opt.ColumnID) { - if r.value(col) != val { - fail = true - } - }) - if fail { - return fmt.Errorf("FD %s doesn't hold on row %s", &dep, r) +func (tr testRelation) checkEquiv(group opt.ColSet) error { + // An equivalence FD is easy to check row-by-row. + for _, r := range tr { + c, _ := group.Next(0) + val := r.value(c) + fail := false + group.ForEach(func(col opt.ColumnID) { + if r.value(col) != val { + fail = true } + }) + if fail { + return fmt.Errorf("FD %s==%s doesn't hold on row %s", group, group, r) } - return nil } + return nil +} +// checkFD verifies that a certain FD holds for the test relation. +func (tr testRelation) checkFD(dep funcDep) error { // We split the rows into groups (keyed on the `from` columns), picking the // first row in each group as the "representative" of that group. All other // rows in the group are checked against the representative row. @@ -215,6 +215,11 @@ func (tr testRelation) checkFDs(fd *FuncDepSet) error { return err } } + for i := 0; i < fd.equiv.GroupCount(); i++ { + if err := tr.checkEquiv(fd.equiv.Group(i)); err != nil { + return err + } + } // Check keys. if fd.hasKey != noKey { @@ -1094,6 +1099,9 @@ func shiftColumns(fd FuncDepSet, delta int) FuncDepSet { d.from = shiftSet(d.from, delta) d.to = shiftSet(d.to, delta) } + for i := 0; i < res.equiv.GroupCount(); i++ { + res.equiv.testOnlySetGroup(i, shiftSet(res.equiv.Group(i), delta)) + } res.key = shiftSet(res.key, delta) return res } diff --git a/pkg/sql/opt/props/func_dep_test.go b/pkg/sql/opt/props/func_dep_test.go index 7041695e3246..b708ae055706 100644 --- a/pkg/sql/opt/props/func_dep_test.go +++ b/pkg/sql/opt/props/func_dep_test.go @@ -96,7 +96,7 @@ func TestFuncDeps_ComputeClosure(t *testing.T) { fd2.AddConstants(c(2)) fd2.AddEquivalency(2, 3) fd2.AddSynthesizedCol(c(4), 5) - verifyFD(t, fd2, "lax-key(1); ()-->(2,3), (1)~~>(4), (2)==(3), (3)==(2), (4)-->(5)") + verifyFD(t, fd2, "lax-key(1); ()-->(2,3), (1)~~>(4), (4)-->(5), (2)==(3), (3)==(2)") testcases := []struct { fd *props.FuncDepSet @@ -134,7 +134,7 @@ func TestFuncDeps_InClosureOf(t *testing.T) { fd.AddLaxKey(c(1), c(1, 4)) fd.AddEquivalency(2, 3) fd.AddSynthesizedCol(c(4), 5) - verifyFD(t, fd, "lax-key(1); ()-->(2,3), (1)~~>(4), (2)==(3), (3)==(2), (4)-->(5)") + verifyFD(t, fd, "lax-key(1); ()-->(2,3), (1)~~>(4), (4)-->(5), (2)==(3), (3)==(2)") testcases := []struct { cols []opt.ColumnID @@ -390,7 +390,7 @@ func TestFuncDeps_MakeMax1Row(t *testing.T) { abcde.AddEquivalency(1, 2) abcde.AddEquivalency(3, 4) abcde.MakeMax1Row(c(1, 2, 3)) - verifyFD(t, abcde, "key(); ()-->(1-3), (2)==(1), (1)==(2)") + verifyFD(t, abcde, "key(); ()-->(1-3), (1)==(2), (2)==(1)") testColsAreStrictKey(t, abcde, c(), true) // Retain partial equivalencies. (1)==(2) is extracted from (1)==(2,4). @@ -398,7 +398,7 @@ func TestFuncDeps_MakeMax1Row(t *testing.T) { abcde.AddEquivalency(1, 2) abcde.AddEquivalency(1, 4) abcde.MakeMax1Row(c(1, 2, 3)) - verifyFD(t, abcde, "key(); ()-->(1-3), (2)==(1), (1)==(2)") + verifyFD(t, abcde, "key(); ()-->(1-3), (1)==(2), (2)==(1)") testColsAreStrictKey(t, abcde, c(), true) // No columns with equivalencies. @@ -604,7 +604,7 @@ func TestFuncDeps_AddSynthesizedCol(t *testing.T) { var anb1 props.FuncDepSet anb1.CopyFrom(makeJoinFD(t)) anb1.AddSynthesizedCol(c(2), 100) - verifyFD(t, &anb1, "key(10,11); (1)-->(2-5), (2,3)~~>(1,4,5), (10,11)-->(12,13), (1)==(10), (10)==(1), (2)-->(100)") + verifyFD(t, &anb1, "key(10,11); (1)-->(2-5), (2,3)~~>(1,4,5), (10,11)-->(12,13), (2)-->(100), (1)==(10), (10)==(1)") anb1.ProjectCols(c(1, 11, 100)) verifyFD(t, &anb1, "key(1,11); (1)-->(100)") testColsAreStrictKey(t, &anb1, c(1, 11, 100), true) @@ -1125,9 +1125,9 @@ func TestFuncDeps_MakeLeftOuter(t *testing.T) { roj.MakeProduct(makeMnpqFD(t)) roj.AddEquivalency(1, 10) roj.AddEquivalency(1, 2) - verifyFD(t, &roj, "key(10,11); (1)-->(3-5), (2,3)~~>(1,4,5), (10,11)-->(12,13), (1)==(2,10), (10)==(1,2), (2)==(1,10)") + verifyFD(t, &roj, "key(10,11); (1)-->(3-5), (2,3)~~>(1,4,5), (10,11)-->(12,13), (1)==(2,10), (2)==(1,10), (10)==(1,2)") roj.MakeLeftOuter(mnpq, &props.FuncDepSet{}, preservedCols, nullExtendedCols, c(1, 2, 10, 11)) - verifyFD(t, &roj, "key(10,11); (1)-->(3-5), (2,3)~~>(1,4,5), (10,11)-->(1-5,12,13), (1)==(2), (2)==(1), (1)~~>(10), (2)~~>(10)") + verifyFD(t, &roj, "key(10,11); (1)-->(3-5), (2,3)~~>(1,4,5), (10,11)-->(1-5,12,13), (1)~~>(10), (2)~~>(10), (1)==(2), (2)==(1)") // Test filter equivalency that includes columns from both sides of join // boundary. @@ -1285,7 +1285,7 @@ func TestFuncDeps_RemapFrom(t *testing.T) { from = opt.ColList{1, 2, 2, 3} to = opt.ColList{10, 30, 20, 50} res.RemapFrom(eqFD, from, to) - verifyFD(t, &res, "key(10,50); (50)==(20,30), (20)==(30,50), (30)==(20,50)") + verifyFD(t, &res, "key(10,50); (20)==(30,50), (30)==(20,50), (50)==(20,30)") } // Construct base table FD from figure 3.3, page 114: diff --git a/pkg/sql/opt/xform/testdata/coster/join b/pkg/sql/opt/xform/testdata/coster/join index 75331b9e6ee4..cf16453587c0 100644 --- a/pkg/sql/opt/xform/testdata/coster/join +++ b/pkg/sql/opt/xform/testdata/coster/join @@ -424,7 +424,7 @@ limit ├── stats: [rows=10] ├── cost: 2134.54 ├── key: (1) - ├── fd: (1)-->(2-13), (16)-->(17-25), (2)==(16), (16)==(2), (28)-->(29-37), (3)==(28), (28)==(3) + ├── fd: (1)-->(2-13), (16)-->(17-25), (28)-->(29-37), (2)==(16), (16)==(2), (3)==(28), (28)==(3) ├── inner-join (lookup wallet [as=r]) │ ├── columns: t.id:1!null sender_id:2!null receiver_id:3!null amount:4!null t.creation_date:5!null last_update:6 schedule_date:7 status:8 comment:9 linked_trans_id:10 c1:11 c2:12 c3:13 s.id:16!null s.name:17!null s.gender:18 s.email:19 s.first_name:20 s.last_name:21 s.creation_date:22!null s.situation:23 s.balance:24!null s.is_blocked:25 r.id:28!null r.name:29!null r.gender:30 r.email:31 r.first_name:32 r.last_name:33 r.creation_date:34!null r.situation:35 r.balance:36!null r.is_blocked:37 │ ├── key columns: [3] = [28] @@ -432,7 +432,7 @@ limit │ ├── stats: [rows=980.1, distinct(3)=98.995, null(3)=0, distinct(28)=98.995, null(28)=0] │ ├── cost: 2134.43 │ ├── key: (1) - │ ├── fd: (1)-->(2-13), (16)-->(17-25), (2)==(16), (16)==(2), (28)-->(29-37), (3)==(28), (28)==(3) + │ ├── fd: (1)-->(2-13), (16)-->(17-25), (28)-->(29-37), (2)==(16), (16)==(2), (3)==(28), (28)==(3) │ ├── limit hint: 10.00 │ ├── inner-join (lookup wallet [as=s]) │ │ ├── columns: t.id:1!null sender_id:2!null receiver_id:3 amount:4!null t.creation_date:5!null last_update:6 schedule_date:7 status:8 comment:9 linked_trans_id:10 c1:11 c2:12 c3:13 s.id:16!null s.name:17!null s.gender:18 s.email:19 s.first_name:20 s.last_name:21 s.creation_date:22!null s.situation:23 s.balance:24!null s.is_blocked:25 diff --git a/pkg/sql/opt/xform/testdata/external/hibernate b/pkg/sql/opt/xform/testdata/external/hibernate index 5f916b5dc9f6..5e816bb80564 100644 --- a/pkg/sql/opt/xform/testdata/external/hibernate +++ b/pkg/sql/opt/xform/testdata/external/hibernate @@ -174,7 +174,7 @@ where inner-join (hash) ├── columns: id1_6_0_:1!null id1_4_1_:8!null phone_nu2_6_0_:2 person_i4_6_0_:4!null phone_ty3_6_0_:3 person_i1_5_0__:16!null addresse2_5_0__:17 addresse3_0__:18!null address2_4_1_:9 createdo3_4_1_:10 name4_4_1_:11 nickname5_4_1_:12 version6_4_1_:13!null person_i1_5_0__:16!null addresse2_5_0__:17 addresse3_0__:18!null ├── key: (1,18) - ├── fd: (1)-->(2-4), (8)-->(9-13), (4)==(8,16), (8)==(4,16), (16,18)-->(17), (16)==(4,8) + ├── fd: (1)-->(2-4), (8)-->(9-13), (16,18)-->(17), (4)==(8,16), (8)==(4,16), (16)==(4,8) ├── scan person_addresses [as=addresses2_] │ ├── columns: addresses2_.person_id:16!null addresses:17 addresses_key:18!null │ ├── key: (16,18) @@ -661,7 +661,7 @@ distinct-on ├── inner-join (hash) │ ├── columns: phone0_.id:1!null person_id:4!null calls1_.phone_id:11!null person2_.id:14!null address:15 createdon:16 name:17 nickname:18 version:19!null │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ ├── fd: (1)-->(4), (1)==(11), (11)==(1), (14)-->(15-19), (4)==(14), (14)==(4) + │ ├── fd: (1)-->(4), (14)-->(15-19), (1)==(11), (11)==(1), (4)==(14), (14)==(4) │ ├── scan phone_call [as=calls1_] │ │ └── columns: calls1_.phone_id:11 │ ├── inner-join (hash) @@ -990,7 +990,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-6,9,12), (12)==(1), (1)==(12) + ├── fd: ()-->(1-6,9,12), (1)==(12), (12)==(1) ├── project │ ├── columns: phones1_.id:9!null person_id:12 │ ├── cardinality: [0 - 1] @@ -1005,7 +1005,7 @@ project │ ├── cardinality: [0 - 1] │ ├── has-placeholder │ ├── key: () - │ ├── fd: ()-->(9,12,17), (17)==(9), (9)==(17) + │ ├── fd: ()-->(9,12,17), (9)==(17), (17)==(9) │ ├── values │ │ ├── columns: "$1":17 │ │ ├── cardinality: [1 - 1] @@ -1055,7 +1055,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-6,9,12), (12)==(1), (1)==(12) + ├── fd: ()-->(1-6,9,12), (1)==(12), (12)==(1) ├── project │ ├── columns: phones1_.id:9!null person_id:12 │ ├── cardinality: [0 - 1] @@ -1070,7 +1070,7 @@ project │ ├── cardinality: [0 - 1] │ ├── has-placeholder │ ├── key: () - │ ├── fd: ()-->(9,12,17), (17)==(9), (9)==(17) + │ ├── fd: ()-->(9,12,17), (9)==(17), (17)==(9) │ ├── values │ │ ├── columns: "$1":17 │ │ ├── cardinality: [1 - 1] @@ -1724,7 +1724,7 @@ project │ ├── key columns: [2] = [10] │ ├── lookup columns are key │ ├── key: (5) - │ ├── fd: ()-->(1), (5)-->(6,7,10,12), (2)==(5), (5)==(2), (10)-->(12) + │ ├── fd: ()-->(1), (5)-->(6,7,10,12), (10)-->(12), (2)==(5), (5)==(2) │ ├── inner-join (lookup news [as=news1_]) │ │ ├── columns: newspaper_id:1!null news_news_id:2!null news1_.news_id:5!null news1_.detail:6 news1_.title:7 │ │ ├── key columns: [2] = [5] @@ -1804,19 +1804,19 @@ project │ ├── key columns: [2] = [23] │ ├── lookup columns are key │ ├── key: (5) - │ ├── fd: ()-->(1), (5)-->(6-8,11,12,17,19,23,26), (2)==(5), (5)==(2), (11)-->(12), (17)-->(19), (23)-->(26) + │ ├── fd: ()-->(1), (5)-->(6-8,11,12,17,19,23,26), (11)-->(12), (17)-->(19), (23)-->(26), (2)==(5), (5)==(2) │ ├── left-join (lookup generationgroup [as=a15]) │ │ ├── columns: generationuser_id:1!null ref_id:2!null generation1_.id:5!null generation1_.age:6 generation1_.culture:7 generation1_.description:8 a13.id:11 a13.age:12 a15.id:17 a15.culture:19 │ │ ├── key columns: [2] = [17] │ │ ├── lookup columns are key │ │ ├── key: (5) - │ │ ├── fd: ()-->(1), (5)-->(6-8,11,12,17,19), (2)==(5), (5)==(2), (11)-->(12), (17)-->(19) + │ │ ├── fd: ()-->(1), (5)-->(6-8,11,12,17,19), (11)-->(12), (17)-->(19), (2)==(5), (5)==(2) │ │ ├── left-join (lookup generationgroup [as=a13]) │ │ │ ├── columns: generationuser_id:1!null ref_id:2!null generation1_.id:5!null generation1_.age:6 generation1_.culture:7 generation1_.description:8 a13.id:11 a13.age:12 │ │ │ ├── key columns: [2] = [11] │ │ │ ├── lookup columns are key │ │ │ ├── key: (5) - │ │ │ ├── fd: ()-->(1), (5)-->(6-8,11,12), (2)==(5), (5)==(2), (11)-->(12) + │ │ │ ├── fd: ()-->(1), (5)-->(6-8,11,12), (11)-->(12), (2)==(5), (5)==(2) │ │ │ ├── inner-join (lookup generationgroup [as=generation1_]) │ │ │ │ ├── columns: generationuser_id:1!null ref_id:2!null generation1_.id:5!null generation1_.age:6 generation1_.culture:7 generation1_.description:8 │ │ │ │ ├── key columns: [2] = [5] @@ -2518,7 +2518,7 @@ group-by (hash) │ │ ├── fd: (1)-->(2-5), (8,9)-->(11), (1,8,9)-->(2-5,11,20) │ │ ├── inner-join (cross) │ │ │ ├── columns: this_.studentid:1!null name:2!null address_city:3 address_state:4 preferredcoursecode:5!null enrolment_.studentid:8!null enrolment_.coursecode:9!null enrolment_.year:11!null maxstudentenrolment_.coursecode:15!null maxstudentenrolment_.year:17!null - │ │ │ ├── fd: (1)-->(2-5), (5)==(15), (15)==(5), (8,9)-->(11) + │ │ │ ├── fd: (1)-->(2-5), (8,9)-->(11), (5)==(15), (15)==(5) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: this_.studentid:1!null name:2!null address_city:3 address_state:4 preferredcoursecode:5!null maxstudentenrolment_.coursecode:15!null maxstudentenrolment_.year:17!null │ │ │ │ ├── fd: (1)-->(2-5), (5)==(15), (15)==(5) diff --git a/pkg/sql/opt/xform/testdata/external/liquibase b/pkg/sql/opt/xform/testdata/external/liquibase index 3204958a4da4..b44bfb9236a3 100644 --- a/pkg/sql/opt/xform/testdata/external/liquibase +++ b/pkg/sql/opt/xform/testdata/external/liquibase @@ -225,21 +225,21 @@ project │ │ │ │ │ │ ├── fd: ()-->(31), (1)-->(2,5,10,13,15,17,20,22,23,26,27,37), (2)-->(1,5,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,5,10,13,15,17,20,22,23,26,27,31,37,50,79,106,136,140,158) │ │ │ │ │ │ ├── right-join (hash) │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 pg_catalog.pg_roles.oid:157 rolname:158 rownum:192!null - │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1,2,5,8,10,13,15,17,20,22,23,26,27,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140) + │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1,2,5,8,10,13,15,17,20,22,23,26,27,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ ├── scan pg_roles │ │ │ │ │ │ │ │ └── columns: pg_catalog.pg_roles.oid:157 rolname:158 │ │ │ │ │ │ │ ├── ordinality │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 rownum:192!null │ │ │ │ │ │ │ │ ├── key: (192) - │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1-3,5,8,10,13,15,17,20,22,23,26,27,30,31,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140) + │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1-3,5,8,10,13,15,17,20,22,23,26,27,30,31,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ │ └── left-join (lookup pg_namespace [as=n2]) │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 │ │ │ │ │ │ │ │ ├── key columns: [51] = [78] │ │ │ │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139) + │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ │ ├── right-join (hash) │ │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 - │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(91,105,106), (105)-->(106), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3) + │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(91,105,106), (105)-->(106), (49)-->(50,51), (50,51)-->(49), (36)-->(37), (37)-->(36), (45)==(49), (49)==(45), (3)==(30), (30)==(3) │ │ │ │ │ │ │ │ │ ├── inner-join (hash) │ │ │ │ │ │ │ │ │ │ ├── columns: i.inhrelid:44!null i.inhparent:45!null c2.oid:49!null c2.relname:50!null c2.relnamespace:51!null │ │ │ │ │ │ │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) @@ -270,7 +270,7 @@ project │ │ │ │ │ │ │ │ │ │ │ │ ├── key columns: [1] = [967] │ │ │ │ │ │ │ │ │ │ │ │ ├── first join in paired joiner; continuation column: continuation:987 │ │ │ │ │ │ │ │ │ │ │ │ ├── key: (1,966) - │ │ │ │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3), (966)-->(967,987) + │ │ │ │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (966)-->(967,987), (3)==(30), (30)==(3) │ │ │ │ │ │ │ │ │ │ │ │ ├── left-join (lookup pg_tablespace [as=t]) │ │ │ │ │ │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 │ │ │ │ │ │ │ │ │ │ │ │ │ ├── key columns: [8] = [36] diff --git a/pkg/sql/opt/xform/testdata/external/navicat b/pkg/sql/opt/xform/testdata/external/navicat index 21f00d7c5840..aa37dd6656d0 100644 --- a/pkg/sql/opt/xform/testdata/external/navicat +++ b/pkg/sql/opt/xform/testdata/external/navicat @@ -229,21 +229,21 @@ sort │ │ │ │ │ │ ├── fd: ()-->(31), (1)-->(2,5,10,13,15,17,20,22,23,26,27,37), (2)-->(1,5,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,5,10,13,15,17,20,22,23,26,27,31,37,50,79,106,136,140,158) │ │ │ │ │ │ ├── right-join (hash) │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 pg_catalog.pg_roles.oid:157 rolname:158 rownum:192!null - │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1,2,5,8,10,13,15,17,20,22,23,26,27,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140) + │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1,2,5,8,10,13,15,17,20,22,23,26,27,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ ├── scan pg_roles │ │ │ │ │ │ │ │ └── columns: pg_catalog.pg_roles.oid:157 rolname:158 │ │ │ │ │ │ │ ├── ordinality │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 rownum:192!null │ │ │ │ │ │ │ │ ├── key: (192) - │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1-3,5,8,10,13,15,17,20,22,23,26,27,30,31,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140) + │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1-3,5,8,10,13,15,17,20,22,23,26,27,30,31,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ │ └── left-join (lookup pg_namespace [as=n2]) │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 │ │ │ │ │ │ │ │ ├── key columns: [51] = [78] │ │ │ │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139) + │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (3)==(30), (30)==(3), (45)==(49), (49)==(45) │ │ │ │ │ │ │ │ ├── right-join (hash) │ │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 - │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(91,105,106), (105)-->(106), (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3) + │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(91,105,106), (105)-->(106), (49)-->(50,51), (50,51)-->(49), (36)-->(37), (37)-->(36), (45)==(49), (49)==(45), (3)==(30), (30)==(3) │ │ │ │ │ │ │ │ │ ├── inner-join (hash) │ │ │ │ │ │ │ │ │ │ ├── columns: i.inhrelid:44!null i.inhparent:45!null c2.oid:49!null c2.relname:50!null c2.relnamespace:51!null │ │ │ │ │ │ │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) @@ -274,7 +274,7 @@ sort │ │ │ │ │ │ │ │ │ │ │ │ ├── key columns: [1] = [967] │ │ │ │ │ │ │ │ │ │ │ │ ├── first join in paired joiner; continuation column: continuation:987 │ │ │ │ │ │ │ │ │ │ │ │ ├── key: (1,966) - │ │ │ │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3), (966)-->(967,987) + │ │ │ │ │ │ │ │ │ │ │ │ ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (966)-->(967,987), (3)==(30), (30)==(3) │ │ │ │ │ │ │ │ │ │ │ │ ├── left-join (lookup pg_tablespace [as=t]) │ │ │ │ │ │ │ │ │ │ │ │ │ ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 │ │ │ │ │ │ │ │ │ │ │ │ │ ├── key columns: [8] = [36] diff --git a/pkg/sql/opt/xform/testdata/external/nova b/pkg/sql/opt/xform/testdata/external/nova index a47a3cbc15a9..aa2b0a725165 100644 --- a/pkg/sql/opt/xform/testdata/external/nova +++ b/pkg/sql/opt/xform/testdata/external/nova @@ -213,7 +213,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (37)==(7), (7)==(37) + │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (7)==(37), (37)==(7) │ │ │ │ │ │ ├── inner-join (lookup flavors@flavors_flavorid_key) │ │ │ │ │ │ │ ├── columns: flavors.id:1!null flavorid:7!null "$2":37!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -222,7 +222,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,7,37), (37)==(7), (7)==(37) + │ │ │ │ │ │ │ ├── fd: ()-->(1,7,37), (7)==(37), (37)==(7) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$2":37 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -783,7 +783,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (42)==(13), (2)==(43), (43)==(2), (13)==(42) + │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (13)==(42), (42)==(13), (2)==(43), (43)==(2) │ │ │ │ │ │ ├── inner-join (lookup instance_types@instance_types_name_deleted_key) │ │ │ │ │ │ │ ├── columns: instance_types.id:1!null name:2!null instance_types.deleted:13!null "$1":42!null "$4":43!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -792,7 +792,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,2,13,42,43), (43)==(2), (13)==(42), (42)==(13), (2)==(43) + │ │ │ │ │ │ │ ├── fd: ()-->(1,2,13,42,43), (2)==(43), (43)==(2), (13)==(42), (42)==(13) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$1":42 "$4":43 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -928,7 +928,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (42)==(1), (13)==(43), (43)==(13), (1)==(42) + │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (1)==(42), (42)==(1), (13)==(43), (43)==(13) │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ ├── columns: "$4":42 "$1":43 │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -952,7 +952,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(20-22,44-46), (44)==(22), (21)==(45), (45)==(21), (20)==(46), (46)==(20), (22)==(44) + │ │ │ │ │ │ ├── fd: ()-->(20-22,44-46), (22)==(44), (44)==(22), (21)==(45), (45)==(21), (20)==(46), (46)==(20) │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ ├── columns: "$2":44 "$3":45 "$4":46 │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -1074,7 +1074,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (37)==(2), (2)==(37) + │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (2)==(37), (37)==(2) │ │ │ │ │ │ ├── inner-join (lookup flavors@flavors_name_key) │ │ │ │ │ │ │ ├── columns: flavors.id:1!null name:2!null "$2":37!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -1083,7 +1083,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,2,37), (37)==(2), (2)==(37) + │ │ │ │ │ │ │ ├── fd: ()-->(1,2,37), (2)==(37), (37)==(2) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$2":37 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -1206,7 +1206,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (37)==(7), (7)==(37) + │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (7)==(37), (37)==(7) │ │ │ │ │ │ ├── inner-join (lookup flavors@flavors_flavorid_key) │ │ │ │ │ │ │ ├── columns: flavors.id:1!null flavorid:7!null "$2":37!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -1215,7 +1215,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,7,37), (37)==(7), (7)==(37) + │ │ │ │ │ │ │ ├── fd: ()-->(1,7,37), (7)==(37), (37)==(7) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$2":37 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -1634,7 +1634,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (42)==(13), (7)==(43), (43)==(7), (13)==(42) + │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (13)==(42), (42)==(13), (7)==(43), (43)==(7) │ │ │ │ │ │ ├── inner-join (lookup instance_types@instance_types_flavorid_deleted_key) │ │ │ │ │ │ │ ├── columns: instance_types.id:1!null flavorid:7!null instance_types.deleted:13!null "$1":42!null "$4":43!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -1643,7 +1643,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,7,13,42,43), (43)==(7), (13)==(42), (42)==(13), (7)==(43) + │ │ │ │ │ │ │ ├── fd: ()-->(1,7,13,42,43), (7)==(43), (43)==(7), (13)==(42), (42)==(13) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$1":42 "$4":43 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -2337,7 +2337,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (42)==(13), (7)==(43), (43)==(7), (13)==(42) + │ │ │ │ │ │ ├── fd: ()-->(1-16,42,43), (13)==(42), (42)==(13), (7)==(43), (43)==(7) │ │ │ │ │ │ ├── inner-join (lookup instance_types@instance_types_flavorid_deleted_key) │ │ │ │ │ │ │ ├── columns: instance_types.id:1!null flavorid:7!null instance_types.deleted:13!null "$1":42!null "$4":43!null │ │ │ │ │ │ │ ├── flags: disallow merge join @@ -2346,7 +2346,7 @@ project │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,7,13,42,43), (43)==(7), (13)==(42), (42)==(13), (7)==(43) + │ │ │ │ │ │ │ ├── fd: ()-->(1,7,13,42,43), (7)==(43), (43)==(7), (13)==(42), (42)==(13) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: "$1":42 "$4":43 │ │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -2473,7 +2473,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (37)==(1), (1)==(37) + │ │ │ │ │ │ ├── fd: ()-->(1-12,14,15,37), (1)==(37), (37)==(1) │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ ├── columns: "$2":37 │ │ │ │ │ │ │ ├── cardinality: [1 - 1] @@ -2496,7 +2496,7 @@ project │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── has-placeholder │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(19,20,38,39), (38)==(20), (19)==(39), (39)==(19), (20)==(38) + │ │ │ │ │ │ ├── fd: ()-->(19,20,38,39), (20)==(38), (38)==(20), (19)==(39), (39)==(19) │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ ├── columns: "$1":38 "$2":39 │ │ │ │ │ │ │ ├── cardinality: [1 - 1] diff --git a/pkg/sql/opt/xform/testdata/external/pgjdbc b/pkg/sql/opt/xform/testdata/external/pgjdbc index 59105c981816..9e6eed759526 100644 --- a/pkg/sql/opt/xform/testdata/external/pgjdbc +++ b/pkg/sql/opt/xform/testdata/external/pgjdbc @@ -57,11 +57,11 @@ project │ │ │ ├── left-join (hash) │ │ │ │ ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null objoid:86 classoid:87 description:89 c.oid:91 relname:92 relnamespace:93 n.oid:128 nspname:129 rownum:134!null │ │ │ │ ├── immutable - │ │ │ │ ├── fd: (4)==(34), (34)==(4), (134)-->(2-4,8,26,34,35), (87)==(91), (91)==(87), (93)==(128), (128)==(93) + │ │ │ │ ├── fd: (134)-->(2-4,8,26,34,35), (4)==(34), (34)==(4), (87)==(91), (91)==(87), (93)==(128), (128)==(93) │ │ │ │ ├── ordinality │ │ │ │ │ ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null rownum:134!null │ │ │ │ │ ├── key: (134) - │ │ │ │ │ ├── fd: (4)==(34), (34)==(4), (134)-->(2-4,8,26,34,35) + │ │ │ │ │ ├── fd: (134)-->(2-4,8,26,34,35), (4)==(34), (34)==(4) │ │ │ │ │ └── inner-join (hash) │ │ │ │ │ ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null │ │ │ │ │ ├── fd: (4)==(34), (34)==(4) diff --git a/pkg/sql/opt/xform/testdata/external/tpce b/pkg/sql/opt/xform/testdata/external/tpce index 64edcd5c414e..2ec66058719e 100644 --- a/pkg/sql/opt/xform/testdata/external/tpce +++ b/pkg/sql/opt/xform/testdata/external/tpce @@ -150,19 +150,19 @@ sort │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null co_id:34!null co_in_id:37!null sc_id:45!null sc_name:46!null in_id:49!null in_sc_id:51!null │ │ │ ├── flags: force hash join (store right side) │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ │ ├── fd: ()-->(45,46,51), (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10), (34)-->(37), (21)==(34), (34)==(21), (45)==(51), (51)==(45), (37)==(49), (49)==(37) + │ │ │ ├── fd: ()-->(45,46,51), (1)-->(3), (16)-->(21), (34)-->(37), (1)==(13), (13)==(1), (10)==(16), (16)==(10), (21)==(34), (34)==(21), (45)==(51), (51)==(45), (37)==(49), (49)==(37) │ │ │ ├── inner-join (lookup company) │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null co_id:34!null co_in_id:37!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [21] = [34] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10), (34)-->(37), (21)==(34), (34)==(21) + │ │ │ │ ├── fd: (1)-->(3), (16)-->(21), (34)-->(37), (1)==(13), (13)==(1), (10)==(16), (16)==(10), (21)==(34), (34)==(21) │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null │ │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ │ ├── key columns: [10] = [16] │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ ├── fd: (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10) + │ │ │ │ │ ├── fd: (1)-->(3), (16)-->(21), (1)==(13), (13)==(1), (10)==(16), (16)==(10) │ │ │ │ │ ├── inner-join (lookup trade_request@trade_request_tr_b_id_tr_s_symb_idx) │ │ │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -839,12 +839,12 @@ project │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null lt_s_symb:18!null lt_price:20!null s_symb:25!null s_num_out:31!null │ │ │ ├── key columns: [25] = [18] │ │ │ ├── lookup columns are key - │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (18)==(9,11,25), (25)==(9,11,18), (11)==(9,18,25), (9)==(11,18,25) + │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (9)==(11,18,25), (11)==(9,18,25), (18)==(9,11,25), (25)==(9,11,18) │ │ │ ├── inner-join (lookup security) │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null s_symb:25!null s_num_out:31!null │ │ │ │ ├── key columns: [9] = [25] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (25)-->(31), (11)==(9,25), (25)==(9,11), (9)==(11,25) + │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (25)-->(31), (9)==(11,25), (11)==(9,25), (25)==(9,11) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null │ │ │ │ │ ├── key columns: [55 9] = [10 11] @@ -919,13 +919,13 @@ project │ │ │ ├── flags: force lookup join (into right side) │ │ │ ├── key columns: [9] = [25] │ │ │ ├── lookup columns are key - │ │ │ ├── fd: ()-->(10), (11)-->(12), (9)==(11,18,25), (11)==(9,18,25), (18)-->(20), (18)==(9,11,25), (25)-->(31), (25)==(9,11,18) + │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (9)==(11,18,25), (11)==(9,18,25), (18)==(9,11,25), (25)==(9,11,18) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null lt_s_symb:18!null lt_price:20!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [9] = [18] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (9)==(11,18), (11)==(9,18), (18)-->(20), (18)==(9,11) + │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (9)==(11,18), (11)==(9,18), (18)==(9,11) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1011,13 +1011,13 @@ project │ │ │ ├── key columns: [51] = [44] │ │ │ ├── lookup columns are key │ │ │ ├── key: (51) - │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (44)==(35,37,51), (51)==(35,37,44), (37)==(35,44,51), (35)==(37,44,51) + │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (35)==(37,44,51), (37)==(35,44,51), (44)==(35,37,51), (51)==(35,37,44) │ │ │ ├── inner-join (lookup security) │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null s_symb:51!null s_num_out:57!null │ │ │ │ ├── key columns: [35] = [51] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (51) - │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (51)-->(57), (37)==(35,51), (51)==(35,37), (35)==(37,51) + │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (51)-->(57), (35)==(37,51), (37)==(35,51), (51)==(35,37) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null │ │ │ │ │ ├── key columns: [83 35] = [36 37] @@ -1108,14 +1108,14 @@ project │ │ │ ├── key columns: [35] = [51] │ │ │ ├── lookup columns are key │ │ │ ├── key: (51) - │ │ │ ├── fd: ()-->(36), (37)-->(38), (35)==(37,44,51), (37)==(35,44,51), (44)-->(46), (44)==(35,37,51), (51)-->(57), (51)==(35,37,44) + │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (35)==(37,44,51), (37)==(35,44,51), (44)==(35,37,51), (51)==(35,37,44) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null lt_s_symb:44!null lt_price:46!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [35] = [44] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (44) - │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (35)==(37,44), (37)==(35,44), (44)-->(46), (44)==(35,37) + │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (35)==(37,44), (37)==(35,44), (44)==(35,37) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1132,7 +1132,7 @@ project │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ │ │ │ ├── key columns: [6] = [22] │ │ │ │ │ │ │ ├── key: (17) - │ │ │ │ │ │ │ ├── fd: ()-->(1,2,9), (1)==(9), (9)==(1), (17)-->(22), (6)==(22), (22)==(6) + │ │ │ │ │ │ │ ├── fd: ()-->(1,2,9), (17)-->(22), (1)==(9), (9)==(1), (6)==(22), (22)==(6) │ │ │ │ │ │ │ ├── inner-join (lookup company@company_co_in_id_idx) │ │ │ │ │ │ │ │ ├── columns: in_id:1!null in_name:2!null co_id:6!null co_in_id:9!null │ │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1206,13 +1206,13 @@ project │ │ │ ├── key columns: [22] = [15] │ │ │ ├── lookup columns are key │ │ │ ├── key: (22) - │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (15)==(6,8,22), (22)==(6,8,15), (8)==(6,15,22), (6)==(8,15,22) + │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (6)==(8,15,22), (8)==(6,15,22), (15)==(6,8,22), (22)==(6,8,15) │ │ │ ├── inner-join (lookup security) │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null s_symb:22!null s_num_out:28!null │ │ │ │ ├── key columns: [6] = [22] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (22) - │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (22)-->(28), (8)==(6,22), (22)==(6,8), (6)==(8,22) + │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (22)-->(28), (6)==(8,22), (8)==(6,22), (22)==(6,8) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null │ │ │ │ │ ├── key columns: [52 6] = [7 8] @@ -1282,14 +1282,14 @@ project │ │ │ ├── key columns: [6] = [22] │ │ │ ├── lookup columns are key │ │ │ ├── key: (22) - │ │ │ ├── fd: ()-->(7), (8)-->(9), (6)==(8,15,22), (8)==(6,15,22), (15)-->(17), (15)==(6,8,22), (22)-->(28), (22)==(6,8,15) + │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (6)==(8,15,22), (8)==(6,15,22), (15)==(6,8,22), (22)==(6,8,15) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null lt_s_symb:15!null lt_price:17!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [6] = [15] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (15) - │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (6)==(8,15), (8)==(6,15), (15)-->(17), (15)==(6,8) + │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (6)==(8,15), (8)==(6,15), (15)==(6,8) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1400,49 +1400,49 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (30)==(25), (6)==(19), (19)==(6), (33)==(37), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (37)==(33), (25)==(30) + │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (33)==(37), (37)==(33), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ ├── inner-join (lookup zip_code [as=zca]) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ ├── key columns: [33] = [37] │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (33)==(37), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (37)==(33) + │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (33)==(37), (37)==(33), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ ├── inner-join (lookup address [as=ca]) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ ├── key columns: [25] = [30] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,42-48,51-55,58-60), (51)==(48), (5)==(42), (42)==(5), (54)==(58), (6)==(19), (19)==(6), (58)==(54), (25)==(30), (30)==(25), (48)==(51) + │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (6)==(19), (19)==(6), (25)==(30), (30)==(25) │ │ │ ├── inner-join (lookup company) │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ │ ├── key columns: [6] = [19] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ ├── key: () - │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,42-48,51-55,58-60), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (54)==(58), (6)==(19), (19)==(6), (58)==(54) + │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (6)==(19), (19)==(6) │ │ │ │ ├── inner-join (lookup zip_code [as=zea]) │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ │ │ ├── key columns: [54] = [58] │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ ├── key: () - │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55,58-60), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (54)==(58) + │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ │ │ │ ├── inner-join (lookup address [as=ea]) │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 │ │ │ │ │ │ ├── key columns: [48] = [51] │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55), (51)==(48), (5)==(42), (42)==(5), (48)==(51) + │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ │ │ │ │ ├── inner-join (lookup exchange) │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null │ │ │ │ │ │ │ ├── key columns: [5] = [42] │ │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48), (42)==(5), (5)==(42) + │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48), (5)==(42), (42)==(5) │ │ │ │ │ │ │ ├── scan security │ │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null │ │ │ │ │ │ │ │ ├── constraint: /1: [/'SYMB' - /'SYMB'] @@ -1534,7 +1534,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25), (54)==(58), (58)==(54), (19)==(6), (1)==(63), (63)==(1), (33)==(37) + │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48), (54)==(58), (58)==(54), (1)==(63), (63)==(1) │ ├── inner-join (lookup zip_code [as=zea]) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ ├── flags: force lookup join (into right side) @@ -1542,7 +1542,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25), (54)==(58), (58)==(54), (19)==(6) + │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48), (54)==(58), (58)==(54) │ │ ├── inner-join (lookup address [as=ea]) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 │ │ │ ├── flags: force lookup join (into right side) @@ -1550,7 +1550,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55), (19)==(6), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25) + │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48) │ │ │ ├── inner-join (lookup exchange) │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null │ │ │ │ ├── flags: force lookup join (into right side) @@ -1558,7 +1558,7 @@ project │ │ │ │ ├── lookup columns are key │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ ├── key: () - │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48), (30)==(25), (19)==(6), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30) + │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5) │ │ │ │ ├── inner-join (lookup zip_code [as=zca]) │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1566,7 +1566,7 @@ project │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ ├── key: () - │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39), (25)==(30), (30)==(25), (19)==(6), (33)==(37), (37)==(33), (6)==(19) + │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33) │ │ │ │ │ ├── inner-join (lookup address [as=ca]) │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1574,7 +1574,7 @@ project │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34), (6)==(19), (25)==(30), (30)==(25), (19)==(6) + │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34), (6)==(19), (19)==(6), (25)==(30), (30)==(25) │ │ │ │ │ │ ├── inner-join (lookup company) │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1582,7 +1582,7 @@ project │ │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27), (19)==(6), (6)==(19) + │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27), (6)==(19), (19)==(6) │ │ │ │ │ │ │ ├── scan security │ │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null │ │ │ │ │ │ │ │ ├── constraint: /1: [/'SYMB' - /'SYMB'] @@ -1625,7 +1625,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 3] ├── key: (6,17) - ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (2)==(6), (6)==(2), (17)-->(18), (18)-->(17), (3)==(17), (17)==(3) + ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (17)-->(18), (18)-->(17), (2)==(6), (6)==(2), (3)==(17), (17)==(3) ├── inner-join (lookup company) │ ├── columns: cp_co_id:1!null cp_comp_co_id:2!null cp_in_id:3!null co_id:6!null co_name:8!null │ ├── key columns: [2] = [6] @@ -1662,7 +1662,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 3] ├── key: (6,17) - ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (2)==(6), (6)==(2), (17)-->(18), (18)-->(17), (3)==(17), (17)==(3) + ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (17)-->(18), (18)-->(17), (2)==(6), (6)==(2), (3)==(17), (17)==(3) ├── inner-join (lookup company) │ ├── columns: cp_co_id:1!null cp_comp_co_id:2!null cp_in_id:3!null co_id:6!null co_name:8!null │ ├── flags: force lookup join (into right side) @@ -1845,7 +1845,7 @@ project │ ├── cardinality: [0 - 5] │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── scan trade_type │ │ ├── columns: tt_id:18!null tt_is_mrkt:21!null │ │ ├── key: (18) @@ -1929,7 +1929,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 5] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── flags: force lookup join (into right side) @@ -1937,7 +1937,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 5] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null │ │ │ ├── flags: force hash join (store right side) @@ -2336,14 +2336,14 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (2)==(35), (35)==(2), (9)==(3) + ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (9)==(3), (2)==(35), (35)==(2) ├── inner-join (lookup customer) │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null c_id:9!null c_tax_id:10!null c_l_name:12!null c_f_name:13!null c_tier:16!null │ ├── key columns: [3] = [9] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-5,9,10,12,13,16), (9)==(3), (3)==(9) + │ ├── fd: ()-->(1-5,9,10,12,13,16), (3)==(9), (9)==(3) │ ├── scan customer_account │ │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null │ │ ├── constraint: /1: [/0 - /0] @@ -2381,7 +2381,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (2)==(35), (35)==(2), (9)==(3) + ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (9)==(3), (2)==(35), (35)==(2) ├── inner-join (lookup customer) │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null c_id:9!null c_tax_id:10!null c_l_name:12!null c_f_name:13!null c_tier:16!null │ ├── flags: force lookup join (into right side) @@ -2389,7 +2389,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-5,9,10,12,13,16), (9)==(3), (3)==(9) + │ ├── fd: ()-->(1-5,9,10,12,13,16), (3)==(9), (9)==(3) │ ├── scan customer_account │ │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null │ │ ├── constraint: /1: [/0 - /0] @@ -2449,21 +2449,21 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (1)==(17), (17)==(1), (12)==(30), (30)==(12) + │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (12)==(30), (30)==(12), (1)==(17), (17)==(1) │ ├── inner-join (lookup last_trade) │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── key columns: [12] = [30] │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (30)==(12), (1)==(17), (17)==(1), (12)==(30) + │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (12)==(30), (30)==(12), (1)==(17), (17)==(1) │ │ ├── inner-join (lookup security@security_s_co_id_s_issue_key) │ │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null │ │ │ ├── key columns: [1 44] = [17 13] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (17)==(1), (1)==(17) + │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (1)==(17), (17)==(1) │ │ │ ├── project │ │ │ │ ├── columns: "lookup_join_const_col_@13":44!null co_id:1!null co_name:3!null │ │ │ │ ├── cardinality: [0 - 1] @@ -2509,7 +2509,7 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (12)==(30), (30)==(12), (17)==(1), (1)==(17) + │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (1)==(17), (17)==(1), (12)==(30), (30)==(12) │ ├── inner-join (lookup last_trade) │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── flags: force lookup join (into right side) @@ -2517,7 +2517,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (1)==(17), (12)==(30), (30)==(12), (17)==(1) + │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (1)==(17), (17)==(1), (12)==(30), (30)==(12) │ │ ├── inner-join (lookup security@security_s_co_id_s_issue_key) │ │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null │ │ │ ├── flags: force lookup join (into right side) @@ -2525,7 +2525,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (17)==(1), (1)==(17) + │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (1)==(17), (17)==(1) │ │ │ ├── project │ │ │ │ ├── columns: "lookup_join_const_col_@13":44!null co_id:1!null co_name:3!null │ │ │ │ ├── cardinality: [0 - 1] @@ -2578,7 +2578,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-6,19,21), (19)==(6), (6)==(19) + │ │ ├── fd: ()-->(1,4-6,19,21), (6)==(19), (19)==(6) │ │ ├── scan security │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null │ │ │ ├── constraint: /1: [/'ROACH' - /'ROACH'] @@ -2629,7 +2629,7 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,4-6,19,21,30,32,37,39,40), (1)==(30), (30)==(1), (19)==(6), (6)==(19) + │ ├── fd: ()-->(1,4-6,19,21,30,32,37,39,40), (6)==(19), (19)==(6), (1)==(30), (30)==(1) │ ├── inner-join (lookup last_trade) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null co_id:19!null co_name:21!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── flags: force lookup join (into right side) @@ -2637,7 +2637,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-6,19,21,30,32), (6)==(19), (1)==(30), (30)==(1), (19)==(6) + │ │ ├── fd: ()-->(1,4-6,19,21,30,32), (6)==(19), (19)==(6), (1)==(30), (30)==(1) │ │ ├── inner-join (lookup company) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null co_id:19!null co_name:21!null │ │ │ ├── flags: force lookup join (into right side) @@ -2645,7 +2645,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-6,19,21), (19)==(6), (6)==(19) + │ │ │ ├── fd: ()-->(1,4-6,19,21), (6)==(19), (19)==(6) │ │ │ ├── scan security │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null │ │ │ │ ├── constraint: /1: [/'ROACH' - /'ROACH'] @@ -3526,7 +3526,7 @@ project │ │ ├── cardinality: [0 - 1] │ │ ├── volatile │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (18)==(4), (4)==(18) + │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (4)==(18), (18)==(4) │ │ ├── scan trade │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null trade.t_chrg:12!null t_lifo:15!null │ │ │ ├── constraint: /1: [/0 - /0] @@ -3583,7 +3583,7 @@ project │ │ ├── cardinality: [0 - 1] │ │ ├── volatile │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (18)==(4), (4)==(18) + │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (4)==(18), (18)==(4) │ │ ├── scan trade │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null trade.t_chrg:12!null t_lifo:15!null │ │ │ ├── constraint: /1: [/0 - /0] @@ -4052,7 +4052,7 @@ project │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,8,27,30,31,45-50), (47)==(31), (8)==(45), (45)==(8), (31)==(47) + │ ├── fd: ()-->(1,8,27,30,31,45-50), (31)==(47), (47)==(31), (8)==(45), (45)==(8) │ ├── inner-join (merge) │ │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ │ ├── left ordering: +31 @@ -4116,7 +4116,7 @@ project │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,8,27,30,31,45-50), (45)==(8), (31)==(47), (47)==(31), (8)==(45) + │ ├── fd: ()-->(1,8,27,30,31,45-50), (8)==(45), (45)==(8), (31)==(47), (47)==(31) │ ├── inner-join (lookup commission_rate) │ │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ │ ├── flags: force lookup join (into right side) @@ -4670,13 +4670,13 @@ left-join (cross) │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null row_number:55 │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null │ │ │ ├── cardinality: [0 - 50] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ ├── key: (1) - │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ │ ├── inner-join (lookup security) │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null │ │ │ │ ├── key columns: [6] = [18] @@ -4746,14 +4746,14 @@ left-join (cross) │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (58)==(91), (91)==(58), (65)==(59) + │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (65)==(59), (58)==(91), (91)==(58) │ │ ├── inner-join (lookup customer) │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null c_id:65!null customer.c_l_name:68!null customer.c_f_name:69!null │ │ │ ├── key columns: [59] = [65] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(57-59,65,68,69), (65)==(59), (59)==(65) + │ │ │ ├── fd: ()-->(57-59,65,68,69), (59)==(65), (65)==(59) │ │ │ ├── scan customer_account │ │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null │ │ │ │ ├── constraint: /57: [/0 - /0] @@ -4821,28 +4821,28 @@ left-join (cross) │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null row_number:55 │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null │ │ │ ├── flags: force hash join (store right side) │ │ │ ├── cardinality: [0 - 50] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ ├── key: (1) - │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null │ │ │ │ ├── flags: force hash join (store right side) │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ │ ├── key: (1) - │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3) + │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null │ │ │ │ │ ├── flags: force hash join (store right side) │ │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ │ │ ├── key: (1) - │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22) + │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (6)==(18), (18)==(6), (22)==(36), (36)==(22) │ │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -4902,7 +4902,7 @@ left-join (cross) │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (58)==(91), (91)==(58), (65)==(59) + │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (65)==(59), (58)==(91), (91)==(58) │ │ ├── inner-join (lookup customer) │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null c_id:65!null customer.c_l_name:68!null customer.c_f_name:69!null │ │ │ ├── flags: force lookup join (into right side) @@ -4910,7 +4910,7 @@ left-join (cross) │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(57-59,65,68,69), (65)==(59), (59)==(65) + │ │ │ ├── fd: ()-->(57-59,65,68,69), (59)==(65), (65)==(59) │ │ │ ├── scan customer_account │ │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null │ │ │ │ ├── constraint: /57: [/0 - /0] @@ -4971,14 +4971,14 @@ project │ ├── right ordering: +30 │ ├── cardinality: [0 - 4] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (merge) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── left ordering: +1 │ │ ├── right ordering: +24 │ │ ├── cardinality: [0 - 4] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── ordering: +1 │ │ ├── inner-join (lookup trade_type) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null @@ -5051,7 +5051,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 4] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── flags: force lookup join (into right side) @@ -5059,7 +5059,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 4] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null │ │ │ ├── flags: force hash join (store right side) @@ -5299,7 +5299,7 @@ update settlement ├── cardinality: [0 - 4] ├── immutable ├── key: (7) - ├── fd: (7)-->(8-10,13,14), (7)==(13), (13)==(7), (8,14)-->(16) + ├── fd: (7)-->(8-10,13,14), (8,14)-->(16), (7)==(13), (13)==(7) ├── distinct-on │ ├── columns: se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null │ ├── grouping columns: se_t_id:7!null @@ -5377,7 +5377,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 50] │ ├── key: (1) - │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45), (48)-->(49-51) + │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (42)-->(43-45), (48)-->(49-51), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null se_t_id:42 se_cash_type:43 se_cash_due_date:44 settlement.se_amt:45 @@ -5385,7 +5385,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45) + │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (42)-->(43-45), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ │ ├── top-k │ │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null @@ -5472,7 +5472,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 50] │ ├── key: (1) - │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45), (48)-->(49-51) + │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (42)-->(43-45), (48)-->(49-51), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null se_t_id:42 se_cash_type:43 se_cash_due_date:44 settlement.se_amt:45 @@ -5481,7 +5481,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45) + │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (42)-->(43-45), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ │ ├── limit │ │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null @@ -5562,7 +5562,7 @@ update cash_transaction ├── cardinality: [0 - 4] ├── immutable ├── key: (7) - ├── fd: (7)-->(8-10,13-16), (7)==(13), (13)==(7), (10,14-16)-->(18) + ├── fd: (7)-->(8-10,13-16), (10,14-16)-->(18), (7)==(13), (13)==(7) ├── distinct-on │ ├── columns: ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null │ ├── grouping columns: ct_t_id:7!null @@ -5668,7 +5668,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,3,8,17), (17)==(1), (1)==(17) + ├── fd: ()-->(1,3,8,17), (1)==(17), (17)==(1) ├── scan customer │ ├── columns: c_id:8!null c_ad_id:17!null │ ├── constraint: /8: [/0 - /0] @@ -5694,7 +5694,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,3,8,14), (14)==(1), (1)==(14) + ├── fd: ()-->(1,3,8,14), (1)==(14), (14)==(1) ├── scan company │ ├── columns: co_id:8!null co_ad_id:14!null │ ├── constraint: /8: [/0 - /0] @@ -6082,7 +6082,7 @@ project ├── window partition=() │ ├── columns: wi_wl_id:1!null wi_s_symb:2!null wl_id:5!null wl_c_id:6!null row_number:9 │ ├── key: (2,5) - │ ├── fd: ()-->(6), (1)==(5), (5)==(1), (2,5)-->(9) + │ ├── fd: ()-->(6), (2,5)-->(9), (1)==(5), (5)==(1) │ ├── inner-join (lookup watch_item) │ │ ├── columns: wi_wl_id:1!null wi_s_symb:2!null wl_id:5!null wl_c_id:6!null │ │ ├── key columns: [5] = [1] diff --git a/pkg/sql/opt/xform/testdata/external/tpce-no-stats b/pkg/sql/opt/xform/testdata/external/tpce-no-stats index 407ab5d8d2c8..a1ebe4f6438c 100644 --- a/pkg/sql/opt/xform/testdata/external/tpce-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpce-no-stats @@ -147,19 +147,19 @@ sort │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null co_id:34!null co_in_id:37!null sc_id:45!null sc_name:46!null in_id:49!null in_sc_id:51!null │ │ │ ├── flags: force hash join (store right side) │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ │ ├── fd: ()-->(45,46,51), (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10), (34)-->(37), (21)==(34), (34)==(21), (45)==(51), (51)==(45), (37)==(49), (49)==(37) + │ │ │ ├── fd: ()-->(45,46,51), (1)-->(3), (16)-->(21), (34)-->(37), (1)==(13), (13)==(1), (10)==(16), (16)==(10), (21)==(34), (34)==(21), (45)==(51), (51)==(45), (37)==(49), (49)==(37) │ │ │ ├── inner-join (lookup company) │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null co_id:34!null co_in_id:37!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [21] = [34] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10), (34)-->(37), (21)==(34), (34)==(21) + │ │ │ │ ├── fd: (1)-->(3), (16)-->(21), (34)-->(37), (1)==(13), (13)==(1), (10)==(16), (16)==(10), (21)==(34), (34)==(21) │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null s_symb:16!null s_co_id:21!null │ │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ │ ├── key columns: [10] = [16] │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ ├── fd: (1)-->(3), (1)==(13), (13)==(1), (16)-->(21), (10)==(16), (16)==(10) + │ │ │ │ │ ├── fd: (1)-->(3), (16)-->(21), (1)==(13), (13)==(1), (10)==(16), (16)==(10) │ │ │ │ │ ├── inner-join (lookup trade_request@trade_request_tr_b_id_tr_s_symb_idx) │ │ │ │ │ │ ├── columns: b_id:1!null b_name:3!null tr_s_symb:10!null tr_qty:11!null tr_bid_price:12!null tr_b_id:13!null │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -856,7 +856,7 @@ project │ │ ├── inner-join (hash) │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null lt_s_symb:18!null lt_price:20!null s_symb:25!null s_num_out:31!null │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (18)==(9,11,25), (25)==(9,11,18), (11)==(9,18,25), (9)==(11,18,25) + │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (9)==(11,18,25), (11)==(9,18,25), (18)==(9,11,25), (25)==(9,11,18) │ │ │ ├── project │ │ │ │ ├── columns: symb:9!null │ │ │ │ ├── inner-join (cross) @@ -879,7 +879,7 @@ project │ │ │ │ ├── key columns: [25] = [18] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (25) - │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (18)==(11,25), (25)==(11,18), (11)==(18,25) + │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (11)==(18,25), (18)==(11,25), (25)==(11,18) │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ ├── columns: dm_date:10!null dm_s_symb:11!null dm_close:12!null s_symb:25!null s_num_out:31!null │ │ │ │ │ ├── key columns: [11] = [25] @@ -942,13 +942,13 @@ project │ │ │ ├── flags: force lookup join (into right side) │ │ │ ├── key columns: [9] = [25] │ │ │ ├── lookup columns are key - │ │ │ ├── fd: ()-->(10), (11)-->(12), (9)==(11,18,25), (11)==(9,18,25), (18)-->(20), (18)==(9,11,25), (25)-->(31), (25)==(9,11,18) + │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (25)-->(31), (9)==(11,18,25), (11)==(9,18,25), (18)==(9,11,25), (25)==(9,11,18) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null lt_s_symb:18!null lt_price:20!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [9] = [18] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (9)==(11,18), (11)==(9,18), (18)-->(20), (18)==(9,11) + │ │ │ │ ├── fd: ()-->(10), (11)-->(12), (18)-->(20), (9)==(11,18), (11)==(9,18), (18)==(9,11) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:9!null dm_date:10!null dm_s_symb:11!null dm_close:12!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1033,7 +1033,7 @@ project │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null lt_s_symb:44!null lt_price:46!null s_symb:51!null s_num_out:57!null │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ │ │ ├── key: (51) - │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (44)==(35,37,51), (51)==(35,37,44), (37)==(35,44,51), (35)==(37,44,51) + │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (35)==(37,44,51), (37)==(35,44,51), (44)==(35,37,51), (51)==(35,37,44) │ │ │ ├── project │ │ │ │ ├── columns: symb:35!null │ │ │ │ ├── key: (35) @@ -1067,7 +1067,7 @@ project │ │ │ │ ├── key columns: [51] = [44] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (51) - │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (44)==(37,51), (51)==(37,44), (37)==(44,51) + │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (37)==(44,51), (44)==(37,51), (51)==(37,44) │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ ├── columns: dm_date:36!null dm_s_symb:37!null dm_close:38!null s_symb:51!null s_num_out:57!null │ │ │ │ │ ├── key columns: [37] = [51] @@ -1134,14 +1134,14 @@ project │ │ │ ├── key columns: [35] = [51] │ │ │ ├── lookup columns are key │ │ │ ├── key: (51) - │ │ │ ├── fd: ()-->(36), (37)-->(38), (35)==(37,44,51), (37)==(35,44,51), (44)-->(46), (44)==(35,37,51), (51)-->(57), (51)==(35,37,44) + │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (51)-->(57), (35)==(37,44,51), (37)==(35,44,51), (44)==(35,37,51), (51)==(35,37,44) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null lt_s_symb:44!null lt_price:46!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [35] = [44] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (44) - │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (35)==(37,44), (37)==(35,44), (44)-->(46), (44)==(35,37) + │ │ │ │ ├── fd: ()-->(36), (37)-->(38), (44)-->(46), (35)==(37,44), (37)==(35,44), (44)==(35,37) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:35!null dm_date:36!null dm_s_symb:37!null dm_close:38!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1158,7 +1158,7 @@ project │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ │ │ │ ├── key columns: [6] = [22] │ │ │ │ │ │ │ ├── key: (17) - │ │ │ │ │ │ │ ├── fd: ()-->(1,2,9), (1)==(9), (9)==(1), (17)-->(22), (6)==(22), (22)==(6) + │ │ │ │ │ │ │ ├── fd: ()-->(1,2,9), (17)-->(22), (1)==(9), (9)==(1), (6)==(22), (22)==(6) │ │ │ │ │ │ │ ├── inner-join (lookup company@company_co_in_id_idx) │ │ │ │ │ │ │ │ ├── columns: in_id:1!null in_name:2!null co_id:6!null co_in_id:9!null │ │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1232,7 +1232,7 @@ project │ │ │ ├── left ordering: +6 │ │ │ ├── right ordering: +8 │ │ │ ├── key: (22) - │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (15)==(6,8,22), (22)==(6,8,15), (8)==(6,15,22), (6)==(8,15,22) + │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (6)==(8,15,22), (8)==(6,15,22), (15)==(6,8,22), (22)==(6,8,15) │ │ │ ├── project │ │ │ │ ├── columns: symb:6!null │ │ │ │ ├── key: (6) @@ -1250,7 +1250,7 @@ project │ │ │ │ ├── key columns: [22] = [15] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (22) - │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (15)==(8,22), (22)==(8,15), (8)==(15,22) + │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (8)==(15,22), (15)==(8,22), (22)==(8,15) │ │ │ │ ├── ordering: +(8|15|22) opt(7) [actual: +8] │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ ├── columns: dm_date:7!null dm_s_symb:8!null dm_close:9!null s_symb:22!null s_num_out:28!null @@ -1316,14 +1316,14 @@ project │ │ │ ├── key columns: [6] = [22] │ │ │ ├── lookup columns are key │ │ │ ├── key: (22) - │ │ │ ├── fd: ()-->(7), (8)-->(9), (6)==(8,15,22), (8)==(6,15,22), (15)-->(17), (15)==(6,8,22), (22)-->(28), (22)==(6,8,15) + │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (22)-->(28), (6)==(8,15,22), (8)==(6,15,22), (15)==(6,8,22), (22)==(6,8,15) │ │ │ ├── inner-join (lookup last_trade) │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null lt_s_symb:15!null lt_price:17!null │ │ │ │ ├── flags: force lookup join (into right side) │ │ │ │ ├── key columns: [6] = [15] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── key: (15) - │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (6)==(8,15), (8)==(6,15), (15)-->(17), (15)==(6,8) + │ │ │ │ ├── fd: ()-->(7), (8)-->(9), (15)-->(17), (6)==(8,15), (8)==(6,15), (15)==(6,8) │ │ │ │ ├── inner-join (lookup daily_market) │ │ │ │ │ ├── columns: symb:6!null dm_date:7!null dm_s_symb:8!null dm_close:9!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1434,49 +1434,49 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (30)==(25), (6)==(19), (19)==(6), (33)==(37), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (37)==(33), (25)==(30) + │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (33)==(37), (37)==(33), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ ├── inner-join (lookup zip_code [as=zca]) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ ├── key columns: [33] = [37] │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (33)==(37), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (37)==(33) + │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (33)==(37), (37)==(33), (25)==(30), (30)==(25), (6)==(19), (19)==(6), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ ├── inner-join (lookup address [as=ca]) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ ├── key columns: [25] = [30] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,42-48,51-55,58-60), (51)==(48), (5)==(42), (42)==(5), (54)==(58), (6)==(19), (19)==(6), (58)==(54), (25)==(30), (30)==(25), (48)==(51) + │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (6)==(19), (19)==(6), (25)==(30), (30)==(25) │ │ │ ├── inner-join (lookup company) │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ │ ├── key columns: [6] = [19] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ ├── key: () - │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,42-48,51-55,58-60), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (54)==(58), (6)==(19), (19)==(6), (58)==(54) + │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (6)==(19), (19)==(6) │ │ │ │ ├── inner-join (lookup zip_code [as=zea]) │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ │ │ │ ├── key columns: [54] = [58] │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ ├── key: () - │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55,58-60), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5), (54)==(58) + │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55,58-60), (54)==(58), (58)==(54), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ │ │ │ ├── inner-join (lookup address [as=ea]) │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 │ │ │ │ │ │ ├── key columns: [48] = [51] │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55), (51)==(48), (5)==(42), (42)==(5), (48)==(51) + │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48,51-55), (48)==(51), (51)==(48), (5)==(42), (42)==(5) │ │ │ │ │ │ ├── inner-join (lookup exchange) │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null │ │ │ │ │ │ │ ├── key columns: [5] = [42] │ │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48), (42)==(5), (5)==(42) + │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,42-48), (5)==(42), (42)==(5) │ │ │ │ │ │ │ ├── scan security │ │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null │ │ │ │ │ │ │ │ ├── constraint: /1: [/'SYMB' - /'SYMB'] @@ -1568,7 +1568,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25), (54)==(58), (58)==(54), (19)==(6), (1)==(63), (63)==(1), (33)==(37) + │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60,63,65-67), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48), (54)==(58), (58)==(54), (1)==(63), (63)==(1) │ ├── inner-join (lookup zip_code [as=zea]) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 zea.zc_code:58!null zea.zc_town:59!null zea.zc_div:60!null │ │ ├── flags: force lookup join (into right side) @@ -1576,7 +1576,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25), (54)==(58), (58)==(54), (19)==(6) + │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55,58-60), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48), (54)==(58), (58)==(54) │ │ ├── inner-join (lookup address [as=ea]) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null ea.ad_id:51!null ea.ad_line1:52 ea.ad_line2:53 ea.ad_zc_code:54!null ea.ad_ctry:55 │ │ │ ├── flags: force lookup join (into right side) @@ -1584,7 +1584,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55), (19)==(6), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30), (48)==(51), (51)==(48), (30)==(25) + │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48,51-55), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5), (48)==(51), (51)==(48) │ │ │ ├── inner-join (lookup exchange) │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null ex_id:42!null ex_name:43!null ex_num_symb:44!null ex_open:45!null ex_close:46!null ex_desc:47 ex_ad_id:48!null │ │ │ │ ├── flags: force lookup join (into right side) @@ -1592,7 +1592,7 @@ project │ │ │ │ ├── lookup columns are key │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ ├── key: () - │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48), (30)==(25), (19)==(6), (33)==(37), (37)==(33), (6)==(19), (5)==(42), (42)==(5), (25)==(30) + │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39,42-48), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33), (5)==(42), (42)==(5) │ │ │ │ ├── inner-join (lookup zip_code [as=zca]) │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 zca.zc_code:37!null zca.zc_town:38!null zca.zc_div:39!null │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1600,7 +1600,7 @@ project │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ ├── key: () - │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39), (25)==(30), (30)==(25), (19)==(6), (33)==(37), (37)==(33), (6)==(19) + │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34,37-39), (6)==(19), (19)==(6), (25)==(30), (30)==(25), (33)==(37), (37)==(33) │ │ │ │ │ ├── inner-join (lookup address [as=ca]) │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null ca.ad_id:30!null ca.ad_line1:31 ca.ad_line2:32 ca.ad_zc_code:33!null ca.ad_ctry:34 │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1608,7 +1608,7 @@ project │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34), (6)==(19), (25)==(30), (30)==(25), (19)==(6) + │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27,30-34), (6)==(19), (19)==(6), (25)==(30), (30)==(25) │ │ │ │ │ │ ├── inner-join (lookup company) │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null co_id:19!null co_st_id:20!null co_name:21!null co_sp_rate:23!null co_ceo:24!null co_ad_id:25!null co_desc:26!null co_open_date:27!null │ │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -1616,7 +1616,7 @@ project │ │ │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ │ │ ├── cardinality: [0 - 1] │ │ │ │ │ │ │ ├── key: () - │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27), (19)==(6), (6)==(19) + │ │ │ │ │ │ │ ├── fd: ()-->(1,4-16,19-21,23-27), (6)==(19), (19)==(6) │ │ │ │ │ │ │ ├── scan security │ │ │ │ │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null s_num_out:7!null s_start_date:8!null s_exch_date:9!null security.s_pe:10!null security.s_52wk_high:11!null s_52wk_high_date:12!null security.s_52wk_low:13!null s_52wk_low_date:14!null security.s_dividend:15!null security.s_yield:16!null │ │ │ │ │ │ │ │ ├── constraint: /1: [/'SYMB' - /'SYMB'] @@ -1659,7 +1659,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 3] ├── key: (6,17) - ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (2)==(6), (6)==(2), (17)-->(18), (18)-->(17), (3)==(17), (17)==(3) + ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (17)-->(18), (18)-->(17), (2)==(6), (6)==(2), (3)==(17), (17)==(3) ├── inner-join (lookup company) │ ├── columns: cp_co_id:1!null cp_comp_co_id:2!null cp_in_id:3!null co_id:6!null co_name:8!null │ ├── key columns: [2] = [6] @@ -1696,7 +1696,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 3] ├── key: (6,17) - ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (2)==(6), (6)==(2), (17)-->(18), (18)-->(17), (3)==(17), (17)==(3) + ├── fd: ()-->(1), (6)-->(8), (8)-->(6), (17)-->(18), (18)-->(17), (2)==(6), (6)==(2), (3)==(17), (17)==(3) ├── inner-join (lookup company) │ ├── columns: cp_co_id:1!null cp_comp_co_id:2!null cp_in_id:3!null co_id:6!null co_name:8!null │ ├── flags: force lookup join (into right side) @@ -1880,14 +1880,14 @@ project │ ├── right ordering: +30 │ ├── cardinality: [0 - 5] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (merge) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── left ordering: +1 │ │ ├── right ordering: +24 │ │ ├── cardinality: [0 - 5] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── ordering: +1 │ │ ├── inner-join (lookup trade_type) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null @@ -1960,7 +1960,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 5] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── flags: force lookup join (into right side) @@ -1968,7 +1968,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 5] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null │ │ │ ├── flags: force hash join (store right side) @@ -2367,14 +2367,14 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (2)==(35), (35)==(2), (9)==(3) + ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (9)==(3), (2)==(35), (35)==(2) ├── inner-join (lookup customer) │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null c_id:9!null c_tax_id:10!null c_l_name:12!null c_f_name:13!null c_tier:16!null │ ├── key columns: [3] = [9] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-5,9,10,12,13,16), (9)==(3), (3)==(9) + │ ├── fd: ()-->(1-5,9,10,12,13,16), (3)==(9), (9)==(3) │ ├── scan customer_account │ │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null │ │ ├── constraint: /1: [/0 - /0] @@ -2412,7 +2412,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (2)==(35), (35)==(2), (9)==(3) + ├── fd: ()-->(1-5,9,10,12,13,16,35,37), (3)==(9), (9)==(3), (2)==(35), (35)==(2) ├── inner-join (lookup customer) │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null c_id:9!null c_tax_id:10!null c_l_name:12!null c_f_name:13!null c_tier:16!null │ ├── flags: force lookup join (into right side) @@ -2420,7 +2420,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-5,9,10,12,13,16), (9)==(3), (3)==(9) + │ ├── fd: ()-->(1-5,9,10,12,13,16), (3)==(9), (9)==(3) │ ├── scan customer_account │ │ ├── columns: ca_id:1!null ca_b_id:2!null ca_c_id:3!null ca_name:4 ca_tax_st:5!null │ │ ├── constraint: /1: [/0 - /0] @@ -2480,21 +2480,21 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (1)==(17), (17)==(1), (12)==(30), (30)==(12) + │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (12)==(30), (30)==(12), (1)==(17), (17)==(1) │ ├── inner-join (lookup last_trade) │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── key columns: [12] = [30] │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (30)==(12), (1)==(17), (17)==(1), (12)==(30) + │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (12)==(30), (30)==(12), (1)==(17), (17)==(1) │ │ ├── inner-join (lookup security@security_s_co_id_s_issue_key) │ │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null │ │ │ ├── key columns: [1 44] = [17 13] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (17)==(1), (1)==(17) + │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (1)==(17), (17)==(1) │ │ │ ├── project │ │ │ │ ├── columns: "lookup_join_const_col_@13":44!null co_id:1!null co_name:3!null │ │ │ │ ├── cardinality: [0 - 1] @@ -2540,7 +2540,7 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (12)==(30), (30)==(12), (17)==(1), (1)==(17) + │ ├── fd: ()-->(1,3,12,13,15-17,30,32,37,39,40), (1)==(17), (17)==(1), (12)==(30), (30)==(12) │ ├── inner-join (lookup last_trade) │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── flags: force lookup join (into right side) @@ -2548,7 +2548,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (1)==(17), (12)==(30), (30)==(12), (17)==(1) + │ │ ├── fd: ()-->(1,3,12,13,15-17,30,32), (1)==(17), (17)==(1), (12)==(30), (30)==(12) │ │ ├── inner-join (lookup security@security_s_co_id_s_issue_key) │ │ │ ├── columns: co_id:1!null co_name:3!null s_symb:12!null s_issue:13!null s_name:15!null s_ex_id:16!null s_co_id:17!null │ │ │ ├── flags: force lookup join (into right side) @@ -2556,7 +2556,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (17)==(1), (1)==(17) + │ │ │ ├── fd: ()-->(1,3,12,13,15-17), (1)==(17), (17)==(1) │ │ │ ├── project │ │ │ │ ├── columns: "lookup_join_const_col_@13":44!null co_id:1!null co_name:3!null │ │ │ │ ├── cardinality: [0 - 1] @@ -2609,7 +2609,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-6,19,21), (19)==(6), (6)==(19) + │ │ ├── fd: ()-->(1,4-6,19,21), (6)==(19), (19)==(6) │ │ ├── scan security │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null │ │ │ ├── constraint: /1: [/'ROACH' - /'ROACH'] @@ -2660,7 +2660,7 @@ project │ ├── cardinality: [0 - 1] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) │ ├── key: () - │ ├── fd: ()-->(1,4-6,19,21,30,32,37,39,40), (1)==(30), (30)==(1), (19)==(6), (6)==(19) + │ ├── fd: ()-->(1,4-6,19,21,30,32,37,39,40), (6)==(19), (19)==(6), (1)==(30), (30)==(1) │ ├── inner-join (lookup last_trade) │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null co_id:19!null co_name:21!null lt_s_symb:30!null last_trade.lt_price:32!null │ │ ├── flags: force lookup join (into right side) @@ -2668,7 +2668,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-6,19,21,30,32), (6)==(19), (1)==(30), (30)==(1), (19)==(6) + │ │ ├── fd: ()-->(1,4-6,19,21,30,32), (6)==(19), (19)==(6), (1)==(30), (30)==(1) │ │ ├── inner-join (lookup company) │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null co_id:19!null co_name:21!null │ │ │ ├── flags: force lookup join (into right side) @@ -2676,7 +2676,7 @@ project │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(1,4-6,19,21), (19)==(6), (6)==(19) + │ │ │ ├── fd: ()-->(1,4-6,19,21), (6)==(19), (19)==(6) │ │ │ ├── scan security │ │ │ │ ├── columns: s_symb:1!null s_name:4!null s_ex_id:5!null s_co_id:6!null │ │ │ │ ├── constraint: /1: [/'ROACH' - /'ROACH'] @@ -3556,7 +3556,7 @@ project │ │ ├── cardinality: [0 - 1] │ │ ├── volatile │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (18)==(4), (4)==(18) + │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (4)==(18), (18)==(4) │ │ ├── scan trade │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null trade.t_chrg:12!null t_lifo:15!null │ │ │ ├── constraint: /1: [/0 - /0] @@ -3613,7 +3613,7 @@ project │ │ ├── cardinality: [0 - 1] │ │ ├── volatile │ │ ├── key: () - │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (18)==(4), (4)==(18) + │ │ ├── fd: ()-->(1,4-7,9,12,15,18-21), (4)==(18), (18)==(4) │ │ ├── scan trade │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null trade.t_chrg:12!null t_lifo:15!null │ │ │ ├── constraint: /1: [/0 - /0] @@ -4082,7 +4082,7 @@ project │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,8,27,30,31,45-50), (47)==(31), (8)==(45), (45)==(8), (31)==(47) + │ ├── fd: ()-->(1,8,27,30,31,45-50), (31)==(47), (47)==(31), (8)==(45), (45)==(8) │ ├── inner-join (merge) │ │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ │ ├── left ordering: +47 @@ -4146,7 +4146,7 @@ project │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,8,27,30,31,45-50), (45)==(8), (31)==(47), (47)==(31), (8)==(45) + │ ├── fd: ()-->(1,8,27,30,31,45-50), (8)==(45), (45)==(8), (31)==(47), (47)==(31) │ ├── inner-join (lookup commission_rate) │ │ ├── columns: c_id:1!null c_tier:8!null s_symb:27!null s_name:30!null s_ex_id:31!null cr_c_tier:45!null cr_tt_id:46!null cr_ex_id:47!null cr_from_qty:48!null cr_to_qty:49!null commission_rate.cr_rate:50!null │ │ ├── flags: force lookup join (into right side) @@ -4700,28 +4700,28 @@ left-join (cross) │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null row_number:55 │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ ├── inner-join (lookup trade_type) │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null │ │ │ ├── key columns: [4] = [49] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 50] │ │ │ ├── key: (1) - │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ │ ├── inner-join (lookup status_type) │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null │ │ │ │ ├── key columns: [3] = [45] │ │ │ │ ├── lookup columns are key │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ ├── key: (1) - │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3) + │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3) │ │ │ │ ├── inner-join (lookup exchange) │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null │ │ │ │ │ ├── key columns: [22] = [36] │ │ │ │ │ ├── lookup columns are key │ │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ │ ├── key: (1) - │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22) + │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (6)==(18), (18)==(6), (22)==(36), (36)==(22) │ │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null │ │ │ │ │ │ ├── key columns: [6] = [18] @@ -4764,14 +4764,14 @@ left-join (cross) │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (58)==(91), (91)==(58), (65)==(59) + │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (65)==(59), (58)==(91), (91)==(58) │ │ ├── inner-join (lookup customer) │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null c_id:65!null customer.c_l_name:68!null customer.c_f_name:69!null │ │ │ ├── key columns: [59] = [65] │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(57-59,65,68,69), (65)==(59), (59)==(65) + │ │ │ ├── fd: ()-->(57-59,65,68,69), (59)==(65), (65)==(59) │ │ │ ├── scan customer_account │ │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null │ │ │ │ ├── constraint: /57: [/0 - /0] @@ -4839,28 +4839,28 @@ left-join (cross) │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null row_number:55 │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12,55), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null tt_id:49!null trade_type.tt_name:50!null │ │ │ ├── flags: force hash join (store right side) │ │ │ ├── cardinality: [0 - 50] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ ├── key: (1) - │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3), (49)-->(50), (4)==(49), (49)==(4) + │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (49)-->(50), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3), (4)==(49), (49)==(4) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null st_id:45!null status_type.st_name:46!null │ │ │ │ ├── flags: force hash join (store right side) │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ │ ├── key: (1) - │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22), (45)-->(46), (3)==(45), (45)==(3) + │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (45)-->(46), (6)==(18), (18)==(6), (22)==(36), (36)==(22), (3)==(45), (45)==(3) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null ex_id:36!null exchange.ex_name:37!null │ │ │ │ │ ├── flags: force hash join (store right side) │ │ │ │ │ ├── cardinality: [0 - 50] │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) │ │ │ │ │ ├── key: (1) - │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (6)==(18), (18)==(6), (36)-->(37), (22)==(36), (36)==(22) + │ │ │ │ │ ├── fd: ()-->(9), (1)-->(2-4,6,7,10,12), (18)-->(21,22), (36)-->(37), (6)==(18), (18)==(6), (22)==(36), (36)==(22) │ │ │ │ │ ├── inner-join (lookup security) │ │ │ │ │ │ ├── columns: trade.t_id:1!null trade.t_dts:2!null t_st_id:3!null t_tt_id:4!null trade.t_s_symb:6!null trade.t_qty:7!null t_ca_id:9!null trade.t_exec_name:10!null trade.t_chrg:12!null s_symb:18!null security.s_name:21!null s_ex_id:22!null │ │ │ │ │ │ ├── flags: force lookup join (into right side) @@ -4920,7 +4920,7 @@ left-join (cross) │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (58)==(91), (91)==(58), (65)==(59) + │ │ ├── fd: ()-->(57-59,65,68,69,91,93), (59)==(65), (65)==(59), (58)==(91), (91)==(58) │ │ ├── inner-join (lookup customer) │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null c_id:65!null customer.c_l_name:68!null customer.c_f_name:69!null │ │ │ ├── flags: force lookup join (into right side) @@ -4928,7 +4928,7 @@ left-join (cross) │ │ │ ├── lookup columns are key │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () - │ │ │ ├── fd: ()-->(57-59,65,68,69), (65)==(59), (59)==(65) + │ │ │ ├── fd: ()-->(57-59,65,68,69), (59)==(65), (65)==(59) │ │ │ ├── scan customer_account │ │ │ │ ├── columns: ca_id:57!null ca_b_id:58!null ca_c_id:59!null │ │ │ │ ├── constraint: /57: [/0 - /0] @@ -4989,14 +4989,14 @@ project │ ├── right ordering: +30 │ ├── cardinality: [0 - 4] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (merge) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── left ordering: +1 │ │ ├── right ordering: +24 │ │ ├── cardinality: [0 - 4] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── ordering: +1 │ │ ├── inner-join (lookup trade_type) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null @@ -5069,7 +5069,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 4] │ ├── key: (1) - │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27), (30)-->(31-33) + │ ├── fd: (1)-->(4,5,8,10,11,24-27,30-33), (18)-->(21), (24)-->(25-27), (30)-->(31-33), (4)==(18), (18)==(4) │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null se_t_id:24 se_cash_type:25 se_cash_due_date:26 settlement.se_amt:27 │ │ ├── flags: force lookup join (into right side) @@ -5077,7 +5077,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 4] │ │ ├── key: (1) - │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (4)==(18), (18)==(4), (24)-->(25-27) + │ │ ├── fd: (1)-->(4,5,8,10,11,24-27), (18)-->(21), (24)-->(25-27), (4)==(18), (18)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: t_id:1!null t_tt_id:4!null t_is_cash:5!null trade.t_bid_price:8!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_is_mrkt:21!null │ │ │ ├── flags: force hash join (store right side) @@ -5317,7 +5317,7 @@ update settlement ├── cardinality: [0 - 4] ├── immutable ├── key: (7) - ├── fd: (7)-->(8-10,13,14), (7)==(13), (13)==(7), (8,14)-->(16) + ├── fd: (7)-->(8-10,13,14), (8,14)-->(16), (7)==(13), (13)==(7) ├── distinct-on │ ├── columns: se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null │ ├── grouping columns: se_t_id:7!null @@ -5395,7 +5395,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 50] │ ├── key: (1) - │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45), (48)-->(49-51) + │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (42)-->(43-45), (48)-->(49-51), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null se_t_id:42 se_cash_type:43 se_cash_due_date:44 settlement.se_amt:45 @@ -5403,7 +5403,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45) + │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (42)-->(43-45), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ │ ├── limit │ │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null @@ -5489,7 +5489,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 50] │ ├── key: (1) - │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45), (48)-->(49-51) + │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45,48-51), (18)-->(19), (42)-->(43-45), (48)-->(49-51), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ ├── left-join (lookup settlement) │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null se_t_id:42 se_cash_type:43 se_cash_due_date:44 settlement.se_amt:45 @@ -5498,7 +5498,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 50] │ │ ├── key: (1) - │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (4)==(18), (18)==(4), (6)==(24), (24)==(6), (42)-->(43-45) + │ │ ├── fd: ()-->(6,24,27), (1)-->(2,4,5,7,9-11,42-45), (18)-->(19), (42)-->(43-45), (4)==(18), (18)==(4), (6)==(24), (24)==(6) │ │ ├── ordering: +2 opt(6,24,27) [actual: +2] │ │ ├── limit │ │ │ ├── columns: t_id:1!null t_dts:2!null t_tt_id:4!null t_is_cash:5!null t_s_symb:6!null t_qty:7!null t_ca_id:9!null t_exec_name:10!null trade.t_trade_price:11 tt_id:18!null tt_name:19!null s_symb:24!null s_name:27!null @@ -5579,7 +5579,7 @@ update cash_transaction ├── cardinality: [0 - 4] ├── immutable ├── key: (7) - ├── fd: (7)-->(8-10,13-16), (7)==(13), (13)==(7), (10,14-16)-->(18) + ├── fd: (7)-->(8-10,13-16), (10,14-16)-->(18), (7)==(13), (13)==(7) ├── distinct-on │ ├── columns: ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null │ ├── grouping columns: ct_t_id:7!null @@ -5685,7 +5685,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,3,8,17), (17)==(1), (1)==(17) + ├── fd: ()-->(1,3,8,17), (1)==(17), (17)==(1) ├── scan customer │ ├── columns: c_id:8!null c_ad_id:17!null │ ├── constraint: /8: [/0 - /0] @@ -5711,7 +5711,7 @@ project ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,3,8,14), (14)==(1), (1)==(14) + ├── fd: ()-->(1,3,8,14), (1)==(14), (14)==(1) ├── scan company │ ├── columns: co_id:8!null co_ad_id:14!null │ ├── constraint: /8: [/0 - /0] @@ -6099,7 +6099,7 @@ project ├── window partition=() │ ├── columns: wi_wl_id:1!null wi_s_symb:2!null wl_id:5!null wl_c_id:6!null row_number:9 │ ├── key: (2,5) - │ ├── fd: ()-->(6), (1)==(5), (5)==(1), (2,5)-->(9) + │ ├── fd: ()-->(6), (2,5)-->(9), (1)==(5), (5)==(1) │ ├── inner-join (lookup watch_item) │ │ ├── columns: wi_wl_id:1!null wi_s_symb:2!null wl_id:5!null wl_c_id:6!null │ │ ├── key columns: [5] = [1] diff --git a/pkg/sql/opt/xform/testdata/external/tpch b/pkg/sql/opt/xform/testdata/external/tpch index 50c9ce43f377..5bb28718d237 100644 --- a/pkg/sql/opt/xform/testdata/external/tpch +++ b/pkg/sql/opt/xform/testdata/external/tpch @@ -179,12 +179,12 @@ project │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null n_nationkey:28!null n_name:29!null n_regionkey:30!null r_regionkey:34!null r_name:35!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null s_suppkey:46!null s_nationkey:49!null n_nationkey:55!null n_regionkey:57!null r_regionkey:61!null r_name:62!null │ │ │ │ ├── key: (22,39,46) - │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (39,40)-->(42), (46)-->(49), (55)-->(57), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) + │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (39,40)-->(42), (46)-->(49), (55)-->(57), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null n_nationkey:28!null n_name:29!null n_regionkey:30!null r_regionkey:34!null r_name:35!null │ │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) │ │ │ │ │ ├── key: (21,22) - │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15) + │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15) │ │ │ │ │ ├── scan partsupp │ │ │ │ │ │ ├── columns: ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null │ │ │ │ │ │ ├── key: (21,22) @@ -501,7 +501,7 @@ sort │ ├── inner-join (hash) │ │ ├── columns: c_custkey:1!null c_nationkey:4!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_suppkey:24!null l_extendedprice:27!null l_discount:28!null s_suppkey:40!null s_nationkey:43!null n_nationkey:49!null n_name:50!null n_regionkey:51!null r_regionkey:55!null r_name:56!null │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(43,49) + │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (4)==(43,49), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1) │ │ ├── inner-join (lookup lineitem) │ │ │ ├── columns: c_custkey:1!null c_nationkey:4!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_suppkey:24!null l_extendedprice:27!null l_discount:28!null n_nationkey:49!null n_name:50!null n_regionkey:51!null r_regionkey:55!null r_name:56!null │ │ │ ├── key columns: [11] = [22] @@ -705,7 +705,7 @@ sort │ │ │ │ │ ├── columns: s_suppkey:1!null s_nationkey:4!null l_orderkey:10!null l_suppkey:12!null l_linenumber:13!null n1.n_nationkey:49!null n1.n_name:50!null n2.n_nationkey:55!null n2.n_name:56!null │ │ │ │ │ ├── key columns: [1] = [12] │ │ │ │ │ ├── key: (10,13,55) - │ │ │ │ │ ├── fd: (1)-->(4), (49)-->(50), (55)-->(56), (4)==(49), (49)==(4), (10,13)-->(12), (1)==(12), (12)==(1) + │ │ │ │ │ ├── fd: (1)-->(4), (49)-->(50), (55)-->(56), (10,13)-->(12), (4)==(49), (49)==(4), (1)==(12), (12)==(1) │ │ │ │ │ ├── inner-join (lookup supplier@s_nk) │ │ │ │ │ │ ├── columns: s_suppkey:1!null s_nationkey:4!null n1.n_nationkey:49!null n1.n_name:50!null n2.n_nationkey:55!null n2.n_name:56!null │ │ │ │ │ │ ├── key columns: [49] = [4] @@ -817,7 +817,7 @@ sort │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: p_partkey:1!null p_type:5!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_extendedprice:26!null l_discount:27!null o_orderkey:39!null o_custkey:40!null o_orderdate:43!null c_custkey:50!null c_nationkey:53!null n1.n_nationkey:60!null n1.n_regionkey:62!null n2.n_nationkey:66!null n2.n_name:67!null r_regionkey:72!null r_name:73!null │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (66)-->(67), (15)==(66), (66)==(15), (1)==(22), (22)==(1) + │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (66)-->(67), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (15)==(66), (66)==(15), (1)==(22), (22)==(1) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: p_partkey:1!null p_type:5!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_extendedprice:26!null l_discount:27!null o_orderkey:39!null o_custkey:40!null o_orderdate:43!null c_custkey:50!null c_nationkey:53!null n1.n_nationkey:60!null n1.n_regionkey:62!null r_regionkey:72!null r_name:73!null │ │ │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) @@ -971,11 +971,11 @@ sort │ ├── inner-join (hash) │ │ ├── columns: p_partkey:1!null p_name:2!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null n_nationkey:57!null n_name:58!null │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (57)-->(58), (15)==(57), (57)==(15), (1)==(22,39) + │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (57)-->(58), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21), (15)==(57), (57)==(15) │ │ ├── inner-join (hash) │ │ │ ├── columns: p_partkey:1!null p_name:2!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) - │ │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (1)==(22,39) + │ │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21) │ │ │ ├── scan supplier@s_nk │ │ │ │ ├── columns: s_suppkey:12!null s_nationkey:15!null │ │ │ │ ├── key: (12) @@ -984,17 +984,17 @@ sort │ │ │ │ ├── columns: p_partkey:1!null p_name:2!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null │ │ │ │ ├── key columns: [21] = [46] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (1)==(22,39) + │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (46)-->(50), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21) │ │ │ │ ├── inner-join (lookup lineitem) │ │ │ │ │ ├── columns: p_partkey:1!null p_name:2!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null │ │ │ │ │ ├── key columns: [21 24] = [21 24] │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (22)==(1,39), (39)==(1,22), (1)==(22,39) + │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22) │ │ │ │ │ ├── inner-join (lookup lineitem@l_pk_sk) │ │ │ │ │ │ ├── columns: p_partkey:1!null p_name:2!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_linenumber:24!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null │ │ │ │ │ │ ├── key columns: [39 40] = [22 23] │ │ │ │ │ │ ├── key: (21,24) - │ │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (1)==(22,39), (39)==(1,22), (21,24)-->(22,23), (22)==(1,39), (23)==(40), (40)==(23) + │ │ │ │ │ │ ├── fd: (1)-->(2), (39,40)-->(42), (21,24)-->(22,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (23)==(40), (40)==(23) │ │ │ │ │ │ ├── inner-join (merge) │ │ │ │ │ │ │ ├── columns: p_partkey:1!null p_name:2!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null │ │ │ │ │ │ │ ├── left ordering: +39 @@ -1107,7 +1107,7 @@ top-k │ ├── inner-join (hash) │ │ ├── columns: c_custkey:1!null c_name:2!null c_address:3!null c_nationkey:4!null c_phone:5!null c_acctbal:6!null c_comment:8!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_extendedprice:27!null l_discount:28!null l_returnflag:30!null n_nationkey:40!null n_name:41!null │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (40)-->(41), (4)==(40), (40)==(4) + │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (40)-->(41), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(40), (40)==(4) │ │ ├── inner-join (hash) │ │ │ ├── columns: c_custkey:1!null c_name:2!null c_address:3!null c_nationkey:4!null c_phone:5!null c_acctbal:6!null c_comment:8!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_extendedprice:27!null l_discount:28!null l_returnflag:30!null │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) @@ -2050,7 +2050,7 @@ scalar-group-by │ │ ├── columns: l_orderkey:1!null l_partkey:2!null l_linenumber:4!null l_quantity:5!null l_extendedprice:6!null l_discount:7!null l_shipinstruct:14!null l_shipmode:15!null p_partkey:19!null p_brand:22!null p_size:24!null p_container:25!null │ │ ├── grouping columns: l_orderkey:1!null l_linenumber:4!null p_partkey:19!null │ │ ├── key: (1,4,19) - │ │ ├── fd: (2)==(19), (19)==(2), (1,4,19)-->(2,5-7,14,15,22,24,25) + │ │ ├── fd: (1,4,19)-->(2,5-7,14,15,22,24,25), (2)==(19), (19)==(2) │ │ ├── union-all │ │ │ ├── columns: l_orderkey:1!null l_partkey:2!null l_linenumber:4!null l_quantity:5!null l_extendedprice:6!null l_discount:7!null l_shipinstruct:14!null l_shipmode:15!null p_partkey:19!null p_brand:22!null p_size:24!null p_container:25!null │ │ │ ├── left columns: l_orderkey:32 l_partkey:33 l_linenumber:35 l_quantity:36 l_extendedprice:37 l_discount:38 l_shipinstruct:45 l_shipmode:46 p_partkey:50 p_brand:53 p_size:55 p_container:56 @@ -2092,7 +2092,7 @@ scalar-group-by │ │ │ ├── columns: l_orderkey:61!null l_partkey:62!null l_linenumber:64!null l_quantity:65!null l_extendedprice:66!null l_discount:67!null l_shipinstruct:74!null l_shipmode:75!null p_partkey:79!null p_brand:82!null p_size:84!null p_container:85!null │ │ │ ├── grouping columns: l_orderkey:61!null l_linenumber:64!null p_partkey:79!null │ │ │ ├── key: (61,64,79) - │ │ │ ├── fd: (62)==(79), (79)==(62), (61,64,79)-->(62,65-67,74,75,82,84,85) + │ │ │ ├── fd: (61,64,79)-->(62,65-67,74,75,82,84,85), (62)==(79), (79)==(62) │ │ │ ├── union-all │ │ │ │ ├── columns: l_orderkey:61!null l_partkey:62!null l_linenumber:64!null l_quantity:65!null l_extendedprice:66!null l_discount:67!null l_shipinstruct:74!null l_shipmode:75!null p_partkey:79!null p_brand:82!null p_size:84!null p_container:85!null │ │ │ │ ├── left columns: l_orderkey:90 l_partkey:91 l_linenumber:93 l_quantity:94 l_extendedprice:95 l_discount:96 l_shipinstruct:103 l_shipmode:104 p_partkey:108 p_brand:111 p_size:113 p_container:114 @@ -2417,7 +2417,7 @@ top-k │ │ │ │ │ ├── columns: s_suppkey:1!null s_name:2!null s_nationkey:4!null l1.l_orderkey:10!null l1.l_suppkey:12!null l1.l_linenumber:13!null n_nationkey:39!null n_name:40!null │ │ │ │ │ ├── key columns: [1] = [12] │ │ │ │ │ ├── key: (10,13) - │ │ │ │ │ ├── fd: ()-->(40), (1)-->(2,4), (4)==(39), (39)==(4), (10,13)-->(12), (1)==(12), (12)==(1) + │ │ │ │ │ ├── fd: ()-->(40), (1)-->(2,4), (10,13)-->(12), (4)==(39), (39)==(4), (1)==(12), (12)==(1) │ │ │ │ │ ├── inner-join (lookup supplier) │ │ │ │ │ │ ├── columns: s_suppkey:1!null s_name:2!null s_nationkey:4!null n_nationkey:39!null n_name:40!null │ │ │ │ │ │ ├── key columns: [1] = [1] diff --git a/pkg/sql/opt/xform/testdata/external/tpch-no-stats b/pkg/sql/opt/xform/testdata/external/tpch-no-stats index df187caf7b94..c81e9079d2f5 100644 --- a/pkg/sql/opt/xform/testdata/external/tpch-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpch-no-stats @@ -181,7 +181,7 @@ project │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null n_nationkey:28!null n_name:29!null n_regionkey:30!null r_regionkey:34!null r_name:35!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null s_suppkey:46!null s_nationkey:49!null n_nationkey:55!null n_regionkey:57!null r_regionkey:61!null r_name:62!null │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) │ │ │ │ ├── key: (22,39,46) - │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (39,40)-->(42), (46)-->(49), (55)-->(57), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) + │ │ │ │ ├── fd: ()-->(35,62), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (39,40)-->(42), (46)-->(49), (55)-->(57), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15), (57)==(61), (61)==(57), (49)==(55), (55)==(49), (40)==(46), (46)==(40), (21)==(39), (39)==(21) │ │ │ │ ├── inner-join (hash) │ │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null n_nationkey:28!null n_name:29!null n_regionkey:30!null r_regionkey:34!null r_name:35!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null s_suppkey:46!null s_nationkey:49!null │ │ │ │ │ ├── multiplicity: left-rows(one-or-more), right-rows(zero-or-more) @@ -191,7 +191,7 @@ project │ │ │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null n_nationkey:28!null n_name:29!null n_regionkey:30!null r_regionkey:34!null r_name:35!null │ │ │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) │ │ │ │ │ │ ├── key: (21,22) - │ │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (12)==(22), (22)==(12), (28)-->(29,30), (30)==(34), (34)==(30), (15)==(28), (28)==(15) + │ │ │ │ │ │ ├── fd: ()-->(35), (12)-->(13-18), (21,22)-->(24), (28)-->(29,30), (12)==(22), (22)==(12), (30)==(34), (34)==(30), (15)==(28), (28)==(15) │ │ │ │ │ │ ├── inner-join (hash) │ │ │ │ │ │ │ ├── columns: s_suppkey:12!null s_name:13!null s_address:14!null s_nationkey:15!null s_phone:16!null s_acctbal:17!null s_comment:18!null ps_partkey:21!null ps_suppkey:22!null ps_supplycost:24!null │ │ │ │ │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one) @@ -525,12 +525,12 @@ sort │ │ ├── columns: c_custkey:1!null c_nationkey:4!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_suppkey:24!null l_extendedprice:27!null l_discount:28!null s_suppkey:40!null s_nationkey:43!null n_nationkey:49!null n_name:50!null n_regionkey:51!null r_regionkey:55!null r_name:56!null │ │ ├── key columns: [51] = [55] │ │ ├── lookup columns are key - │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(43,49) + │ │ ├── fd: ()-->(56), (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (51)==(55), (55)==(51), (4)==(43,49), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1) │ │ ├── inner-join (lookup nation) │ │ │ ├── columns: c_custkey:1!null c_nationkey:4!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_suppkey:24!null l_extendedprice:27!null l_discount:28!null s_suppkey:40!null s_nationkey:43!null n_nationkey:49!null n_name:50!null n_regionkey:51!null │ │ │ ├── key columns: [43] = [49] │ │ │ ├── lookup columns are key - │ │ │ ├── fd: (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(43,49) + │ │ │ ├── fd: (1)-->(4), (11)-->(12,15), (40)-->(43), (49)-->(50,51), (4)==(43,49), (43)==(4,49), (49)==(4,43), (24)==(40), (40)==(24), (11)==(22), (22)==(11), (1)==(12), (12)==(1) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: c_custkey:1!null c_nationkey:4!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_suppkey:24!null l_extendedprice:27!null l_discount:28!null s_suppkey:40!null s_nationkey:43!null │ │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(zero-or-one) @@ -844,7 +844,7 @@ sort │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: p_partkey:1!null p_type:5!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_extendedprice:26!null l_discount:27!null o_orderkey:39!null o_custkey:40!null o_orderdate:43!null c_custkey:50!null c_nationkey:53!null n1.n_nationkey:60!null n1.n_regionkey:62!null n2.n_nationkey:66!null n2.n_name:67!null r_regionkey:72!null r_name:73!null │ │ │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (66)-->(67), (15)==(66), (66)==(15), (1)==(22), (22)==(1) + │ │ │ │ ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (66)-->(67), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (15)==(66), (66)==(15), (1)==(22), (22)==(1) │ │ │ │ ├── inner-join (lookup nation [as=n2]) │ │ │ │ │ ├── columns: p_partkey:1!null p_type:5!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_extendedprice:26!null l_discount:27!null o_orderkey:39!null o_custkey:40!null o_orderdate:43!null c_custkey:50!null c_nationkey:53!null n2.n_nationkey:66!null n2.n_name:67!null │ │ │ │ │ ├── key columns: [15] = [66] @@ -991,22 +991,22 @@ sort │ │ ├── columns: p_partkey:1!null p_name:2!null s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null n_nationkey:57!null n_name:58!null │ │ ├── key columns: [22] = [1] │ │ ├── lookup columns are key - │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(1,39), (39)==(1,22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (57)-->(58), (15)==(57), (57)==(15), (1)==(22,39) + │ │ ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (57)-->(58), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21), (15)==(57), (57)==(15) │ │ ├── inner-join (lookup nation) │ │ │ ├── columns: s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null n_nationkey:57!null n_name:58!null │ │ │ ├── key columns: [15] = [57] │ │ │ ├── lookup columns are key - │ │ │ ├── fd: (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(39), (39)==(22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40), (57)-->(58), (15)==(57), (57)==(15) + │ │ │ ├── fd: (12)-->(15), (39,40)-->(42), (46)-->(50), (57)-->(58), (12)==(23,40), (23)==(12,40), (40)==(12,23), (22)==(39), (39)==(22), (21)==(46), (46)==(21), (15)==(57), (57)==(15) │ │ │ ├── inner-join (lookup supplier) │ │ │ │ ├── columns: s_suppkey:12!null s_nationkey:15!null l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null │ │ │ │ ├── key columns: [23] = [12] │ │ │ │ ├── lookup columns are key - │ │ │ │ ├── fd: (12)-->(15), (39,40)-->(42), (23)==(12,40), (40)==(12,23), (22)==(39), (39)==(22), (46)-->(50), (21)==(46), (46)==(21), (12)==(23,40) + │ │ │ │ ├── fd: (12)-->(15), (39,40)-->(42), (46)-->(50), (12)==(23,40), (23)==(12,40), (40)==(12,23), (22)==(39), (39)==(22), (21)==(46), (46)==(21) │ │ │ │ ├── inner-join (lookup orders) │ │ │ │ │ ├── columns: l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null o_orderkey:46!null o_orderdate:50!null │ │ │ │ │ ├── key columns: [21] = [46] │ │ │ │ │ ├── lookup columns are key - │ │ │ │ │ ├── fd: (39,40)-->(42), (23)==(40), (40)==(23), (22)==(39), (39)==(22), (46)-->(50), (21)==(46), (46)==(21) + │ │ │ │ │ ├── fd: (39,40)-->(42), (46)-->(50), (23)==(40), (40)==(23), (22)==(39), (39)==(22), (21)==(46), (46)==(21) │ │ │ │ │ ├── inner-join (hash) │ │ │ │ │ │ ├── columns: l_orderkey:21!null l_partkey:22!null l_suppkey:23!null l_quantity:25!null l_extendedprice:26!null l_discount:27!null ps_partkey:39!null ps_suppkey:40!null ps_supplycost:42!null │ │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) @@ -1103,7 +1103,7 @@ top-k │ │ ├── columns: c_custkey:1!null c_name:2!null c_address:3!null c_nationkey:4!null c_phone:5!null c_acctbal:6!null c_comment:8!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_extendedprice:27!null l_discount:28!null l_returnflag:30!null n_nationkey:40!null n_name:41!null │ │ ├── key columns: [4] = [40] │ │ ├── lookup columns are key - │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (40)-->(41), (4)==(40), (40)==(4) + │ │ ├── fd: ()-->(30), (1)-->(2-6,8), (11)-->(12,15), (40)-->(41), (11)==(22), (22)==(11), (1)==(12), (12)==(1), (4)==(40), (40)==(4) │ │ ├── inner-join (lookup customer) │ │ │ ├── columns: c_custkey:1!null c_name:2!null c_address:3!null c_nationkey:4!null c_phone:5!null c_acctbal:6!null c_comment:8!null o_orderkey:11!null o_custkey:12!null o_orderdate:15!null l_orderkey:22!null l_extendedprice:27!null l_discount:28!null l_returnflag:30!null │ │ │ ├── key columns: [12] = [1] diff --git a/pkg/sql/opt/xform/testdata/external/trading b/pkg/sql/opt/xform/testdata/external/trading index 1859ff1bf45c..cc5ff718da66 100644 --- a/pkg/sql/opt/xform/testdata/external/trading +++ b/pkg/sql/opt/xform/testdata/external/trading @@ -832,7 +832,7 @@ project │ │ │ ├── immutable │ │ │ ├── stats: [rows=519622.1, distinct(10)=19000, null(10)=0, distinct(23)=19000, null(23)=0, distinct(2,4,5,10)=29618.5, null(2,4,5,10)=0] │ │ │ ├── key: (10,22-24) - │ │ │ ├── fd: ()-->(9), (1)-->(2-6), (2,4,5)~~>(1,3,6), (10)-->(11-17), (17)-->(10-16), (1)==(10), (10)==(1), (10,22-24)-->(20,21) + │ │ │ ├── fd: ()-->(9), (1)-->(2-6), (2,4,5)~~>(1,3,6), (10)-->(11-17), (17)-->(10-16), (10,22-24)-->(20,21), (1)==(10), (10)==(1) │ │ │ ├── ordering: +2,+4,+5 opt(9) [actual: +2,+4,+5] │ │ │ ├── limit hint: 877.19 │ │ │ ├── project diff --git a/pkg/sql/opt/xform/testdata/external/trading-mutation b/pkg/sql/opt/xform/testdata/external/trading-mutation index b3b7b38d8427..822322d72c92 100644 --- a/pkg/sql/opt/xform/testdata/external/trading-mutation +++ b/pkg/sql/opt/xform/testdata/external/trading-mutation @@ -836,7 +836,7 @@ project │ │ │ ├── immutable │ │ │ ├── stats: [rows=519622.1, distinct(10)=19000, null(10)=0, distinct(27)=19000, null(27)=0, distinct(2,4,5,10)=29618.5, null(2,4,5,10)=0] │ │ │ ├── key: (10,26-28) - │ │ │ ├── fd: ()-->(9), (1)-->(2-6), (2,4,5)~~>(1,3,6), (10)-->(11-17), (17)-->(10-16), (1)==(10), (10)==(1), (10,26-28)-->(24,25) + │ │ │ ├── fd: ()-->(9), (1)-->(2-6), (2,4,5)~~>(1,3,6), (10)-->(11-17), (17)-->(10-16), (10,26-28)-->(24,25), (1)==(10), (10)==(1) │ │ │ ├── ordering: +2,+4,+5 opt(9) [actual: +2,+4,+5] │ │ │ ├── limit hint: 877.19 │ │ │ ├── project diff --git a/pkg/sql/opt/xform/testdata/physprops/limit_hint b/pkg/sql/opt/xform/testdata/physprops/limit_hint index 2c3cf9dd5195..8f7bcfd97ef6 100644 --- a/pkg/sql/opt/xform/testdata/physprops/limit_hint +++ b/pkg/sql/opt/xform/testdata/physprops/limit_hint @@ -648,7 +648,7 @@ project ├── cardinality: [0 - 0] ├── immutable ├── key: () - ├── fd: ()-->(5,6,10), (10)==(6), (6)==(10) + ├── fd: ()-->(5,6,10), (6)==(10), (10)==(6) ├── inner-join (cross) │ ├── columns: "?column?":5!null t0.c0:6!null t1.c0:10!null │ ├── cardinality: [0 - 0] diff --git a/pkg/sql/opt/xform/testdata/physprops/ordering b/pkg/sql/opt/xform/testdata/physprops/ordering index 97b1200d7661..86cdee2de26c 100644 --- a/pkg/sql/opt/xform/testdata/physprops/ordering +++ b/pkg/sql/opt/xform/testdata/physprops/ordering @@ -1577,7 +1577,7 @@ union ├── right columns: y:7 x:6 z:8 ├── internal-ordering: +(11|12),+13 ├── key: (12,13) - ├── fd: (11)==(12), (12)==(11) + ├── fd: (12,13)-->(11), (11)==(12), (12)==(11) ├── ordering: +(11|12) [actual: +11] ├── select │ ├── columns: abc.a:1!null abc.b:2!null abc.c:3!null @@ -2922,7 +2922,7 @@ project └── project ├── columns: t0_85393.c0:1 t0_85393.rowid:2!null t1_85393.c0:5 t1_85393.rowid:6!null ├── key: (6) - ├── fd: (2)==(6), (6)==(2), (2)-->(1,5) + ├── fd: (2)-->(1,5), (2)==(6), (6)==(2) ├── ordering: +(2|6) [actual: +2] ├── inner-join (merge) │ ├── columns: t0_85393.c0:17 t0_85393.rowid:18!null t1_85393.c0:21 t1_85393.rowid:22!null diff --git a/pkg/sql/opt/xform/testdata/rules/cycle b/pkg/sql/opt/xform/testdata/rules/cycle index 4d3bf9dd6f2b..8966bb7eb6dc 100644 --- a/pkg/sql/opt/xform/testdata/rules/cycle +++ b/pkg/sql/opt/xform/testdata/rules/cycle @@ -62,7 +62,7 @@ expropt disable=MemoCycleTestRelRuleFilter skip-race ---- error: memo group optimization passes surpassed limit of 100000; there may be a cycle in the memo details: -memo (not optimized, ~16KB, required=[], cycle=[G1->G3->G5->G5]) +memo (not optimized, ~17KB, required=[], cycle=[G1->G3->G5->G5]) ├── G1: (left-join G2 G3 G4) ├── G2: (scan ab,cols=()) (scan ab@ab_b_idx,cols=()) │ └── [] diff --git a/pkg/sql/opt/xform/testdata/rules/disjunction_in_join b/pkg/sql/opt/xform/testdata/rules/disjunction_in_join index 72595835001d..c427060c8cf0 100644 --- a/pkg/sql/opt/xform/testdata/rules/disjunction_in_join +++ b/pkg/sql/opt/xform/testdata/rules/disjunction_in_join @@ -394,7 +394,7 @@ project │ ├── inner-join (cross) │ │ ├── columns: b1:15!null b2:16!null b3:17 b4:18 b.rowid:19!null d1:22 d2:23 d3:24 d4:25 d.rowid:26!null │ │ ├── key: (19,26) - │ │ ├── fd: (19)-->(15-18), (15)==(16), (16)==(15), (26)-->(22-25) + │ │ ├── fd: (19)-->(15-18), (26)-->(22-25), (15)==(16), (16)==(15) │ │ ├── scan d │ │ │ ├── columns: d1:22 d2:23 d3:24 d4:25 d.rowid:26!null │ │ │ ├── key: (26) @@ -790,7 +790,7 @@ project ├── columns: e1:1!null e2:2!null e3:3!null e4:4!null e5:5 f1:8!null f2:9 f3:10!null ├── grouping columns: e1:1!null f1:8!null ├── key: (1,8) - ├── fd: (2)==(10), (10)==(2), (1,8)-->(2-5,9,10) + ├── fd: (1,8)-->(2-5,9,10), (2)==(10), (10)==(2) ├── union-all │ ├── columns: e1:1!null e2:2!null e3:3!null e4:4!null e5:5 f1:8!null f2:9 f3:10!null │ ├── left columns: e1:14 e2:15 e3:16 e4:17 e5:18 f1:21 f2:22 f3:23 @@ -873,7 +873,7 @@ project ├── columns: e1:1!null e2:2!null e3:3!null e4:4!null e5:5 f1:8!null f2:9 f3:10!null ├── grouping columns: e1:1!null f1:8!null ├── key: (1,8) - ├── fd: (2)==(10), (10)==(2), (1,8)-->(2-5,9,10) + ├── fd: (1,8)-->(2-5,9,10), (2)==(10), (10)==(2) ├── union-all │ ├── columns: e1:1!null e2:2!null e3:3!null e4:4!null e5:5 f1:8!null f2:9 f3:10!null │ ├── left columns: e1:14 e2:15 e3:16 e4:17 e5:18 f1:21 f2:22 f3:23 @@ -2722,7 +2722,7 @@ project ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7!null c2:8!null c3:9 c4:10 c.rowid:11!null ├── grouping columns: a1:1!null a3:3!null a4:4!null c.rowid:11!null ├── key: (1,3,4,11) - ├── fd: (11)-->(7-10), (2)==(8), (8)==(2), (1,3,4,11)-->(2,7-10) + ├── fd: (11)-->(7-10), (1,3,4,11)-->(2,7-10), (2)==(8), (8)==(2) ├── inner-join (cross) │ ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7!null c2:8!null c3:9 c4:10 c.rowid:11!null b1:14 │ ├── fd: (11)-->(7-10), (2)==(8), (8)==(2) @@ -2767,7 +2767,7 @@ project ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7!null c2:8!null c3:9 c4:10 c.rowid:11!null ├── grouping columns: a1:1!null a3:3!null a4:4!null c.rowid:11!null ├── key: (1,3,4,11) - ├── fd: (11)-->(7-10), (2)==(8), (8)==(2), (1,3,4,11)-->(2,7-10) + ├── fd: (11)-->(7-10), (1,3,4,11)-->(2,7-10), (2)==(8), (8)==(2) ├── inner-join (hash) │ ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7!null c2:8!null c3:9 c4:10 c.rowid:11!null b1:14 b2:15 │ ├── fd: (11)-->(7-10), (2)==(8), (8)==(2) @@ -2849,7 +2849,7 @@ project ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7 c2:8!null c3:9 c4:10 c.rowid:11!null ├── grouping columns: a1:1!null a3:3!null a4:4!null c.rowid:11!null ├── key: (1,3,4,11) - ├── fd: (11)-->(7-10), (2)==(8), (8)==(2), (1,3,4,11)-->(2,7-10) + ├── fd: (11)-->(7-10), (1,3,4,11)-->(2,7-10), (2)==(8), (8)==(2) ├── inner-join (cross) │ ├── columns: a1:1!null a2:2!null a3:3!null a4:4!null c1:7 c2:8!null c3:9 c4:10 c.rowid:11!null b1:14 b3:16 │ ├── fd: (11)-->(7-10), (2)==(8), (8)==(2) diff --git a/pkg/sql/opt/xform/testdata/rules/generic b/pkg/sql/opt/xform/testdata/rules/generic index 0fb33708d500..c080ee523130 100644 --- a/pkg/sql/opt/xform/testdata/rules/generic +++ b/pkg/sql/opt/xform/testdata/rules/generic @@ -32,7 +32,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8), (1)==(8), (8)==(1) ├── values │ ├── columns: "$1":8 │ ├── cardinality: [1 - 1] @@ -59,7 +59,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8), (1)==(8), (8)==(1) ├── values │ ├── columns: "$1":8 │ ├── cardinality: [1 - 1] @@ -120,7 +120,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8), (2)==(1,8), (8)==(1,2), (1)==(2,8) + ├── fd: ()-->(1-5,8), (1)==(2,8), (2)==(1,8), (8)==(1,2) ├── values │ ├── columns: "$1":8 │ ├── cardinality: [1 - 1] @@ -181,7 +181,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8,9), (9)==(1), (1)==(9) + ├── fd: ()-->(1-5,8,9), (1)==(9), (9)==(1) ├── project │ ├── columns: k:8!null i:9 │ ├── cardinality: [0 - 1] @@ -196,7 +196,7 @@ project │ ├── cardinality: [0 - 1] │ ├── has-placeholder │ ├── key: () - │ ├── fd: ()-->(8,9,15), (15)==(8), (8)==(15) + │ ├── fd: ()-->(8,9,15), (8)==(15), (15)==(8) │ ├── values │ │ ├── columns: "$1":15 │ │ ├── cardinality: [1 - 1] @@ -223,7 +223,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-5,8), (1)==(8), (8)==(1) ├── project │ ├── columns: int8:8 k:1!null i:2 s:3 b:4 t:5 │ ├── has-placeholder @@ -338,7 +338,7 @@ project ├── cardinality: [0 - 1] ├── has-placeholder ├── key: () - ├── fd: ()-->(1-5,8,9), (2)==(1,9), (3)==(8), (8)==(3), (9)==(1,2), (1)==(2,9) + ├── fd: ()-->(1-5,8,9), (1)==(2,9), (2)==(1,9), (9)==(1,2), (3)==(8), (8)==(3) ├── inner-join (lookup t@partial_idx,partial) │ ├── columns: k:1!null s:3!null "$1":8!null "$2":9!null │ ├── flags: disallow merge join @@ -347,7 +347,7 @@ project │ ├── cardinality: [0 - 1] │ ├── has-placeholder │ ├── key: () - │ ├── fd: ()-->(1,3,8,9), (8)==(3), (1)==(9), (9)==(1), (3)==(8) + │ ├── fd: ()-->(1,3,8,9), (3)==(8), (8)==(3), (1)==(9), (9)==(1) │ ├── values │ │ ├── columns: "$1":8 "$2":9 │ │ ├── cardinality: [1 - 1] diff --git a/pkg/sql/opt/xform/testdata/rules/groupby b/pkg/sql/opt/xform/testdata/rules/groupby index 6bc0230a07ed..bb77560e2489 100644 --- a/pkg/sql/opt/xform/testdata/rules/groupby +++ b/pkg/sql/opt/xform/testdata/rules/groupby @@ -1152,7 +1152,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,2,9), (9)==(1), (1)==(9) + │ ├── fd: ()-->(1,2,9), (1)==(9), (9)==(1) │ ├── scalar-group-by │ │ ├── columns: min:9 │ │ ├── cardinality: [1 - 1] @@ -1187,7 +1187,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1,2,9), (9)==(1), (1)==(9) + │ ├── fd: ()-->(1,2,9), (1)==(9), (9)==(1) │ ├── scalar-group-by │ │ ├── columns: max:9 │ │ ├── cardinality: [1 - 1] @@ -1819,7 +1819,7 @@ memo (optimized, ~9KB, required=[presentation: array_agg:7]) memo SELECT array_agg(k) FROM (SELECT * FROM kuvw WHERE u=v ORDER BY u) GROUP BY w ---- -memo (optimized, ~15KB, required=[presentation: array_agg:7]) +memo (optimized, ~16KB, required=[presentation: array_agg:7]) ├── G1: (project G2 G3 array_agg) │ └── [presentation: array_agg:7] │ ├── best: (project G2 G3 array_agg) @@ -2019,7 +2019,7 @@ memo (optimized, ~7KB, required=[presentation: u:2,v:3,w:4]) memo SELECT DISTINCT ON (u, v) u, v, w FROM kuvw ---- -memo (optimized, ~6KB, required=[presentation: u:2,v:3,w:4]) +memo (optimized, ~7KB, required=[presentation: u:2,v:3,w:4]) ├── G1: (distinct-on G2 G3 cols=(2,3)) (distinct-on G2 G3 cols=(2,3),ordering=+2,+3) (distinct-on G2 G3 cols=(2,3),ordering=+3) │ └── [presentation: u:2,v:3,w:4] │ ├── best: (distinct-on G2="[ordering: +2,+3]" G3 cols=(2,3),ordering=+2,+3) @@ -2142,7 +2142,7 @@ memo (optimized, ~6KB, required=[presentation: u:2,v:3,w:4] [ordering: +2]) memo SELECT DISTINCT ON (u) u, v, w FROM kuvw ORDER BY u, v, w ---- -memo (optimized, ~6KB, required=[presentation: u:2,v:3,w:4] [ordering: +2]) +memo (optimized, ~7KB, required=[presentation: u:2,v:3,w:4] [ordering: +2]) ├── G1: (distinct-on G2 G3 cols=(2),ordering=+3,+4 opt(2)) (distinct-on G2 G3 cols=(2),ordering=+2,+3,+4) (distinct-on G2 G3 cols=(2),ordering=+3,+4) │ ├── [presentation: u:2,v:3,w:4] [ordering: +2] │ │ ├── best: (distinct-on G2="[ordering: +2,+3,+4]" G3 cols=(2),ordering=+3,+4 opt(2)) @@ -2298,7 +2298,7 @@ memo (optimized, ~6KB, required=[presentation: u:2,v:3,w:4] [ordering: +4]) memo SELECT (SELECT w FROM kuvw WHERE v=1 AND x=u) FROM xyz ORDER BY x+1, x ---- -memo (optimized, ~26KB, required=[presentation: w:12] [ordering: +13,+1]) +memo (optimized, ~27KB, required=[presentation: w:12] [ordering: +13,+1]) ├── G1: (project G2 G3 x) │ ├── [presentation: w:12] [ordering: +13,+1] │ │ ├── best: (sort G1) @@ -2422,7 +2422,7 @@ memo (optimized, ~28KB, required=[]) memo INSERT INTO xyz SELECT v, w, 1.0 FROM kuvw ON CONFLICT (x) DO UPDATE SET z=2.0 ---- -memo (optimized, ~28KB, required=[]) +memo (optimized, ~29KB, required=[]) ├── G1: (upsert G2 G3 G4 xyz) │ └── [] │ ├── best: (upsert G2 G3 G4 xyz) @@ -3417,7 +3417,7 @@ INDEX gg (g) memo SELECT d, e, count(*) FROM defg GROUP BY d, e LIMIT 10 ---- -memo (optimized, ~20KB, required=[presentation: d:1,e:2,count:8]) +memo (optimized, ~21KB, required=[presentation: d:1,e:2,count:8]) ├── G1: (limit G2 G3) (limit G4 G3) (limit G5 G3) (limit G6 G3) │ └── [presentation: d:1,e:2,count:8] │ ├── best: (limit G4="[limit hint: 10.00]" G3) diff --git a/pkg/sql/opt/xform/testdata/rules/join b/pkg/sql/opt/xform/testdata/rules/join index 36c1875463d8..868f13247321 100644 --- a/pkg/sql/opt/xform/testdata/rules/join +++ b/pkg/sql/opt/xform/testdata/rules/join @@ -212,7 +212,7 @@ inner-join (merge) ├── columns: a:1!null b:2 c:3 s:7!null t:8!null u:9!null x:12!null y:13 z:14 ├── left ordering: +7 ├── right ordering: +12 - ├── fd: (7)==(1,12), (12)==(1,7), (1)==(7,12) + ├── fd: (1)==(7,12), (7)==(1,12), (12)==(1,7) ├── scan stu │ ├── columns: s:7!null t:8!null u:9!null │ ├── key: (7-9) @@ -235,7 +235,7 @@ inner-join (merge) memo expect=ReorderJoins SELECT * FROM abc, stu, xyz WHERE abc.a=stu.s AND stu.s=xyz.x ---- -memo (optimized, ~46KB, required=[presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14]) +memo (optimized, ~47KB, required=[presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) (inner-join G5 G6 G7) (inner-join G6 G5 G7) (inner-join G8 G9 G7) (inner-join G9 G8 G7) (merge-join G2 G3 G10 inner-join,+1,+7) (merge-join G3 G2 G10 inner-join,+7,+1) (lookup-join G3 G10 abc@ab,keyCols=[7],outCols=(1-3,7-9,12-14)) (merge-join G5 G6 G10 inner-join,+7,+12) (merge-join G6 G5 G10 inner-join,+12,+7) (lookup-join G6 G10 stu,keyCols=[12],outCols=(1-3,7-9,12-14)) (merge-join G8 G9 G10 inner-join,+7,+12) (lookup-join G8 G10 xyz@xy,keyCols=[7],outCols=(1-3,7-9,12-14)) (merge-join G9 G8 G10 inner-join,+12,+7) │ └── [presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14] │ ├── best: (merge-join G5="[ordering: +7]" G6="[ordering: +(1|12)]" G10 inner-join,+7,+12) @@ -297,7 +297,7 @@ memo (optimized, ~46KB, required=[presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:1 memo SELECT * FROM abc, stu, xyz, pqr WHERE a = 1 ---- -memo (optimized, ~31KB, required=[presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22]) +memo (optimized, ~32KB, required=[presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) │ └── [presentation: a:1,b:2,c:3,s:7,t:8,u:9,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22] │ ├── best: (inner-join G3 G2 G4) @@ -343,7 +343,7 @@ SELECT * FROM stu, abc, xyz, pqr WHERE u = a AND a = x AND x = p ---- -memo (optimized, ~40KB, required=[presentation: s:1,t:2,u:3,a:6,b:7,c:8,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22]) +memo (optimized, ~41KB, required=[presentation: s:1,t:2,u:3,a:6,b:7,c:8,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) (merge-join G2 G3 G5 inner-join,+3,+6) (merge-join G3 G2 G5 inner-join,+6,+3) (lookup-join G3 G5 stu@uts,keyCols=[6],outCols=(1-3,6-8,12-14,18-22)) │ └── [presentation: s:1,t:2,u:3,a:6,b:7,c:8,x:12,y:13,z:14,p:18,q:19,r:20,s:21,t:22] │ ├── best: (merge-join G2="[ordering: +3]" G3="[ordering: +(6|12|18)]" G5 inner-join,+3,+6) @@ -1852,7 +1852,7 @@ memo (optimized, ~16KB, required=[presentation: a:1,b:2,c:3,x:7,y:8,z:9]) memo SELECT * FROM abc INNER HASH JOIN xyz ON a=x ---- -memo (optimized, ~11KB, required=[presentation: a:1,b:2,c:3,x:7,y:8,z:9]) +memo (optimized, ~12KB, required=[presentation: a:1,b:2,c:3,x:7,y:8,z:9]) ├── G1: (inner-join G2 G3 G4) │ └── [presentation: a:1,b:2,c:3,x:7,y:8,z:9] │ ├── best: (inner-join G2 G3 G4) @@ -2152,7 +2152,7 @@ left-join (merge) memo SELECT * FROM abc JOIN xyz ON a=b ---- -memo (optimized, ~17KB, required=[presentation: a:1,b:2,c:3,x:7,y:8,z:9]) +memo (optimized, ~18KB, required=[presentation: a:1,b:2,c:3,x:7,y:8,z:9]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) │ └── [presentation: a:1,b:2,c:3,x:7,y:8,z:9] │ ├── best: (inner-join G3 G2 G4) @@ -2190,7 +2190,7 @@ CREATE TABLE kfloat (k FLOAT PRIMARY KEY) memo SELECT * FROM abc JOIN kfloat ON a=k ---- -memo (optimized, ~13KB, required=[presentation: a:1,b:2,c:3,k:7]) +memo (optimized, ~14KB, required=[presentation: a:1,b:2,c:3,k:7]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) │ └── [presentation: a:1,b:2,c:3,k:7] │ ├── best: (inner-join G3 G2 G4) @@ -2215,7 +2215,7 @@ SELECT * FROM abc JOIN xyz ON a=x AND a=y inner-join (lookup abc@ab) ├── columns: a:1!null b:2 c:3 x:7!null y:8!null z:9 ├── key columns: [7] = [1] - ├── fd: (7)==(1,8), (8)==(1,7), (1)==(7,8) + ├── fd: (1)==(7,8), (7)==(1,8), (8)==(1,7) ├── select │ ├── columns: x:7!null y:8!null z:9 │ ├── fd: (7)==(8), (8)==(7) @@ -2484,7 +2484,7 @@ GenerateLookupJoins Source expression: inner-join (hash) ├── columns: a:1!null b:2 c:3 x:7!null y:8!null z:9 - ├── fd: (7)==(1,8), (8)==(1,7), (1)==(7,8) + ├── fd: (1)==(7,8), (7)==(1,8), (8)==(1,7) ├── select │ ├── columns: x:7!null y:8!null z:9 │ ├── fd: (7)==(8), (8)==(7) @@ -2502,7 +2502,7 @@ New expression 1 of 1: inner-join (lookup abc@ab) ├── columns: a:1!null b:2 c:3 x:7!null y:8!null z:9 ├── key columns: [7] = [1] - ├── fd: (7)==(1,8), (8)==(1,7), (1)==(7,8) + ├── fd: (1)==(7,8), (7)==(1,8), (8)==(1,7) ├── select │ ├── columns: x:7!null y:8!null z:9 │ ├── fd: (7)==(8), (8)==(7) @@ -2687,7 +2687,7 @@ No new expressions. memo expect-not=GenerateLookupJoins SELECT a,b,n,m FROM small INNER HASH JOIN abcd ON a=m ---- -memo (optimized, ~10KB, required=[presentation: a:6,b:7,n:2,m:1]) +memo (optimized, ~11KB, required=[presentation: a:6,b:7,n:2,m:1]) ├── G1: (inner-join G2 G3 G4) │ └── [presentation: a:6,b:7,n:2,m:1] │ ├── best: (inner-join G2 G3 G4) @@ -7276,7 +7276,7 @@ WHERE n.name = 'Upper West Side' OR n.name = 'Upper East Side' GROUP BY n.name, n.geom ---- -memo (optimized, ~37KB, required=[presentation: name:16,popn_per_sqkm:22]) +memo (optimized, ~38KB, required=[presentation: name:16,popn_per_sqkm:22]) ├── G1: (project G2 G3 name) │ └── [presentation: name:16,popn_per_sqkm:22] │ ├── best: (project G2 G3 name) @@ -9969,21 +9969,21 @@ project │ ├── columns: a:26!null b:27!null c:28!null q:32!null r:33!null │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(26-28,32,33), (28)==(33), (33)==(28), (27)==(32), (32)==(27) + │ ├── fd: ()-->(26-28,32,33), (27)==(32), (32)==(27), (28)==(33), (33)==(28) │ └── inner-join (lookup zz) │ ├── columns: a:26!null b:27!null c:28!null p:31!null q:32!null r:33!null │ ├── key columns: [26] = [26] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(26-28,31-33), (32)==(27), (28)==(33), (33)==(28), (27)==(32) + │ ├── fd: ()-->(26-28,31-33), (27)==(32), (32)==(27), (28)==(33), (33)==(28) │ ├── inner-join (lookup zz@idx_c) │ │ ├── columns: a:26!null c:28!null p:31!null q:32 r:33!null │ │ ├── key columns: [33] = [28] │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(26,28,31-33), (33)==(28), (28)==(33) + │ │ ├── fd: ()-->(26,28,31-33), (28)==(33), (33)==(28) │ │ ├── scan pqr │ │ │ ├── columns: p:31!null q:32 r:33 │ │ │ ├── constraint: /31: [/0 - /0] @@ -10227,7 +10227,7 @@ SELECT 1 FROM (VALUES (1), (1)) JOIN (VALUES (1), (1), (1)) ON true UNION ALL SELECT 1 FROM (VALUES (1), (1), (1)) JOIN (VALUES (1), (1)) ON true ---- -memo (optimized, ~23KB, required=[presentation: ?column?:7]) +memo (optimized, ~24KB, required=[presentation: ?column?:7]) ├── G1: (union-all G2 G3) │ └── [presentation: ?column?:7] │ ├── best: (union-all G2 G3) @@ -11529,7 +11529,7 @@ project ├── cardinality: [0 - 1] ├── immutable ├── key: () - ├── fd: ()-->(1-4,7-11), (8)==(3), (3)==(8) + ├── fd: ()-->(1-4,7-11), (3)==(8), (8)==(3) ├── distribution: east ├── inner-join (lookup abc_part) │ ├── columns: def_part.r:1!null d:2!null e:3!null f:4 abc_part.r:7!null a:8!null b:9 c:10 @@ -11544,7 +11544,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-4,7-10), (8)==(3), (3)==(8) + │ ├── fd: ()-->(1-4,7-10), (3)==(8), (8)==(3) │ ├── distribution: east │ ├── locality-optimized-search │ │ ├── columns: def_part.r:1!null d:2!null e:3 f:4 @@ -11720,7 +11720,7 @@ project ├── cardinality: [0 - 1] ├── immutable ├── key: () - ├── fd: ()-->(1-4,7-11), (9)==(4), (4)==(9) + ├── fd: ()-->(1-4,7-11), (4)==(9), (9)==(4) ├── distribution: east ├── inner-join (lookup abc_part) │ ├── columns: def_part.r:1!null d:2!null e:3 f:4!null abc_part.r:7!null a:8!null b:9!null c:10 @@ -11728,7 +11728,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-4,7-10), (9)==(4), (4)==(9) + │ ├── fd: ()-->(1-4,7-10), (4)==(9), (9)==(4) │ ├── distribution: east │ ├── inner-join (lookup abc_part@b_idx) │ │ ├── columns: def_part.r:1!null d:2!null e:3 f:4!null abc_part.r:7!null a:8!null b:9!null @@ -11743,7 +11743,7 @@ project │ │ ├── lookup columns are key │ │ ├── cardinality: [0 - 1] │ │ ├── key: () - │ │ ├── fd: ()-->(1-4,7-9), (9)==(4), (4)==(9) + │ │ ├── fd: ()-->(1-4,7-9), (4)==(9), (9)==(4) │ │ ├── distribution: east │ │ ├── locality-optimized-search │ │ │ ├── columns: def_part.r:1!null d:2!null e:3 f:4 @@ -11781,7 +11781,7 @@ project ├── cardinality: [0 - 1] ├── immutable ├── key: () - ├── fd: ()-->(1-4,7-11), (8)==(3), (3)==(8) + ├── fd: ()-->(1-4,7-11), (3)==(8), (8)==(3) ├── distribution: east ├── inner-join (lookup abc_part) │ ├── columns: def_part.r:1!null d:2!null e:3!null f:4!null abc_part.r:7!null a:8!null b:9!null c:10 @@ -11796,7 +11796,7 @@ project │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-4,7-10), (8)==(3), (3)==(8) + │ ├── fd: ()-->(1-4,7-10), (3)==(8), (8)==(3) │ ├── distribution: east │ ├── locality-optimized-search │ │ ├── columns: def_part.r:1!null d:2!null e:3 f:4 @@ -12090,7 +12090,7 @@ inner-join (lookup abc_part) │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-4,7,8,11), (11)==(4), (4)==(11) + │ ├── fd: ()-->(1-4,7,8,11), (4)==(11), (11)==(4) │ ├── distribution: east │ ├── locality-optimized-search │ │ ├── columns: def_part.r:1!null d:2!null e:3 f:4 @@ -13427,7 +13427,7 @@ project ├── sort │ ├── columns: tab_17533.col1_3:3 tab_17533.col1_6:6 tab_17533.col1_7:7 tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16!null tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_2:32!null tab_17536.col1_3:33!null tab_17536.col1_6:36!null tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49!null tab_17538.col1_2:52!null tab_17538.crdb_internal_mvcc_timestamp:59!null │ ├── immutable - │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32), (44)==(14,24) + │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32) │ ├── ordering: +(14|24|44),-(23|33) [actual: +14,-23] │ └── left-join (lookup table11 [as=tab_17533]) │ ├── columns: tab_17533.col1_3:3 tab_17533.col1_6:6 tab_17533.col1_7:7 tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16!null tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_2:32!null tab_17536.col1_3:33!null tab_17536.col1_6:36!null tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49!null tab_17538.col1_2:52!null tab_17538.crdb_internal_mvcc_timestamp:59!null @@ -13435,22 +13435,22 @@ project │ ├── lookup columns are key │ ├── second join in paired joiner │ ├── immutable - │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32), (44)==(14,24) + │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32) │ ├── left-join (lookup table11@table1_col1_3_col1_1_expr_idx [as=tab_17533]) │ │ ├── columns: tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16!null tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_2:32!null tab_17536.col1_3:33!null tab_17536.col1_6:36!null tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49!null tab_17538.col1_2:52!null tab_17538.crdb_internal_mvcc_timestamp:59!null tab_17533.col1_3:65 tab_17533.rowid:70 continuation:73 │ │ ├── key columns: [43] = [65] │ │ ├── first join in paired joiner; continuation column: continuation:73 │ │ ├── immutable - │ │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32), (44)==(14,24), (70)-->(65,73) + │ │ ├── fd: (70)-->(65,73), (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32) │ │ ├── inner-join (hash) │ │ │ ├── columns: tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16!null tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_2:32!null tab_17536.col1_3:33!null tab_17536.col1_6:36!null tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49!null tab_17538.col1_2:52!null tab_17538.crdb_internal_mvcc_timestamp:59!null │ │ │ ├── immutable - │ │ │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32), (44)==(14,24) + │ │ │ ├── fd: (19)==(29), (29)==(19), (14)==(24,44), (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (16)==(36), (36)==(16), (49)==(59), (59)==(49), (32)==(52), (52)==(32) │ │ │ ├── inner-join (hash) │ │ │ │ ├── columns: tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16!null tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_2:32!null tab_17536.col1_3:33!null tab_17536.col1_6:36!null tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49 │ │ │ │ ├── multiplicity: left-rows(zero-or-more), right-rows(one-or-more) │ │ │ │ ├── immutable - │ │ │ │ ├── fd: (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (19)==(29), (29)==(19), (14)==(24,44), (16)==(36), (36)==(16) + │ │ │ │ ├── fd: (14)==(24,44), (24)==(14,44), (44)==(14,24), (21)==(31), (31)==(21), (23)==(33), (33)==(23), (19)==(29), (29)==(19), (16)==(36), (36)==(16) │ │ │ │ ├── scan table11 [as=tab_17537] │ │ │ │ │ └── columns: tab_17537.col1_3:43!null tab_17537.col1_4:44!null tab_17537.crdb_internal_mvcc_timestamp:49 │ │ │ │ ├── inner-join (lookup table11 [as=tab_17536]) @@ -13463,7 +13463,7 @@ project │ │ │ │ │ │ ├── columns: tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16 tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null tab_17536.col1_1:31!null tab_17536.col1_3:33!null tab_17536.rowid:38!null │ │ │ │ │ │ ├── key columns: [23 21] = [33 31] │ │ │ │ │ │ ├── immutable - │ │ │ │ │ │ ├── fd: (19)==(29), (29)==(19), (14)==(24), (24)==(14), (38)-->(31,33), (23)==(33), (33)==(23), (21)==(31), (31)==(21) + │ │ │ │ │ │ ├── fd: (38)-->(31,33), (19)==(29), (29)==(19), (14)==(24), (24)==(14), (23)==(33), (33)==(23), (21)==(31), (31)==(21) │ │ │ │ │ │ ├── inner-join (hash) │ │ │ │ │ │ │ ├── columns: tab_17534.col1_3:13!null tab_17534.col1_4:14!null tab_17534.col1_6:16 tab_17534.crdb_internal_mvcc_timestamp:19!null tab_17535.col1_1:21!null tab_17535.col1_3:23!null tab_17535.col1_4:24!null tab_17535.crdb_internal_mvcc_timestamp:29!null │ │ │ │ │ │ │ ├── immutable @@ -13545,7 +13545,7 @@ limit ├── columns: p_id:1!null id2:2 id3:3 c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,7,8), (8)==(1), (1)==(8) + ├── fd: ()-->(1-3,7,8), (1)==(8), (8)==(1) ├── distribution: east ├── project │ ├── columns: p_id:1!null id2:2 id3:3 c_id:7!null c_p_id:8!null @@ -13620,7 +13620,7 @@ limit ├── columns: p_id:1!null id2:2!null id3:3 c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,7,8), (8)==(2), (2)==(8) + ├── fd: ()-->(1-3,7,8), (2)==(8), (8)==(2) ├── distribution: east ├── project │ ├── columns: p_id:1!null id2:2!null id3:3 c_id:7!null c_p_id:8!null @@ -13696,7 +13696,7 @@ limit ├── columns: p_id:1!null id2:2!null id3:3 c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,7,8), (8)==(2), (2)==(8) + ├── fd: ()-->(1-3,7,8), (2)==(8), (8)==(2) ├── distribution: east ├── inner-join (lookup parent [as=p]) │ ├── columns: p_id:1!null id2:2!null id3:3 c_id:7!null c_p_id:8!null @@ -13775,14 +13775,14 @@ distribute ├── columns: p_id:1!null id2:2 id3:3!null c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,7,8), (8)==(3), (3)==(8) + ├── fd: ()-->(1-3,7,8), (3)==(8), (8)==(3) ├── distribution: east ├── input distribution: central,east,west └── limit ├── columns: p_id:1!null id2:2 id3:3!null c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,7,8), (8)==(3), (3)==(8) + ├── fd: ()-->(1-3,7,8), (3)==(8), (8)==(3) ├── inner-join (hash) │ ├── columns: p_id:1!null id2:2 id3:3!null c_id:7!null c_p_id:8!null │ ├── key: (1,7) @@ -14005,7 +14005,7 @@ project ├── columns: p_id:1!null id2:2!null id3:3 p.crdb_region:4!null c_id:7!null c_p_id:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-4,7,8), (8)==(2), (2)==(8) + ├── fd: ()-->(1-4,7,8), (2)==(8), (8)==(2) ├── distribution: east ├── project │ ├── columns: p_id:1!null id2:2!null id3:3 p.crdb_region:4!null c_id:7!null c_p_id:8!null @@ -14043,7 +14043,7 @@ limit ├── columns: p_id:1!null id2:2!null id3:3 c_id:6!null c_p_id:7!null v:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,6-8), (7)==(2), (2)==(7) + ├── fd: ()-->(1-3,6-8), (2)==(7), (7)==(2) ├── distribution: east ├── inner-join (lookup parent2 [as=p]) │ ├── columns: p_id:1!null id2:2!null id3:3 c_id:6!null c_p_id:7!null v:8!null @@ -14112,7 +14112,7 @@ limit ├── columns: p_id:1!null id2:2 id3:3!null c_id:6!null c_p_id:7!null v:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,6-8), (7)==(3), (3)==(7) + ├── fd: ()-->(1-3,6-8), (3)==(7), (7)==(3) ├── distribution: east ├── inner-join (lookup parent2 [as=p]) │ ├── columns: p_id:1!null id2:2 id3:3!null c_id:6!null c_p_id:7!null v:8!null @@ -14339,7 +14339,7 @@ distribute ├── cardinality: [0 - 1] ├── immutable ├── key: () - ├── fd: ()-->(1-3,6-8,12), (12)==(3), (3)==(12) + ├── fd: ()-->(1-3,6-8,12), (3)==(12), (12)==(3) ├── inner-join (hash) │ ├── columns: p_id:1!null id2:2 id3:3!null c_id:6!null c_p_id:7 v:8!null column12:12!null │ ├── immutable @@ -14522,7 +14522,7 @@ limit ├── columns: p_id:1!null id2:2!null id3:3 c_id:6!null c_p_id:7!null v:8!null ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-3,6-8), (7)==(2), (2)==(7) + ├── fd: ()-->(1-3,6-8), (2)==(7), (7)==(2) ├── distribution: east ├── inner-join (lookup parent2 [as=p]) │ ├── columns: p_id:1!null id2:2!null id3:3 c_id:6!null c_p_id:7!null v:8!null diff --git a/pkg/sql/opt/xform/testdata/rules/join_order b/pkg/sql/opt/xform/testdata/rules/join_order index 7c36dafebc42..98ee56fa0fcd 100644 --- a/pkg/sql/opt/xform/testdata/rules/join_order +++ b/pkg/sql/opt/xform/testdata/rules/join_order @@ -37,14 +37,14 @@ inner-join (lookup cy) ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1-4,7,8,11,12), (2)==(7), (3)==(11), (11)==(3), (7)==(2) + ├── fd: ()-->(1-4,7,8,11,12), (2)==(7), (7)==(2), (3)==(11), (11)==(3) ├── inner-join (lookup bx) │ ├── columns: a:1!null abc.b:2!null abc.c:3 d:4 bx.b:7!null x:8 │ ├── key columns: [2] = [7] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(1-4,7,8), (7)==(2), (2)==(7) + │ ├── fd: ()-->(1-4,7,8), (2)==(7), (7)==(2) │ ├── scan abc │ │ ├── columns: a:1!null abc.b:2 abc.c:3 d:4 │ │ ├── constraint: /1: [/1 - /1] @@ -63,14 +63,14 @@ inner-join (lookup bx) ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,2,5-8,11,12), (7)==(11), (1)==(6), (6)==(1), (11)==(7) + ├── fd: ()-->(1,2,5-8,11,12), (7)==(11), (11)==(7), (1)==(6), (6)==(1) ├── inner-join (lookup cy) │ ├── columns: a:5!null abc.b:6 abc.c:7!null d:8 cy.c:11!null y:12 │ ├── key columns: [7] = [11] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(5-8,11,12), (11)==(7), (7)==(11) + │ ├── fd: ()-->(5-8,11,12), (7)==(11), (11)==(7) │ ├── scan abc │ │ ├── columns: a:5!null abc.b:6 abc.c:7 d:8 │ │ ├── constraint: /5: [/1 - /1] @@ -89,14 +89,14 @@ inner-join (lookup bx) ├── lookup columns are key ├── cardinality: [0 - 1] ├── key: () - ├── fd: ()-->(1,2,5,6,9-12), (5)==(11), (1)==(10), (10)==(1), (11)==(5) + ├── fd: ()-->(1,2,5,6,9-12), (5)==(11), (11)==(5), (1)==(10), (10)==(1) ├── inner-join (lookup cy) │ ├── columns: cy.c:5!null y:6 a:9!null abc.b:10 abc.c:11!null d:12 │ ├── key columns: [11] = [5] │ ├── lookup columns are key │ ├── cardinality: [0 - 1] │ ├── key: () - │ ├── fd: ()-->(5,6,9-12), (11)==(5), (5)==(11) + │ ├── fd: ()-->(5,6,9-12), (5)==(11), (11)==(5) │ ├── scan abc │ │ ├── columns: a:9!null abc.b:10 abc.c:11 d:12 │ │ ├── constraint: /9: [/1 - /1] @@ -312,7 +312,7 @@ New expression 3 of 3: memo set=reorder_joins_limit=0 expect-not=ReorderJoins SELECT * FROM bx, cy, abc WHERE a = 1 AND abc.b = bx.b AND abc.c = cy.c ---- -memo (optimized, ~24KB, required=[presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12]) +memo (optimized, ~25KB, required=[presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12]) ├── G1: (inner-join G2 G3 G4) (merge-join G2 G3 G5 inner-join,+1,+10) │ └── [presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12] │ ├── best: (merge-join G2="[ordering: +1]" G3 G5 inner-join,+1,+10) @@ -360,7 +360,7 @@ memo (optimized, ~24KB, required=[presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d: memo set=reorder_joins_limit=2 SELECT * FROM bx, cy, abc WHERE a = 1 AND abc.b = bx.b AND abc.c = cy.c ---- -memo (optimized, ~35KB, required=[presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12]) +memo (optimized, ~36KB, required=[presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) (inner-join G5 G6 G7) (inner-join G6 G5 G7) (merge-join G2 G3 G8 inner-join,+1,+10) (merge-join G3 G2 G8 inner-join,+10,+1) (lookup-join G3 G8 bx,keyCols=[10],outCols=(1,2,5,6,9-12)) (merge-join G5 G6 G8 inner-join,+5,+11) (merge-join G6 G5 G8 inner-join,+11,+5) (lookup-join G6 G8 cy,keyCols=[11],outCols=(1,2,5,6,9-12)) │ └── [presentation: b:1,x:2,c:5,y:6,a:9,b:10,c:11,d:12] │ ├── best: (lookup-join G3 G8 bx,keyCols=[10],outCols=(1,2,5,6,9-12)) @@ -521,7 +521,7 @@ inner-join (cross) memo set=reorder_joins_limit=0 SELECT * FROM bx, cy, dz, abc WHERE x = y AND y = z AND z = a ---- -memo (optimized, ~31KB, required=[presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16]) +memo (optimized, ~32KB, required=[presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16]) ├── G1: (inner-join G2 G3 G4) (merge-join G2 G3 G5 inner-join,+2,+6) │ └── [presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16] │ ├── best: (inner-join G2 G3 G4) @@ -587,7 +587,7 @@ memo (optimized, ~31KB, required=[presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b: memo set=reorder_joins_limit=3 SELECT * FROM bx, cy, dz, abc WHERE x = y AND y = z AND z = a ---- -memo (optimized, ~67KB, required=[presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16]) +memo (optimized, ~68KB, required=[presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16]) ├── G1: (inner-join G2 G3 G4) (inner-join G3 G2 G4) (inner-join G5 G6 G7) (inner-join G6 G5 G7) (inner-join G8 G9 G7) (inner-join G9 G8 G7) (inner-join G10 G11 G12) (inner-join G11 G10 G12) (inner-join G13 G14 G12) (inner-join G14 G13 G12) (inner-join G15 G16 G12) (inner-join G16 G15 G12) (inner-join G17 G18 G12) (inner-join G18 G17 G12) (merge-join G3 G2 G19 inner-join,+6,+2) (merge-join G6 G5 G19 inner-join,+10,+6) (merge-join G9 G8 G19 inner-join,+10,+6) (merge-join G11 G10 G19 inner-join,+13,+10) (merge-join G14 G13 G19 inner-join,+13,+10) (merge-join G16 G15 G19 inner-join,+13,+10) (lookup-join G17 G19 abc,keyCols=[10],outCols=(1,2,5,6,9,10,13-16)) (merge-join G18 G17 G19 inner-join,+13,+10) │ └── [presentation: b:1,x:2,c:5,y:6,d:9,z:10,a:13,b:14,c:15,d:16] │ ├── best: (inner-join G3 G2 G4) @@ -714,11 +714,11 @@ SELECT * FROM bx, cy, dz, abc WHERE x = y AND y = z AND z = a inner-join (hash) ├── columns: b:1!null x:2!null c:5!null y:6!null d:9!null z:10!null a:13!null b:14 c:15 d:16 ├── key: (1,5,9) - ├── fd: (1)-->(2), (5)-->(6), (9)-->(10), (13)-->(14-16), (10)==(2,6,13), (13)==(2,6,10), (6)==(2,10,13), (2)==(6,10,13) + ├── fd: (1)-->(2), (5)-->(6), (9)-->(10), (13)-->(14-16), (2)==(6,10,13), (6)==(2,10,13), (10)==(2,6,13), (13)==(2,6,10) ├── inner-join (hash) │ ├── columns: cy.c:5!null y:6!null dz.d:9!null z:10!null a:13!null abc.b:14 abc.c:15 abc.d:16 │ ├── key: (5,9) - │ ├── fd: (5)-->(6), (9)-->(10), (13)-->(14-16), (10)==(6,13), (13)==(6,10), (6)==(10,13) + │ ├── fd: (5)-->(6), (9)-->(10), (13)-->(14-16), (6)==(10,13), (10)==(6,13), (13)==(6,10) │ ├── scan cy │ │ ├── columns: cy.c:5!null y:6 │ │ ├── key: (5) @@ -2389,7 +2389,7 @@ Final Plan inner-join (hash) ├── columns: a:1!null b:2 c:3 d:4 b:7!null x:8!null d:16!null z:17!null ├── key: (7,16) - ├── fd: (1)-->(2-4), (7)-->(8), (1)==(8,17), (8)==(1,17), (16)-->(17), (17)==(1,8) + ├── fd: (1)-->(2-4), (7)-->(8), (16)-->(17), (1)==(8,17), (8)==(1,17), (17)==(1,8) ├── scan dz │ ├── columns: dz.d:16!null z:17 │ ├── key: (16) @@ -2700,7 +2700,7 @@ project ├── columns: t1.a:1!null t1.b:2!null t2.a:5!null t2.c:6!null t2.should_not_be_eliminated:7!null t3.a:10!null d:11!null e:16!null t4.f:17!null t4.g:18!null t5.f:22!null t5.g:23!null t5.b:24!null t5.should_not_be_eliminated:25!null t5.c:26!null ├── key columns: [5 24] = [1 2] ├── lookup columns are key - ├── fd: ()-->(1,5-7,10,25,26), (1)==(5,10), (5)==(1,10), (10)==(1,5), (16)-->(17,18), (11)==(16), (16)==(11), (17)==(22), (22)==(17), (18)==(23), (23)==(18), (2)==(24), (24)==(2), (6)==(26), (26)==(6), (7)==(25), (25)==(7) + ├── fd: ()-->(1,5-7,10,25,26), (16)-->(17,18), (1)==(5,10), (5)==(1,10), (10)==(1,5), (11)==(16), (16)==(11), (17)==(22), (22)==(17), (18)==(23), (23)==(18), (2)==(24), (24)==(2), (6)==(26), (26)==(6), (7)==(25), (25)==(7) ├── inner-join (lookup t76522_2 [as=t2]) │ ├── columns: t2.a:5!null t2.c:6!null t2.should_not_be_eliminated:7!null t3.a:10!null d:11!null e:16!null t4.f:17!null t4.g:18!null t5.f:22!null t5.g:23!null t5.b:24 t5.should_not_be_eliminated:25!null t5.c:26!null │ ├── key columns: [10] = [5] @@ -2774,7 +2774,7 @@ SELECT ( ) FROM table80901_1 AS tab_42921; ---- -memo (optimized, ~71KB, required=[presentation: ?column?:50]) +memo (optimized, ~73KB, required=[presentation: ?column?:50]) ├── G1: (project G2 G3) │ └── [presentation: ?column?:50] │ ├── best: (project G2 G3) @@ -2951,26 +2951,26 @@ inner-join (lookup t88659) ├── lookup columns are key ├── immutable ├── key: (1) - ├── fd: (1)-->(2,3), (7)-->(9), (7)==(2,8,13,14,19,20), (8)==(2,7,13,14,19,20), (2)==(7,8,13,14,19,20), (13)-->(15), (3)==(9,15,21), (9)==(3,15,21), (15)==(3,9,21), (19)-->(21), (13)==(2,7,8,14,19,20), (20)==(2,7,8,13,14,19), (19)==(2,7,8,13,14,20), (21)==(3,9,15), (14)==(2,7,8,13,19,20) + ├── fd: (1)-->(2,3), (7)-->(9), (13)-->(15), (19)-->(21), (2)==(7,8,13,14,19,20), (7)==(2,8,13,14,19,20), (8)==(2,7,13,14,19,20), (13)==(2,7,8,14,19,20), (14)==(2,7,8,13,19,20), (19)==(2,7,8,13,14,20), (20)==(2,7,8,13,14,19), (3)==(9,15,21), (9)==(3,15,21), (15)==(3,9,21), (21)==(3,9,15) ├── inner-join (lookup t88659) │ ├── columns: a:1!null b:2!null c:3!null a:7!null b:8!null c:9!null a:13!null b:14!null c:15!null │ ├── key columns: [2] = [13] │ ├── lookup columns are key │ ├── immutable │ ├── key: (1) - │ ├── fd: (1)-->(2,3), (7)-->(9), (7)==(2,8,13,14), (8)==(2,7,13,14), (13)-->(15), (9)==(3,15), (15)==(3,9), (13)==(2,7,8,14), (14)==(2,7,8,13), (2)==(7,8,13,14), (3)==(9,15) + │ ├── fd: (1)-->(2,3), (7)-->(9), (13)-->(15), (2)==(7,8,13,14), (7)==(2,8,13,14), (8)==(2,7,13,14), (13)==(2,7,8,14), (14)==(2,7,8,13), (3)==(9,15), (9)==(3,15), (15)==(3,9) │ ├── inner-join (lookup t88659) │ │ ├── columns: a:1!null b:2!null c:3!null a:7!null b:8!null c:9!null │ │ ├── key columns: [1] = [1] │ │ ├── lookup columns are key │ │ ├── immutable │ │ ├── key: (1) - │ │ ├── fd: (1)-->(2,3), (7)-->(9), (7)==(2,8), (8)==(2,7), (2)==(7,8), (3)==(9), (9)==(3) + │ │ ├── fd: (1)-->(2,3), (7)-->(9), (2)==(7,8), (7)==(2,8), (8)==(2,7), (3)==(9), (9)==(3) │ │ ├── inner-join (lookup t88659@idx) │ │ │ ├── columns: a:1!null b:2!null a:7!null b:8!null c:9 │ │ │ ├── key columns: [7] = [2] │ │ │ ├── key: (1) - │ │ │ ├── fd: (7)-->(9), (7)==(2,8), (8)==(2,7), (1)-->(2), (2)==(7,8) + │ │ │ ├── fd: (7)-->(9), (1)-->(2), (2)==(7,8), (7)==(2,8), (8)==(2,7) │ │ │ ├── select │ │ │ │ ├── columns: a:7!null b:8!null c:9 │ │ │ │ ├── key: (7) @@ -3428,7 +3428,7 @@ inner-join (hash) ├── cardinality: [0 - 1] ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) ├── key: () - ├── fd: ()-->(1,2,6,7), (6)==(1), (1)==(6) + ├── fd: ()-->(1,2,6,7), (1)==(6), (6)==(1) ├── distinct-on │ ├── columns: x:6!null y:7!null │ ├── grouping columns: x:6!null diff --git a/pkg/sql/opt/xform/testdata/rules/limit b/pkg/sql/opt/xform/testdata/rules/limit index a4ac8b7f59c7..fdc2bcff0152 100644 --- a/pkg/sql/opt/xform/testdata/rules/limit +++ b/pkg/sql/opt/xform/testdata/rules/limit @@ -2325,7 +2325,7 @@ memo (optimized, ~5KB, required=[presentation: d:1,f:3,e:2] [ordering: +1,+3,+2] memo expect=GeneratePartialOrderTopK SELECT * FROM defg ORDER BY d, f, e LIMIT 10 ---- -memo (optimized, ~15KB, required=[presentation: d:1,e:2,f:3,g:4] [ordering: +1,+3,+2]) +memo (optimized, ~16KB, required=[presentation: d:1,e:2,f:3,g:4] [ordering: +1,+3,+2]) ├── G1: (limit G2 G3 ordering=+1,+3,+2) (top-k G2 &{10 +1,+3,+2 }) (top-k G4 &{10 +1,+3,+2 }) (top-k G5 &{10 +1,+3,+2 }) (top-k G6 &{10 +1,+3,+2 }) (top-k G2 &{10 +1,+3,+2 +1,+3}) (top-k G4 &{10 +1,+3,+2 +1}) (top-k G5 &{10 +1,+3,+2 +1,+3}) (top-k G6 &{10 +1,+3,+2 +1,+3}) (top-k G4 &{10 +1,+3,+2 +1,+3}) │ ├── [presentation: d:1,e:2,f:3,g:4] [ordering: +1,+3,+2] │ │ ├── best: (top-k G6="[ordering: +1,+3] [limit hint: 100.00]" &{10 +1,+3,+2 +1,+3}) diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index 80861aa2d3be..f796aca2ee4f 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -329,7 +329,7 @@ memo (optimized, ~19KB, required=[presentation: k:1,i:2,f:3,s:4,b:5]) memo expect-not=GeneratePartialIndexScans SELECT * FROM p@{NO_INDEX_JOIN} WHERE i > 0 AND s = 'foo' ---- -memo (optimized, ~9KB, required=[presentation: k:1,i:2,f:3,s:4,b:5]) +memo (optimized, ~10KB, required=[presentation: k:1,i:2,f:3,s:4,b:5]) ├── G1: (select G2 G3) │ └── [presentation: k:1,i:2,f:3,s:4,b:5] │ ├── best: (select G2 G3) @@ -574,7 +574,7 @@ scan a memo SELECT k FROM a WHERE k = 1 ---- -memo (optimized, ~6KB, required=[presentation: k:1]) +memo (optimized, ~7KB, required=[presentation: k:1]) ├── G1: (select G2 G3) (scan a,cols=(1),constrained) │ └── [presentation: k:1] │ ├── best: (scan a,cols=(1),constrained) @@ -686,7 +686,7 @@ project memo SELECT k FROM a WHERE u = 1 AND k+u = 1 ---- -memo (optimized, ~10KB, required=[presentation: k:1]) +memo (optimized, ~11KB, required=[presentation: k:1]) ├── G1: (project G2 G3 k) │ └── [presentation: k:1] │ ├── best: (project G2 G3 k) @@ -738,7 +738,7 @@ project memo SELECT k FROM a WHERE u = 1 AND v = 5 ---- -memo (optimized, ~11KB, required=[presentation: k:1]) +memo (optimized, ~12KB, required=[presentation: k:1]) ├── G1: (project G2 G3 k) │ └── [presentation: k:1] │ ├── best: (project G2 G3 k) @@ -830,7 +830,7 @@ index-join b memo SELECT * FROM b WHERE v >= 1 AND v <= 10 ---- -memo (optimized, ~7KB, required=[presentation: k:1,u:2,v:3,j:4]) +memo (optimized, ~8KB, required=[presentation: k:1,u:2,v:3,j:4]) ├── G1: (select G2 G3) (index-join G4 b,cols=(1-4)) │ └── [presentation: k:1,u:2,v:3,j:4] │ ├── best: (index-join G4 b,cols=(1-4)) @@ -1318,7 +1318,7 @@ memo (optimized, ~8KB, required=[presentation: s:4,i:2,f:3] [ordering: +2 opt(4) memo SELECT j FROM kifs WHERE s = 'foo' ---- -memo (optimized, ~9KB, required=[presentation: j:5]) +memo (optimized, ~10KB, required=[presentation: j:5]) ├── G1: (project G2 G3 j) │ └── [presentation: j:5] │ ├── best: (project G2 G3 j) @@ -1344,7 +1344,7 @@ memo (optimized, ~9KB, required=[presentation: j:5]) memo SELECT i, k FROM kifs WHERE s >= 'foo' ---- -memo (optimized, ~8KB, required=[presentation: i:2,k:1]) +memo (optimized, ~9KB, required=[presentation: i:2,k:1]) ├── G1: (project G2 G3 k i) │ └── [presentation: i:2,k:1] │ ├── best: (project G2 G3 k i) @@ -1753,7 +1753,7 @@ CREATE INDEX idx2 ON p (i) WHERE s = 'foo' memo SELECT i FROM p WHERE i = 3 AND s = 'foo' ---- -memo (optimized, ~23KB, required=[presentation: i:2]) +memo (optimized, ~24KB, required=[presentation: i:2]) ├── G1: (project G2 G3 i) │ └── [presentation: i:2] │ ├── best: (project G2 G3 i) @@ -6779,7 +6779,7 @@ CREATE INVERTED INDEX idx2 ON pi (j) WHERE s = 'bar' memo expect=GenerateInvertedIndexScans SELECT * FROM pi WHERE j @> '{"a": "b"}' AND s = 'bar' ---- -memo (optimized, ~14KB, required=[presentation: k:1,s:2,j:3]) +memo (optimized, ~15KB, required=[presentation: k:1,s:2,j:3]) ├── G1: (select G2 G3) (select G4 G5) (index-join G6 pi,cols=(1-3)) │ └── [presentation: k:1,s:2,j:3] │ ├── best: (index-join G6 pi,cols=(1-3)) @@ -6827,7 +6827,7 @@ CREATE INVERTED INDEX idx ON pi (j) WHERE s IN ('foo', 'bar') memo expect-not=GenerateInvertedIndexScans SELECT * FROM pi WHERE j @> '{"a": "b"}' AND s = 'baz' ---- -memo (optimized, ~8KB, required=[presentation: k:1,s:2,j:3]) +memo (optimized, ~9KB, required=[presentation: k:1,s:2,j:3]) ├── G1: (select G2 G3) │ └── [presentation: k:1,s:2,j:3] │ ├── best: (select G2 G3) @@ -9029,7 +9029,7 @@ inner-join (zigzag pqr@q pqr@r) memo expect=GenerateZigzagJoins SELECT q,r FROM pqr WHERE q = 1 AND r = 2 ---- -memo (optimized, ~17KB, required=[presentation: q:2,r:3]) +memo (optimized, ~18KB, required=[presentation: q:2,r:3]) ├── G1: (select G2 G3) (select G4 G5) (select G6 G7) (select G8 G7) (zigzag-join G3 pqr@q pqr@r) │ └── [presentation: q:2,r:3] │ ├── best: (zigzag-join G3 pqr@q pqr@r) @@ -9110,7 +9110,7 @@ inner-join (lookup pqr) memo expect=GenerateZigzagJoins SELECT q,r,s FROM pqr WHERE q = 1 AND r = 2 ---- -memo (optimized, ~20KB, required=[presentation: q:2,r:3,s:4]) +memo (optimized, ~21KB, required=[presentation: q:2,r:3,s:4]) ├── G1: (select G2 G3) (select G4 G5) (select G6 G7) (select G8 G7) (lookup-join G9 G10 pqr,keyCols=[1],outCols=(2-4)) │ └── [presentation: q:2,r:3,s:4] │ ├── best: (lookup-join G9 G10 pqr,keyCols=[1],outCols=(2-4)) @@ -9175,7 +9175,7 @@ inner-join (zigzag pqr@q pqr@s) memo expect=GenerateZigzagJoins SELECT q,s FROM pqr WHERE q = 1 AND s = 'foo' ---- -memo (optimized, ~14KB, required=[presentation: q:2,s:4]) +memo (optimized, ~15KB, required=[presentation: q:2,s:4]) ├── G1: (select G2 G3) (select G4 G5) (select G6 G7) (zigzag-join G3 pqr@q pqr@s) │ └── [presentation: q:2,s:4] │ ├── best: (zigzag-join G3 pqr@q pqr@s) @@ -9707,7 +9707,7 @@ select memo SELECT p,q,r,s FROM pqr WHERE q = 1 AND r = 1 AND s = 'foo' ---- -memo (optimized, ~41KB, required=[presentation: p:1,q:2,r:3,s:4]) +memo (optimized, ~42KB, required=[presentation: p:1,q:2,r:3,s:4]) ├── G1: (select G2 G3) (select G4 G5) (select G6 G7) (select G8 G9) (select G10 G9) (lookup-join G11 G12 pqr,keyCols=[1],outCols=(1-4)) (zigzag-join G3 pqr@q pqr@s) (zigzag-join G3 pqr@q pqr@rs) (lookup-join G13 G9 pqr,keyCols=[1],outCols=(1-4)) │ └── [presentation: p:1,q:2,r:3,s:4] │ ├── best: (zigzag-join G3 pqr@q pqr@s) @@ -9838,7 +9838,7 @@ memo (optimized, ~12KB, required=[presentation: q:2,t:5]) memo SELECT c FROM zz_redundant WHERE b = 1 ---- -memo (optimized, ~8KB, required=[presentation: c:3]) +memo (optimized, ~9KB, required=[presentation: c:3]) ├── G1: (project G2 G3 c) │ └── [presentation: c:3] │ ├── best: (project G2 G3 c) @@ -11776,7 +11776,7 @@ CREATE TABLE t58390 ( memo SELECT * FROM t58390 WHERE a > 1 OR b > 1 ---- -memo (optimized, ~24KB, required=[presentation: k:1,a:2,b:3,c:4]) +memo (optimized, ~25KB, required=[presentation: k:1,a:2,b:3,c:4]) ├── G1: (select G2 G3) (index-join G4 t58390,cols=(1-4)) (distinct-on G5 G6 cols=(1)) (distinct-on G5 G6 cols=(1),ordering=+1) │ └── [presentation: k:1,a:2,b:3,c:4] │ ├── best: (select G2 G3) @@ -11891,7 +11891,7 @@ JOIN t61795 AS t2 ON t1.c = t1.b AND t1.b = t2.b WHERE t1.a = 10 OR t2.b != abs(t2.b) ORDER BY t1.b ASC ---- -memo (optimized, ~36KB, required=[presentation: a:1] [ordering: +2]) +memo (optimized, ~37KB, required=[presentation: a:1] [ordering: +2]) ├── G1: (project G2 G3 a b) │ ├── [presentation: a:1] [ordering: +2] │ │ ├── best: (sort G1) diff --git a/pkg/sql/opt/xform/testdata/rules/select_for_update b/pkg/sql/opt/xform/testdata/rules/select_for_update index 3343bb977797..9eff585feabb 100644 --- a/pkg/sql/opt/xform/testdata/rules/select_for_update +++ b/pkg/sql/opt/xform/testdata/rules/select_for_update @@ -74,7 +74,7 @@ project ├── cardinality: [0 - 1] ├── volatile ├── key: () - ├── fd: ()-->(1,2,5,6), (5)==(2), (2)==(5) + ├── fd: ()-->(1,2,5,6), (2)==(5), (5)==(2) ├── scan t │ ├── columns: t.a:1!null b:2 │ ├── constraint: /1: [/2 - /2]