Skip to content

Commit

Permalink
opt: improve FDs for Intersect and Except variants
Browse files Browse the repository at this point in the history
We can pass through FDs from the left side on Intersect/IntersectAll,
and we can pass through FDs from both sides on Except/ExceptAll.

Release note: None
  • Loading branch information
RaduBerinde committed Jun 14, 2021
1 parent 9c583b9 commit 491690a
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 57 deletions.
5 changes: 5 additions & 0 deletions pkg/sql/opt/exec/execbuilder/testdata/fk
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ vectorized: true
│ │
│ └── • hash join
│ │ equality: (p) = (p)
│ │ left cols are key
│ │ right cols are key
│ │
│ ├── • except all
Expand All @@ -512,6 +513,7 @@ vectorized: true
└── • hash join
│ equality: (p) = (p)
│ left cols are key
│ right cols are key
├── • except all
Expand Down Expand Up @@ -618,6 +620,7 @@ vectorized: true
└── • hash join
│ equality: (c) = (c)
│ left cols are key
│ right cols are key
├── • except all
Expand Down Expand Up @@ -758,6 +761,7 @@ vectorized: true
└── • hash join
│ equality: (c) = (c)
│ left cols are key
│ right cols are key
├── • except all
Expand Down Expand Up @@ -890,6 +894,7 @@ vectorized: true
└── • hash join
│ equality: (x) = (y)
│ left cols are key
│ right cols are key
├── • except all
Expand Down
12 changes: 6 additions & 6 deletions pkg/sql/opt/exec/execbuilder/testdata/union
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ vectorized: true
·
• intersect
│ columns: (b, c, d, e)
│ ordering: +b,+c,+d,+e
│ ordering: +b,+d,+c,+e
│ estimated row count: 1 (missing stats)
├── • filter
Expand Down Expand Up @@ -624,7 +624,7 @@ vectorized: true
table: abcde@abcde_b_c_d_e_idx
spans: FULL SCAN
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF-L2kAUxd_7KS73KcEpbv7olgFhdmuWBlyzTUL_UERi5tYG0iSdjLBF_O4lSdtVu6Z12b4Ic2Z-95x7kGyx_pYjR-_D3ezKn4Mx9aM4ejtj8M4Lr4PIMyHyZt7rGFYMUgaSAcFNGNyCcUJPVqkk8OexF0bNfd8zE96_8UIPjBQmYJlwNZ-CIWECZEIQTr0Qrj_CChkWpaR58pVq5J_QwgXDSpUp1XWpGmnbPvDlPfILhllRbXQjLximpSLkW9SZzgk5xskqp5ASSWp4gQwl6STL27FtItH-LlfLdCmXtMzkPTKMqqSoObxEhsFGcxA2Ew4TLhMjXOwYlhv94FjrZE3IrR3791Q3Wa5JkRpah5E6nYMh7KYgzrk_j1_97Ek4MAHhmicj2OdE2C_G_p_FOE8qxnnOYtxzIkyzWmdFqofuYQRhsV_rNusrSYokh0Z2TjqPnuQ8egbn8UnnB8NNUXbDDvwWDfm3J4_EvyW1poh0UA3HhwvE3yvie5-Iq9kMGeb0WRvCGjBhD5hwBky4A3OisvWXP-Xff7i9Kk5tfnlO5yHVVVnUdNzAo5MvmrVJrqmrsS43KqU7VaatTXcMWq4VJNW6u7W6g190V03AfdjqhUf9sN0LO_2w0wu7_bDbC48PYOsYHp0B28fwuBe-PIq92L34EQAA___K-yzi
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF-L2kAUxd_7KS73KcEpbv7olgFhdmuWBlyzTUL_UERi5tYG0iSdjLBF_O4lSdtVu6Z12b4Ic2Z-95x7kGyx_pYjR-_D3ezKn4Mx9aM4ejtj8M4Lr4PIMyHyZt7rGFYMUgaSAcFNGNyCcUJPVqkk8OexF0bNfd8zE96_8UIPjBQmYJlwNZ-CIWECZEIQTr0Qrj_CChkWpaR58pVq5J_QwgXDSpUp1XWpGmnbPvDlPfILhllRbXQjLximpSLkW9SZzgk5xskqp5ASSWp4gQwl6STL27FtItH-LlfLdCmXtMzkPTKMqqSoObxEhsFGcxA2Ew4TLhMjXOwYlhv94FjrZE3IrR3791Q3Wa5JkRpah5E6nYMh7KYgzrk_j1_97Ek4MAHhmicj2OdE2C_G_p_FOE8qxnnOYtxzIkyzWmdFqofuYQRhsV_rNusrSYokh0Z2TjqPnuQ8egbn8UnnB8NNUXbDDvwWDfm3J4_EvyW1poh0UA3HhwvE3yvie5-Iq9kMGeb0WRvCGjDhDJiwB0y4A3OisvWXP-Xff7i9Kk5tfnlO5yHVVVnUdNzAo5MvmrVJrqmrsS43KqU7VaatTXcMWq4VJNW6u7W6g190V03AfdjqhUf9sN0LO_2w0wu7_bDbC48PYOsYHp0B28fwuBe-PIq92L34EQAA___LAyzi

query T
EXPLAIN (DISTSQL,VERBOSE) SELECT b, c, d, e FROM (SELECT b, c, d, e FROM abcde EXCEPT SELECT b, c, d, e FROM abcde) WHERE c = 1 AND d = e ORDER BY b, c, d, e
Expand All @@ -634,7 +634,7 @@ vectorized: true
·
• except
│ columns: (b, c, d, e)
│ ordering: +b,+c,+d,+e
│ ordering: +b,+d,+c,+e
│ estimated row count: 1 (missing stats)
├── • filter
Expand Down Expand Up @@ -663,7 +663,7 @@ vectorized: true
table: abcde@abcde_b_c_d_e_idx
spans: FULL SCAN
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lN9q20wQxe-_pxjmSsL74eiPnbJg2CRWqMGxUkm0KcUYWTt1BaqkrtaQEvzuRVLT2G6k1iG9MezZ_c05czB6wOpbhhy9u9v5xWwBxnQWRuG7OYP3XnDph54JoTf3riJYM0gYSAYE14F_A0aHHq8TSeDdXXm3URfbvDHhw1sv8MBIYAKWCReLKRgSJkAm-MHUC-Dy4x6JDPNC0iL-ShXyT2jhkmGpioSqqlC19NA8mMl75GcM07zc6lpeMkwKRcgfUKc6I-QYxeuMAoolqeEZMpSk4zRrxjbRRPO7Wq-SlVzRKpX3yDAs47zi8D8y9Leag7CZcJhwmRjhcsew2Oonx0rHG0Ju7djfp7pOM02K1NA6jNTqHAxh101xzmeL6M3PwoQDExCu2RnBPiXCfjH2vyzGeVExzmsW454SYZpWOs0TPXQPIwiLPa5br68kKZIcatnpdB69yHn0Cs7jTucnw21etMMO_JY1-acnz8S_IbWhkLRfDseHC0TfS-KPH4qL-RwZZvRZG8IaMGEPmHAGTLgDc6LSzZff5V__tr0eutY-P6XwgKqyyCs6Xv_ZyWf1ziQ31HZYFVuV0K0qksamPfoN1wiSKt3eWu1hlrdXdcB92OqF3X7Y7oWdftjphUf9sNsLjw9g6xgenQDbx_C4Fz4_ir3c_fcjAAD__7UbLSI=
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lN9q20wQxe-_pxjmSsL74eiPnbJg2CRWqMGxUkm0KcUYWTt1BaqkrtaQEvzuRVLT2G6k1iG9MezZ_c05czB6wOpbhhy9u9v5xWwBxnQWRuG7OYP3XnDph54JoTf3riJYM0gYSAYE14F_A0aHHq8TSeDdXXm3URfbvDHhw1sv8MBIYAKWCReLKRgSJkAm-MHUC-Dy4x6JDPNC0iL-ShXyT2jhkmGpioSqqlC19NA8mMl75GcM07zc6lpeMkwKRcgfUKc6I-QYxeuMAoolqeEZMpSk4zRrxjbRRPO7Wq-SlVzRKpX3yDAs47zi8D8y9Leag7CZcJhwmRjhcsew2Oonx0rHG0Ju7djfp7pOM02K1NA6jNTqHAxh101xzmeL6M3PwoQDExCu2RnBPiXCfjH2vyzGeVExzmsW454SYZpWOs0TPXQPIwiLPa5br68kKZIcatnpdB69yHn0Cs7jTucnw21etMMO_JY1-acnz8S_IbWhkLRfDseHC0TfS-KPH4qL-RwZZvRZG8IaMOEMmLAHTLgDc6LSzZff5V__tr0eutY-P6XwgKqyyCs6Xv_ZyWf1ziQ31HZYFVuV0K0qksamPfoN1wiSKt3eWu1hlrdXdcB92OqF3X7Y7oWdftjphUf9sNsLjw9g6xgenQDbx_C4Fz4_ir3c_fcjAAD__7UjLSI=

query T
EXPLAIN (DISTSQL,VERBOSE) SELECT * FROM (SELECT * FROM abcde EXCEPT ALL SELECT * FROM abcde) WHERE c = 1 AND d = e ORDER BY a
Expand Down Expand Up @@ -712,7 +712,7 @@ vectorized: true
·
• intersect all
│ columns: (a, b, c, d, e)
│ ordering: +b,+c,+d,+a,+e
│ ordering: +b,+d,+a,+c,+e
│ estimated row count: 1 (missing stats)
├── • filter
Expand Down Expand Up @@ -741,7 +741,7 @@ vectorized: true
table: abcde@abcde_b_c_d_e_idx
spans: FULL SCAN
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9uLm1AQxt_7VwzzpM2UjZdAORA42calQjZuVXqhhGA801Swao8GtoT870Ut7BqStCn7EpjLN993fsE91j9zFOh9fljM_CUYcz-Kow8Lgo9eeBtEngmRt_DexfAa7sLgHoxhmWxSxeAvYy-M2vZssYATGyZ8eu-FHhgpTMEyYbacg6FgCmxCEM69EG6_wIYgJVAETJAgYVEqXiY_uEbxFS1cEVa6TLmuS9229t2Crx5RjAmzoto1bXtFmJaaUeyxyZqcUWCcbHIOOVGsb8ZIqLhJsrw726WT3e96s07Xas3rTD0iYVQlRS3gDa4OhOWueTpfN8mWUVgH-vcId1nesGZ9Yw39-74AQzotGSGEv4zf_gEkXZiCnJhnI9jXRHhOwX4xCs5_UXBekoJ7NsKT864otWLNamC8apV_WznxjnvWW464Caobd_iS-FfFYvg9IGHO3xpD2iOSzoikOyJpjUhORuZUZ9vvp0dIGOwaAdIiaZN0SLokJ2chTK75H0Kuq7Ko-RjGycvjlgCrLfdE63KnU37QZdrZ9GXQ6bqG4rrpp1Zf-EU_agM-F1sXxe5AbB-L7Yti57Kzc4WzdSx2L4onR86rw6vfAQAA___SNa8C
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9uLm1AQxt_7VwzzpM2UjZdAORA42calQjZuVXqhhGA801Swao8GtoT870Ut7BqStCn7EpjLN993fsE91j9zFOh9fljM_CUYcz-Kow8Lgo9eeBtEngmRt_DexfAa7sLgHoxhmWxSxeAvYy-M2vZssYATGyZ8eu-FHhgpTMEyYbacg6FgCmxCEM69EG6_wIYgJVAETJAgYVEqXiY_uEbxFS1cEVa6TLmuS9229t2Crx5RjAmzoto1bXtFmJaaUeyxyZqcUWCcbHIOOVGsb8ZIqLhJsrw726WT3e96s07Xas3rTD0iYVQlRS3gDa4OhOWueTpfN8mWUVgH-vcId1nesGZ9Yw39-74AQzotGSGEv4zf_gEkXZiCnJhnI9jXRHhOwX4xCs5_UXBekoJ7NsKT864otWLNamC8apV_WznxjnvWW464Caobd_iS-FfFYvg9IGHO3xpD2iOS7oikNSLpjEhORuZUZ9vvp0dIGOwaAdIiaZN0SLokJ2chTK75H0Kuq7Ko-RjGycvjlgCrLfdE63KnU37QZdrZ9GXQ6bqG4rrpp1Zf-EU_agM-F1sXxe5AbB-L7Yti57Kzc4WzdSx2L4onR86rw6vfAQAA___SLa8C

# Regression test for #64181. Ensure that a projection on top of an ordered
# UNION ALL correctly projects away ordering columns.
Expand Down
53 changes: 35 additions & 18 deletions pkg/sql/opt/memo/logical_props_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ func (b *logicalPropsBuilder) buildLocalityOptimizedSearchProps(
func (b *logicalPropsBuilder) buildSetProps(setNode RelExpr, rel *props.Relational) {
BuildSharedProps(setNode, &rel.Shared)

op := setNode.Op()
leftProps := setNode.Child(0).(RelExpr).Relational()
rightProps := setNode.Child(1).(RelExpr).Relational()
setPrivate := setNode.Private().(*SetPrivate)
Expand Down Expand Up @@ -720,12 +721,7 @@ func (b *logicalPropsBuilder) buildSetProps(setNode RelExpr, rel *props.Relation

// Functional Dependencies
// -----------------------
switch setNode.Op() {
case opt.UnionOp, opt.IntersectOp, opt.ExceptOp:
// These operators eliminate duplicates, so a strict key exists.
rel.FuncDeps.AddStrictKey(rel.OutputCols, rel.OutputCols)
}
switch setNode.Op() {
switch op {
case opt.UnionOp, opt.UnionAllOp, opt.LocalityOptimizedSearchOp:
// If columns at ordinals (i, j) are equivalent in both the left input
// and right input, then the output columns at ordinals at (i, j) are
Expand All @@ -738,27 +734,48 @@ func (b *logicalPropsBuilder) buildSetProps(setNode RelExpr, rel *props.Relation
}
}
}

case opt.IntersectOp, opt.IntersectAllOp, opt.ExceptOp, opt.ExceptAllOp:
// Intersect, IntersectAll, Except and ExceptAll only output rows from
// the left input, so if columns at ordinals (i, j) are equivalent in
// the left input, then they are equivalent in the output.
// TODO(mgartner): The entire FD set on the left side can be used, but
// columns may need to be mapped. Intersections can combine FD
// information from both the left and the right.
for i := range setPrivate.OutCols {
for j := i + 1; j < len(setPrivate.OutCols); j++ {
if leftProps.FuncDeps.AreColsEquiv(setPrivate.LeftCols[i], setPrivate.LeftCols[j]) {
rel.FuncDeps.AddEquivalency(setPrivate.OutCols[i], setPrivate.OutCols[j])
// With these operators, the output is a subset of the left input, so all
// the left FDs still hold (similar to a Select).
rel.FuncDeps.RemapFrom(&leftProps.FuncDeps, func(in opt.ColumnID) opt.ColumnID {
for i, leftCol := range setPrivate.LeftCols {
if in == leftCol {
return setPrivate.OutCols[i]
}
}
panic(errors.AssertionFailedf("invalid column %d in left FD", in))
})

if op == opt.IntersectOp || op == opt.IntersectAllOp {
// With Intersect operators, the output is also a subset of the right input,
// so all the right FDs apply as well.
var remapped props.FuncDepSet
remapped.RemapFrom(&rightProps.FuncDeps, func(in opt.ColumnID) opt.ColumnID {
for i, rightCol := range setPrivate.RightCols {
if in == rightCol {
return setPrivate.OutCols[i]
}
}
panic(errors.AssertionFailedf("invalid column %d in right FD", in))
})
rel.FuncDeps.AddFrom(&remapped)
}
}

// Add a strict key for variants that eliminate duplicates.
switch op {
case opt.UnionOp, opt.IntersectOp, opt.ExceptOp:
rel.FuncDeps.AddStrictKey(rel.OutputCols, rel.OutputCols)
}

// Cardinality
// -----------
// Calculate cardinality of the set operator.
rel.Cardinality = b.makeSetCardinality(
setNode.Op(), leftProps.Cardinality, rightProps.Cardinality)
rel.Cardinality = b.makeSetCardinality(op, leftProps.Cardinality, rightProps.Cardinality)
if rel.FuncDeps.HasMax1Row() {
rel.Cardinality = rel.Cardinality.Limit(1)
}

// Statistics
// ----------
Expand Down
12 changes: 8 additions & 4 deletions pkg/sql/opt/memo/testdata/logprops/set
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ intersect
├── columns: x:1(int!null) y:2(int) x:1(int!null)
├── left columns: x:1(int!null) y:2(int) x:1(int!null)
├── right columns: v:6(int) u:5(int) rowid:7(int)
├── key: (1,2)
├── key: (1)
├── fd: ()-->(2)
├── interesting orderings: (+1)
├── project
│ ├── columns: x:1(int!null) y:2(int)
Expand Down Expand Up @@ -92,7 +93,8 @@ except
├── columns: x:1(int!null) x:1(int!null) y:2(int)
├── left columns: x:1(int!null) x:1(int!null) y:2(int)
├── right columns: u:5(int) v:6(int) v:6(int)
├── key: (1,2)
├── key: (1)
├── fd: (1)-->(2)
├── interesting orderings: (+1)
├── project
│ ├── columns: x:1(int!null) y:2(int)
Expand Down Expand Up @@ -489,7 +491,8 @@ intersect-all
├── columns: a:1(int!null) b:2(int) c:3(int)
├── left columns: a:1(int!null) b:2(int) c:3(int)
├── right columns: a:6(int) b:7(int) c:8(int)
├── fd: (1)==(3), (3)==(1)
├── key: (1)
├── fd: (1)==(2,3), (3)==(1,2), (2)==(1,3)
├── interesting orderings: (+1)
├── select
│ ├── columns: a:1(int!null) b:2(int) c:3(int!null)
Expand Down Expand Up @@ -541,7 +544,8 @@ except-all
├── columns: a:1(int!null) b:2(int) c:3(int)
├── left columns: a:1(int!null) b:2(int) c:3(int)
├── right columns: a:6(int) b:7(int) c:8(int)
├── fd: (1)==(3), (3)==(1)
├── key: (1)
├── fd: (1)-->(2), (1)==(3), (3)==(1)
├── interesting orderings: (+1)
├── select
│ ├── columns: a:1(int!null) b:2(int) c:3(int!null)
Expand Down
59 changes: 31 additions & 28 deletions pkg/sql/opt/memo/testdata/stats/set
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ intersect
├── left columns: a.x:1(int!null) y:2(int) a.x:1(int!null)
├── right columns: z:7(int) b.x:6(int) rowid:9(int)
├── stats: [rows=2, distinct(1,2)=2, null(1,2)=0]
├── key: (1,2)
├── key: (1)
├── fd: ()-->(2)
├── project
│ ├── columns: a.x:1(int!null) y:2(int)
│ ├── stats: [rows=5000, distinct(1,2)=5000, null(1,2)=0]
Expand Down Expand Up @@ -283,6 +284,8 @@ intersect-all
├── left columns: a.x:1(int!null) y:2(int) a.x:1(int!null)
├── right columns: z:7(int) b.x:6(int) rowid:9(int)
├── stats: [rows=2]
├── key: (1)
├── fd: ()-->(2)
├── project
│ ├── columns: a.x:1(int!null) y:2(int)
│ ├── stats: [rows=5000]
Expand Down Expand Up @@ -401,7 +404,8 @@ except
├── left columns: a.x:1(int!null) a.x:1(int!null) y:2(int)
├── right columns: b.x:6(int) z:7(int) z:7(int)
├── stats: [rows=5000, distinct(1,2)=5000, null(1,2)=0]
├── key: (1,2)
├── key: (1)
├── fd: (1)-->(2)
├── project
│ ├── columns: a.x:1(int!null) y:2(int)
│ ├── stats: [rows=5000, distinct(1,2)=5000, null(1,2)=0]
Expand Down Expand Up @@ -441,6 +445,8 @@ except-all
├── left columns: a.x:1(int!null) a.x:1(int!null) y:2(int)
├── right columns: b.x:6(int) z:7(int) z:7(int)
├── stats: [rows=5000]
├── key: (1)
├── fd: (1)-->(2)
├── project
│ ├── columns: a.x:1(int!null) y:2(int)
│ ├── stats: [rows=5000]
Expand Down Expand Up @@ -878,9 +884,10 @@ except
├── columns: a:1(int) b:2(bool!null)
├── left columns: column1:1(int) column2:2(bool!null)
├── right columns: column1:3(int) column2:4(bool)
├── cardinality: [0 - 2]
├── cardinality: [0 - 1]
├── stats: [rows=1, distinct(1,2)=1, null(1,2)=0, distinct(2,5)=1, null(2,5)=0]
├── key: (1,2)
├── key: ()
├── fd: ()-->(1,2)
├── select
│ ├── columns: column1:1(int) column2:2(bool!null)
│ ├── cardinality: [0 - 2]
Expand Down Expand Up @@ -922,7 +929,8 @@ except
├── right columns: column1:3(int) column2:4(int)
├── cardinality: [0 - 3]
├── stats: [rows=2, distinct(1,2)=2, null(1,2)=0.666666667]
├── key: (1,2)
├── key: (2)
├── fd: ()-->(1)
├── select
│ ├── columns: column1:1(int) column2:2(int)
│ ├── cardinality: [0 - 3]
Expand Down Expand Up @@ -956,29 +964,24 @@ except
opt disable=SimplifyIntersectRight
VALUES (1), (2) INTERSECT VALUES (NULL) ORDER BY 1
----
sort
intersect
├── columns: column1:1(int)
├── left columns: column1:1(int)
├── right columns: column1:2(int)
├── cardinality: [0 - 1]
├── stats: [rows=1, distinct(1)=1, null(1)=0]
├── key: (1)
├── ordering: +1
└── intersect
├── columns: column1:1(int)
├── left columns: column1:1(int)
├── right columns: column1:2(int)
├── cardinality: [0 - 1]
├── stats: [rows=1, distinct(1)=1, null(1)=0]
├── key: (1)
├── values
│ ├── columns: column1:1(int!null)
│ ├── cardinality: [2 - 2]
│ ├── stats: [rows=2, distinct(1)=2, null(1)=0]
│ ├── (1,) [type=tuple{int}]
│ └── (2,) [type=tuple{int}]
└── values
├── columns: column1:2(int)
├── cardinality: [1 - 1]
├── stats: [rows=1, distinct(2)=1, null(2)=1]
├── key: ()
├── fd: ()-->(2)
└── (NULL,) [type=tuple{int}]
├── key: ()
├── fd: ()-->(1)
├── values
│ ├── columns: column1:1(int!null)
│ ├── cardinality: [2 - 2]
│ ├── stats: [rows=2, distinct(1)=2, null(1)=0]
│ ├── (1,) [type=tuple{int}]
│ └── (2,) [type=tuple{int}]
└── values
├── columns: column1:2(int)
├── cardinality: [1 - 1]
├── stats: [rows=1, distinct(2)=1, null(2)=1]
├── key: ()
├── fd: ()-->(2)
└── (NULL,) [type=tuple{int}]
6 changes: 6 additions & 0 deletions pkg/sql/opt/memo/testdata/stats_quality/tpcc
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ except-all
├── left columns: no_w_id:3(int!null) no_d_id:2(int!null) no_o_id:1(int!null)
├── right columns: o_w_id:8(int) o_d_id:7(int) o_id:6(int)
├── stats: [rows=90000, distinct(1)=900, null(1)=0, distinct(2)=10, null(2)=0, distinct(3)=10, null(3)=0]
├── key: (1-3)
├── scan new_order
│ ├── save-table-name: consistency_08_scan_2
│ ├── columns: no_o_id:1(int!null) no_d_id:2(int!null) no_w_id:3(int!null)
Expand Down Expand Up @@ -1290,6 +1291,7 @@ except-all
├── left columns: o_w_id:3(int!null) o_d_id:2(int!null) o_id:1(int!null)
├── right columns: no_w_id:13(int) no_d_id:12(int) no_o_id:11(int)
├── stats: [rows=90000, distinct(1)=2999, null(1)=0, distinct(2)=10, null(2)=0, distinct(3)=10, null(3)=0]
├── key: (1-3)
├── project
│ ├── save-table-name: consistency_09_project_2
│ ├── columns: o_id:1(int!null) o_d_id:2(int!null) o_w_id:3(int!null)
Expand Down Expand Up @@ -1412,6 +1414,8 @@ except-all
├── left columns: o_w_id:3(int!null) o_d_id:2(int!null) o_id:1(int!null) o_ol_cnt:7(int)
├── right columns: ol_w_id:13(int) ol_d_id:12(int) ol_o_id:11(int) count_rows:23(int)
├── stats: [rows=300000, distinct(1)=2999, null(1)=0, distinct(2)=10, null(2)=0, distinct(3)=10, null(3)=0, distinct(7)=11, null(7)=0]
├── key: (1-3)
├── fd: (1-3)-->(7)
├── scan order
│ ├── save-table-name: consistency_10_scan_2
│ ├── columns: o_id:1(int!null) o_d_id:2(int!null) o_w_id:3(int!null) o_ol_cnt:7(int)
Expand Down Expand Up @@ -1521,6 +1525,8 @@ except-all
├── left columns: ol_w_id:3(int!null) ol_d_id:2(int!null) ol_o_id:1(int!null) count_rows:13(int)
├── right columns: o_w_id:16(int) o_d_id:15(int) o_id:14(int) o_ol_cnt:20(int)
├── stats: [rows=295745, distinct(1)=2999, null(1)=0, distinct(2)=10, null(2)=0, distinct(3)=10, null(3)=0, distinct(13)=295745, null(13)=0]
├── key: (1-3)
├── fd: (1-3)-->(13)
├── group-by
│ ├── save-table-name: consistency_11_group_by_2
│ ├── columns: ol_o_id:1(int!null) ol_d_id:2(int!null) ol_w_id:3(int!null) count_rows:13(int!null)
Expand Down
Loading

0 comments on commit 491690a

Please sign in to comment.