diff --git a/pkg/sql/opt/memo/expr_format.go b/pkg/sql/opt/memo/expr_format.go index 6068a7937b2f..762538566089 100644 --- a/pkg/sql/opt/memo/expr_format.go +++ b/pkg/sql/opt/memo/expr_format.go @@ -653,9 +653,6 @@ func (f *ExprFmtCtx) formatRelational(e RelExpr, tp treeprinter.Node) { if !relational.VolatilitySet.IsLeakProof() { writeFlag(relational.VolatilitySet.String()) } - if relational.CanHaveSideEffects { - writeFlag("side-effects") - } if relational.CanMutate { writeFlag("mutations") } @@ -923,9 +920,6 @@ func (f *ExprFmtCtx) scalarPropsStrings(scalar opt.ScalarExpr) []string { if !scalarProps.VolatilitySet.IsLeakProof() { emitProp(scalarProps.VolatilitySet.String()) } - if scalarProps.CanHaveSideEffects { - emitProp("side-effects") - } if scalarProps.HasCorrelatedSubquery { emitProp("correlated-subquery") } else if scalarProps.HasSubquery { diff --git a/pkg/sql/opt/memo/logical_props_builder.go b/pkg/sql/opt/memo/logical_props_builder.go index da289f11e9a5..ed0aaa16f88c 100644 --- a/pkg/sql/opt/memo/logical_props_builder.go +++ b/pkg/sql/opt/memo/logical_props_builder.go @@ -66,7 +66,6 @@ func (b *logicalPropsBuilder) buildScanProps(scan *ScanExpr, rel *props.Relation // ------------ // A Locking option is a side-effect (we don't want to elide this scan). if scan.Locking != nil { - rel.CanHaveSideEffects = true rel.VolatilitySet.AddVolatile() } @@ -911,7 +910,6 @@ func (b *logicalPropsBuilder) buildLimitProps(limit *LimitExpr, rel *props.Relat // ------------ // Negative limits can trigger a runtime error. if constLimit < 0 || !haveConstLimit { - rel.CanHaveSideEffects = true rel.VolatilitySet.AddImmutable() } @@ -1356,8 +1354,8 @@ func (b *logicalPropsBuilder) buildZipItemProps(item *ZipItem, scalar *props.Sca // // Note that shared is an "input-output" argument, and should be assumed // to be partially filled in already. Boolean fields such as HasPlaceholder, -// CanHaveSideEffects and HasCorrelatedSubquery should never be reset to false -// once set to true. +// HasCorrelatedSubquery should never be reset to false once set to true; +// VolatilitySet should never be re-initialized. func BuildSharedProps(e opt.Expr, shared *props.Shared) { switch t := e.(type) { case *VariableExpr: @@ -1387,7 +1385,6 @@ func BuildSharedProps(e opt.Expr, shared *props.Shared) { } } if !nonZero { - shared.CanHaveSideEffects = true shared.VolatilitySet.AddImmutable() } @@ -1401,10 +1398,6 @@ func BuildSharedProps(e opt.Expr, shared *props.Shared) { } case *FunctionExpr: - if t.Properties.Impure { - // Impure functions can return different value on each call. - shared.CanHaveSideEffects = true - } shared.VolatilitySet.Add(t.Overload.Volatility) case *CastExpr: @@ -1444,7 +1437,6 @@ func BuildSharedProps(e opt.Expr, shared *props.Shared) { } shared.VolatilitySet.Add(o.Volatility) } else if opt.IsMutationOp(e) { - shared.CanHaveSideEffects = true shared.CanMutate = true shared.VolatilitySet.AddVolatile() } @@ -1470,9 +1462,6 @@ func BuildSharedProps(e opt.Expr, shared *props.Shared) { shared.HasPlaceholder = true } shared.VolatilitySet.UnionWith(cached.VolatilitySet) - if cached.CanHaveSideEffects { - shared.CanHaveSideEffects = true - } if cached.CanMutate { shared.CanMutate = true } diff --git a/pkg/sql/opt/memo/testdata/logprops/delete b/pkg/sql/opt/memo/testdata/logprops/delete index 6738f19ec10a..2e3b1daf8e74 100644 --- a/pkg/sql/opt/memo/testdata/logprops/delete +++ b/pkg/sql/opt/memo/testdata/logprops/delete @@ -24,7 +24,7 @@ delete abcde ├── columns: ├── fetch columns: a:7(int) b:8(int) c:9(int) d:10(int) rowid:11(int) e:12(int) ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── select ├── columns: a:7(int!null) b:8(int) c:9(int!null) d:10(int) rowid:11(int!null) e:12(int) ├── key: (11) @@ -55,13 +55,13 @@ DELETE FROM abcde WHERE a=1 RETURNING * ---- project ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(1) ├── prune: (1-4) └── delete abcde ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) rowid:5(int!null) ├── fetch columns: a:7(int) b:8(int) c:9(int) d:10(int) rowid:11(int) e:12(int) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (5) ├── fd: ()-->(1), (5)-->(2-4) ├── prune: (1-4) @@ -96,7 +96,7 @@ DELETE FROM abcde WHERE rowid=1 RETURNING * project ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-4) ├── prune: (1-4) @@ -104,7 +104,7 @@ project ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) rowid:5(int!null) ├── fetch columns: a:7(int) b:8(int) c:9(int) d:10(int) rowid:11(int) e:12(int) ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-5) ├── prune: (1-4) @@ -139,13 +139,13 @@ 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, side-effects, mutations + ├── volatile, mutations ├── fd: (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) ├── fetch columns: a:7(int) b:8(int) c:9(int) d:10(int) rowid:11(int) e:12(int) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (5) ├── fd: (2)==(3), (3)==(2), (5)-->(1-4) ├── prune: (1-4) diff --git a/pkg/sql/opt/memo/testdata/logprops/insert b/pkg/sql/opt/memo/testdata/logprops/insert index 7db1dc52f012..370e43c147e7 100644 --- a/pkg/sql/opt/memo/testdata/logprops/insert +++ b/pkg/sql/opt/memo/testdata/logprops/insert @@ -30,18 +30,18 @@ insert abcde │ ├── column11:11 => rowid:5 │ └── column12:12 => e:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column13:13(int!null) y:8(int!null) column10:10(int!null) column11:11(int) column12:12(int) ├── cardinality: [0 - 10] - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(10,12), (8)-->(13) ├── prune: (8,10-13) ├── interesting orderings: (+8) ├── project │ ├── columns: column10:10(int!null) column11:11(int) column12:12(int) y:8(int!null) │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(10,12) │ ├── prune: (8,10-12) │ ├── interesting orderings: (+8) @@ -67,7 +67,7 @@ insert abcde │ │ └── const: 10 [type=int] │ └── projections │ ├── const: 10 [as=column10:10, type=int] - │ ├── function: unique_rowid [as=column11:11, type=int, volatile, side-effects] + │ ├── function: unique_rowid [as=column11:11, type=int, volatile] │ └── cast: INT8 [as=column12:12, type=int, immutable] │ └── null [type=unknown] └── projections @@ -84,7 +84,7 @@ INSERT INTO abcde (a, b) SELECT y, y FROM xyz ORDER BY y, z LIMIT 10 RETURNING * project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) ├── prune: (1-4) └── insert abcde @@ -97,19 +97,19 @@ project │ ├── column11:11 => rowid:5 │ └── column12:12 => e:6 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) └── project ├── columns: column13:13(int!null) y:8(int!null) column10:10(int!null) column11:11(int) column12:12(int) ├── cardinality: [0 - 10] - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(10,12), (8)-->(13) ├── prune: (8,10-13) ├── interesting orderings: (+8) ├── project │ ├── columns: column10:10(int!null) column11:11(int) column12:12(int) y:8(int!null) │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(10,12) │ ├── prune: (8,10-12) │ ├── interesting orderings: (+8) @@ -135,7 +135,7 @@ project │ │ └── const: 10 [type=int] │ └── projections │ ├── const: 10 [as=column10:10, type=int] - │ ├── function: unique_rowid [as=column11:11, type=int, volatile, side-effects] + │ ├── function: unique_rowid [as=column11:11, type=int, volatile] │ └── cast: INT8 [as=column12:12, type=int, immutable] │ └── null [type=unknown] └── projections @@ -151,7 +151,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, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) ├── prune: (1-4) └── insert abcde @@ -163,16 +163,16 @@ project │ ├── column13:13 => d:4 │ ├── column11:11 => rowid:5 │ └── column12:12 => e:6 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(3), (1)==(2), (2)==(1), (1)-->(4) └── project ├── columns: column13:13(int!null) y:8(int!null) column10:10(int!null) column11:11(int) column12:12(int) - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(10,12), (8)-->(13) ├── prune: (8,10-13) ├── project │ ├── columns: column10:10(int!null) column11:11(int) column12:12(int) y:8(int!null) - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(10,12) │ ├── prune: (8,10-12) │ ├── project @@ -186,7 +186,7 @@ project │ │ └── interesting orderings: (+7) │ └── projections │ ├── const: 10 [as=column10:10, type=int] - │ ├── function: unique_rowid [as=column11:11, type=int, volatile, side-effects] + │ ├── function: unique_rowid [as=column11:11, type=int, volatile] │ └── cast: INT8 [as=column12:12, type=int, immutable] │ └── null [type=unknown] └── projections @@ -210,20 +210,20 @@ insert abcde │ ├── column10:10 => rowid:5 │ └── column11:11 => e:6 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-5) └── project ├── columns: column12:12(int!null) column1:7(int!null) column2:8(int!null) column9:9(int!null) column10:10(int) column11:11(int) ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(7-12) ├── prune: (7-12) ├── project │ ├── columns: column9:9(int!null) column10:10(int) column11:11(int) column1:7(int!null) column2:8(int!null) │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(7-11) │ ├── prune: (7-11) @@ -238,7 +238,7 @@ insert abcde │ │ └── const: 2 [type=int] │ └── projections │ ├── const: 10 [as=column9:9, type=int] - │ ├── function: unique_rowid [as=column10:10, type=int, volatile, side-effects] + │ ├── function: unique_rowid [as=column10:10, type=int, volatile] │ └── cast: INT8 [as=column11:11, type=int, immutable] │ └── null [type=unknown] └── projections @@ -254,7 +254,7 @@ INSERT INTO abcde (a, b) SELECT y, (z+1)::int FROM xyz WHERE y=1 RETURNING a, c; ---- project ├── columns: a:1(int!null) c:3(int!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(1,3) ├── prune: (1,3) └── insert abcde @@ -266,16 +266,16 @@ project │ ├── column14:14 => d:4 │ ├── column12:12 => rowid:5 │ └── column13:13 => e:6 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(1,3), (2)-->(4) └── project ├── columns: column14:14(int) y:8(int!null) int8:10(int) column11:11(int!null) column12:12(int) column13:13(int) - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(8,11,13), (10)-->(14) ├── prune: (8,10-14) ├── project │ ├── columns: column11:11(int!null) column12:12(int) column13:13(int) y:8(int!null) int8:10(int) - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(8,11,13) │ ├── prune: (8,10-13) │ ├── project @@ -306,7 +306,7 @@ project │ │ └── const: 1.0 [type=float] │ └── projections │ ├── const: 10 [as=column11:11, type=int] - │ ├── function: unique_rowid [as=column12:12, type=int, volatile, side-effects] + │ ├── function: unique_rowid [as=column12:12, type=int, volatile] │ └── cast: INT8 [as=column13:13, type=int, immutable] │ └── null [type=unknown] └── projections diff --git a/pkg/sql/opt/memo/testdata/logprops/join b/pkg/sql/opt/memo/testdata/logprops/join index 0f4f166d73e2..5e21dd742f2c 100644 --- a/pkg/sql/opt/memo/testdata/logprops/join +++ b/pkg/sql/opt/memo/testdata/logprops/join @@ -1476,13 +1476,13 @@ SELECT (SELECT m FROM ---- with &1 ├── columns: m:19(int) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(19) ├── prune: (19) ├── project │ ├── columns: uv.u:4(int!null) uv.v:5(int!null) │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(4,5) │ ├── prune: (4,5) @@ -1493,13 +1493,13 @@ with &1 │ │ ├── column2:8 => uv.v:5 │ │ └── column9:9 => rowid:6 │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(4-6) │ └── values │ ├── columns: column1:7(int!null) column2:8(int!null) column9:9(int) │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(7-9) │ ├── prune: (7-9) diff --git a/pkg/sql/opt/memo/testdata/logprops/limit b/pkg/sql/opt/memo/testdata/logprops/limit index 70b5aed509c2..ad1e3cb462dc 100644 --- a/pkg/sql/opt/memo/testdata/logprops/limit +++ b/pkg/sql/opt/memo/testdata/logprops/limit @@ -57,7 +57,7 @@ SELECT * FROM xyzs LIMIT (SELECT 1) ---- limit ├── columns: x:1(int!null) y:2(int) z:3(float!null) s:4(string) - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-4), (3,4)~~>(1,2) ├── prune: (1-4) @@ -113,7 +113,7 @@ SELECT (SELECT x FROM kuv LIMIT y) FROM xyzs ---- project ├── columns: x:9(int) - ├── immutable, side-effects + ├── immutable ├── prune: (9) ├── scan xyzs │ ├── columns: xyzs.x:1(int!null) y:2(int) z:3(float!null) s:4(string) @@ -122,19 +122,19 @@ project │ ├── prune: (1-4) │ └── interesting orderings: (+1) (-4,+3,+1) └── projections - └── subquery [as=x:9, type=int, outer=(1,2), immutable, side-effects, correlated-subquery] + └── subquery [as=x:9, type=int, outer=(1,2), immutable, correlated-subquery] └── max1-row ├── columns: x:8(int) ├── error: "more than one row returned by a subquery used as an expression" ├── outer: (1,2) ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(8) └── limit ├── columns: x:8(int) ├── outer: (1,2) - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(8) ├── prune: (8) ├── project diff --git a/pkg/sql/opt/memo/testdata/logprops/scalar b/pkg/sql/opt/memo/testdata/logprops/scalar index 45cb0aa53d87..f86d4bab143b 100644 --- a/pkg/sql/opt/memo/testdata/logprops/scalar +++ b/pkg/sql/opt/memo/testdata/logprops/scalar @@ -193,26 +193,26 @@ GROUP BY div group-by ├── columns: sum:7(decimal!null) div:3(decimal) ├── grouping columns: div:3(decimal) - ├── stable, side-effects + ├── stable ├── key: (3) ├── fd: (3)-->(7) ├── prune: (7) ├── project │ ├── columns: x:1(int!null) div:3(decimal) - │ ├── stable, side-effects + │ ├── stable │ ├── fd: (1)-->(3) │ ├── prune: (1,3) │ ├── interesting orderings: (+1) │ └── inner-join (hash) │ ├── columns: x:1(int!null) y:2(int) div:3(decimal) u:4(int!null) v:5(int!null) │ ├── multiplicity: left-rows(zero-or-more), right-rows(zero-or-one) - │ ├── stable, side-effects + │ ├── stable │ ├── fd: (1)-->(2,3), (1)==(4), (4)==(1) │ ├── prune: (2,3,5) │ ├── interesting orderings: (+1) │ ├── project │ │ ├── columns: div:3(decimal) x:1(int!null) y:2(int) - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── key: (1) │ │ ├── fd: (1)-->(2,3) │ │ ├── prune: (1-3) @@ -226,16 +226,16 @@ group-by │ │ │ ├── interesting orderings: (+1) │ │ │ └── unfiltered-cols: (1,2) │ │ └── projections - │ │ └── div [as=div:3, type=decimal, outer=(1,2), immutable, side-effects] + │ │ └── div [as=div:3, type=decimal, outer=(1,2), immutable] │ │ ├── variable: x:1 [type=int] │ │ └── variable: y:2 [type=int] │ ├── project │ │ ├── columns: u:4(int) v:5(int!null) - │ │ ├── stable, side-effects + │ │ ├── stable │ │ ├── prune: (4,5) │ │ └── select │ │ ├── columns: u:4(int) v:5(int!null) rowid:6(int!null) - │ │ ├── stable, side-effects + │ │ ├── stable │ │ ├── key: (6) │ │ ├── fd: (6)-->(4,5) │ │ ├── prune: (4-6) @@ -247,7 +247,7 @@ group-by │ │ │ ├── prune: (4-6) │ │ │ └── interesting orderings: (+6) │ │ └── filters - │ │ └── gt [type=bool, stable, side-effects] + │ │ └── gt [type=bool, stable] │ │ ├── function: now [type=timestamptz] │ │ └── cast: TIMESTAMPTZ [type=timestamptz] │ │ └── const: '2018-01-01' [type=string] diff --git a/pkg/sql/opt/memo/testdata/logprops/scan b/pkg/sql/opt/memo/testdata/logprops/scan index 0597a37f08d3..06a6604b6a08 100644 --- a/pkg/sql/opt/memo/testdata/logprops/scan +++ b/pkg/sql/opt/memo/testdata/logprops/scan @@ -206,7 +206,7 @@ SELECT * FROM a FOR UPDATE scan a ├── columns: x:1(int!null) y:2(int) s:3(string) d:4(decimal!null) ├── locking: for-update - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-4), (3,4)~~>(1,2) ├── prune: (1-4) diff --git a/pkg/sql/opt/memo/testdata/logprops/srfs b/pkg/sql/opt/memo/testdata/logprops/srfs index b0bec921d8e2..e68146c4854e 100644 --- a/pkg/sql/opt/memo/testdata/logprops/srfs +++ b/pkg/sql/opt/memo/testdata/logprops/srfs @@ -12,12 +12,12 @@ SELECT generate_series(0,1) FROM (SELECT * FROM xy LIMIT 0) project-set ├── columns: generate_series:3(int) ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── values │ ├── cardinality: [0 - 0] │ └── key: () └── zip - └── function: generate_series [type=int, immutable, side-effects] + └── function: generate_series [type=int, immutable] ├── const: 0 [type=int] └── const: 1 [type=int] diff --git a/pkg/sql/opt/memo/testdata/logprops/update b/pkg/sql/opt/memo/testdata/logprops/update index 528973785ef2..36b0d1fca4c3 100644 --- a/pkg/sql/opt/memo/testdata/logprops/update +++ b/pkg/sql/opt/memo/testdata/logprops/update @@ -28,7 +28,7 @@ update abcde │ ├── column15:15 => d:4 │ └── column14:14 => e:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column15:15(int!null) a:7(int!null) b:8(int) c:9(int!null) d:10(int) rowid:11(int!null) e:12(int) b_new:13(int!null) column14:14(int!null) ├── immutable @@ -88,7 +88,7 @@ UPDATE abcde SET b=10 WHERE a=1 RETURNING * ---- project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(1,2), (3)-->(4) ├── prune: (1-4) └── update abcde @@ -98,7 +98,7 @@ project │ ├── b_new:13 => b:2 │ ├── column15:15 => d:4 │ └── column14:14 => e:6 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (5) ├── fd: ()-->(1,2), (5)-->(3,4), (3)-->(4) └── project @@ -161,7 +161,7 @@ UPDATE abcde SET b=10 WHERE rowid=1 RETURNING * project ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int!null) ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-4) ├── prune: (1-4) @@ -173,7 +173,7 @@ project │ ├── column15:15 => d:4 │ └── column14:14 => e:6 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-5) └── project @@ -239,7 +239,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!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(1), (2)==(3), (3)==(2), (2)-->(4) ├── prune: (1-4) └── update abcde @@ -249,7 +249,7 @@ project │ ├── a_new:13 => a:1 │ ├── column15:15 => d:4 │ └── column14:14 => e:6 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (5) ├── fd: ()-->(1), (2)==(3), (3)==(2), (5)-->(2-4), (2)-->(4) └── project diff --git a/pkg/sql/opt/memo/testdata/logprops/upsert b/pkg/sql/opt/memo/testdata/logprops/upsert index 2fa686397728..c581105f4fd4 100644 --- a/pkg/sql/opt/memo/testdata/logprops/upsert +++ b/pkg/sql/opt/memo/testdata/logprops/upsert @@ -29,7 +29,7 @@ RETURNING * project ├── columns: a:1(int!null) b:2(int) c:3(int) ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── prune: (1-3) └── upsert abc ├── columns: a:1(int!null) b:2(int) c:3(int) rowid:4(int!null) @@ -50,11 +50,11 @@ project │ ├── upsert_c:19 => c:3 │ └── upsert_rowid:20 => rowid:4 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_a:17(int!null) upsert_b:18(int) upsert_c:19(int) upsert_rowid:20(int) x:5(int!null) y:6(int!null) column8:8(int) column9:9(int!null) a:10(int) b:11(int) c:12(int) rowid:13(int) a_new:14(int!null) b_new:15(int) column16:16(int) ├── cardinality: [0 - 1] - ├── volatile, side-effects + ├── volatile ├── key: (13) ├── fd: ()-->(5,6,8,9,14), (13)-->(10-12,17-20), (10)-->(11-13), (11,12)~~>(10,13), (12)-->(15), (15)-->(16) ├── prune: (5,6,8-20) @@ -63,7 +63,7 @@ project ├── project │ ├── columns: column16:16(int) x:5(int!null) y:6(int!null) column8:8(int) column9:9(int!null) a:10(int) b:11(int) c:12(int) rowid:13(int) a_new:14(int!null) b_new:15(int) │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (13) │ ├── fd: ()-->(5,6,8,9,14), (13)-->(10-12), (10)-->(11-13), (11,12)~~>(10,13), (12)-->(15), (15)-->(16) │ ├── prune: (5,6,8-16) @@ -72,7 +72,7 @@ project │ ├── project │ │ ├── columns: a_new:14(int!null) b_new:15(int) x:5(int!null) y:6(int!null) column8:8(int) column9:9(int!null) a:10(int) b:11(int) c:12(int) rowid:13(int) │ │ ├── cardinality: [0 - 1] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (13) │ │ ├── fd: ()-->(5,6,8,9,14), (13)-->(10-12), (10)-->(11-13), (11,12)~~>(10,13), (12)-->(15) │ │ ├── prune: (5,6,8-15) @@ -82,7 +82,7 @@ project │ │ │ ├── columns: x:5(int!null) y:6(int!null) column8:8(int) column9:9(int!null) a:10(int) b:11(int) c:12(int) rowid:13(int) │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: (13) │ │ │ ├── fd: ()-->(5,6,8,9), (13)-->(10-12), (10)-->(11-13), (11,12)~~>(10,13) │ │ │ ├── prune: (10,13) @@ -93,19 +93,19 @@ project │ │ │ │ ├── grouping columns: y:6(int!null) column9:9(int!null) │ │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" │ │ │ │ ├── cardinality: [0 - 1] - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── key: () │ │ │ │ ├── fd: ()-->(5,6,8,9) │ │ │ │ ├── project │ │ │ │ │ ├── columns: column9:9(int!null) x:5(int!null) y:6(int!null) column8:8(int) - │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ ├── volatile │ │ │ │ │ ├── key: (5) │ │ │ │ │ ├── fd: ()-->(6,9), (5)-->(8) │ │ │ │ │ ├── prune: (5,6,8,9) │ │ │ │ │ ├── interesting orderings: (+5) (+6) │ │ │ │ │ ├── project │ │ │ │ │ │ ├── columns: column8:8(int) x:5(int!null) y:6(int!null) - │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ ├── fd: ()-->(6), (5)-->(8) │ │ │ │ │ │ ├── prune: (5,6,8) @@ -133,7 +133,7 @@ project │ │ │ │ │ │ │ ├── variable: y:6 [type=int] │ │ │ │ │ │ │ └── const: 1 [type=int] │ │ │ │ │ │ └── projections - │ │ │ │ │ │ └── function: unique_rowid [as=column8:8, type=int, volatile, side-effects] + │ │ │ │ │ │ └── function: unique_rowid [as=column8:8, type=int, volatile] │ │ │ │ │ └── projections │ │ │ │ │ └── plus [as=column9:9, type=int, outer=(6), immutable] │ │ │ │ │ ├── variable: y:6 [type=int] @@ -214,7 +214,7 @@ RETURNING * ---- project ├── columns: a:1(int!null) b:2(int) c:3(int) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(2,3), (2)-->(3), (2,3)~~>(1) ├── prune: (1-3) @@ -225,24 +225,24 @@ project │ ├── y:6 => b:2 │ ├── column9:9 => c:3 │ └── column8:8 => rowid:4 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(2-4), (2)-->(3), (4)~~>(1-3), (2,3)~~>(1,4) └── upsert-distinct-on ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) ├── grouping columns: y:6(int) column9:9(int) - ├── volatile, side-effects + ├── volatile ├── key: (5) ├── fd: (5)-->(6,8,9), (6)-->(9), (8)~~>(5,6,9), (6,9)~~>(5,8) ├── project │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (5) │ ├── fd: (5)-->(6,8,9), (6)-->(9), (8)~~>(5,6,9) │ ├── prune: (5,6,8,9) │ └── select │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:18(int) b:19(int) c:20(int) rowid:21(int) - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (5) │ ├── fd: ()-->(18-21), (5)-->(6,8,9), (6)-->(9), (8)~~>(5,6,9) │ ├── prune: (18) @@ -250,7 +250,7 @@ project │ ├── left-join (hash) │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:18(int) b:19(int) c:20(int) rowid:21(int) │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (5,21) │ │ ├── fd: (5)-->(6,8,9), (6)-->(9), (8)~~>(5,6,9), (21)-->(18-20), (18)-->(19-21), (19,20)~~>(18,21) │ │ ├── prune: (18,21) @@ -259,18 +259,18 @@ project │ │ ├── upsert-distinct-on │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) │ │ │ ├── grouping columns: x:5(int!null) - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: (5) │ │ │ ├── fd: (5)-->(6,8,9), (6)-->(9), (8)~~>(5,6,9) │ │ │ ├── project │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── key: (5) │ │ │ │ ├── fd: (5)-->(6,8), (6)-->(9), (8)~~>(5,6,9) │ │ │ │ ├── prune: (5,6,8,9) │ │ │ │ └── select │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:14(int) b:15(int) c:16(int) rowid:17(int) - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── key: (5) │ │ │ │ ├── fd: ()-->(14-17), (5)-->(6,8), (6)-->(9), (8)~~>(5,6,9) │ │ │ │ ├── prune: (15-17) @@ -278,7 +278,7 @@ project │ │ │ │ ├── left-join (hash) │ │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:14(int) b:15(int) c:16(int) rowid:17(int) │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ ├── volatile │ │ │ │ │ ├── key: (5) │ │ │ │ │ ├── fd: (5)-->(6,8,14-17), (6)-->(9), (8)~~>(5,6,9), (17)-->(14-16), (14)-->(15-17), (15,16)~~>(14,17) │ │ │ │ │ ├── prune: (15-17) @@ -287,19 +287,19 @@ project │ │ │ │ │ ├── upsert-distinct-on │ │ │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) │ │ │ │ │ │ ├── grouping columns: column8:8(int) - │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ ├── fd: (5)-->(6,8), (6)-->(9), (8)~~>(5,6,9) │ │ │ │ │ │ ├── project │ │ │ │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) - │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ │ ├── fd: (5)-->(6,8), (6)-->(9) │ │ │ │ │ │ │ ├── prune: (5,6,8,9) │ │ │ │ │ │ │ ├── interesting orderings: (+5) (+6) │ │ │ │ │ │ │ └── select │ │ │ │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:10(int) b:11(int) c:12(int) rowid:13(int) - │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ │ ├── fd: ()-->(10-13), (5)-->(6,8), (6)-->(9) │ │ │ │ │ │ │ ├── prune: (5,6,9-12) @@ -307,7 +307,7 @@ project │ │ │ │ │ │ │ ├── left-join (hash) │ │ │ │ │ │ │ │ ├── columns: x:5(int!null) y:6(int) column8:8(int) column9:9(int) a:10(int) b:11(int) c:12(int) rowid:13(int) │ │ │ │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ │ │ ├── fd: (5)-->(6,8,10-13), (6)-->(9), (13)-->(10-12), (10)-->(11-13), (11,12)~~>(10,13) │ │ │ │ │ │ │ │ ├── prune: (5,6,9-12) @@ -315,7 +315,7 @@ project │ │ │ │ │ │ │ │ ├── interesting orderings: (+5) (+6) (+13) (+10) (+11,+12,+13) │ │ │ │ │ │ │ │ ├── project │ │ │ │ │ │ │ │ │ ├── columns: column9:9(int) x:5(int!null) y:6(int) column8:8(int) - │ │ │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ │ │ │ ├── fd: (5)-->(6,8), (6)-->(9) │ │ │ │ │ │ │ │ │ ├── prune: (5,6,8,9) @@ -323,7 +323,7 @@ project │ │ │ │ │ │ │ │ │ ├── unfiltered-cols: (5-7) │ │ │ │ │ │ │ │ │ ├── project │ │ │ │ │ │ │ │ │ │ ├── columns: column8:8(int) x:5(int!null) y:6(int) - │ │ │ │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ │ │ │ ├── key: (5) │ │ │ │ │ │ │ │ │ │ ├── fd: (5)-->(6,8) │ │ │ │ │ │ │ │ │ │ ├── prune: (5,6,8) @@ -344,7 +344,7 @@ project │ │ │ │ │ │ │ │ │ │ │ ├── interesting orderings: (+5) (+6,+7,+5) (+7,+6,+5) │ │ │ │ │ │ │ │ │ │ │ └── unfiltered-cols: (5-7) │ │ │ │ │ │ │ │ │ │ └── projections - │ │ │ │ │ │ │ │ │ │ └── function: unique_rowid [as=column8:8, type=int, volatile, side-effects] + │ │ │ │ │ │ │ │ │ │ └── function: unique_rowid [as=column8:8, type=int, volatile] │ │ │ │ │ │ │ │ │ └── projections │ │ │ │ │ │ │ │ │ └── plus [as=column9:9, type=int, outer=(6), immutable] │ │ │ │ │ │ │ │ │ ├── variable: y:6 [type=int] @@ -439,7 +439,7 @@ UPSERT INTO abc (a) VALUES (1), (2) RETURNING b+c project ├── columns: "?column?":17(int) ├── cardinality: [1 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── prune: (17) ├── upsert abc │ ├── columns: a:1(int!null) b:2(int) c:3(int) rowid:4(int!null) @@ -459,11 +459,11 @@ project │ │ ├── upsert_c:15 => c:3 │ │ └── upsert_rowid:16 => rowid:4 │ ├── cardinality: [1 - 2] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── project │ ├── columns: upsert_b:14(int) upsert_c:15(int) upsert_rowid:16(int) column1:5(int!null) column6:6(int!null) column7:7(int) column8:8(int!null) a:9(int) b:10(int) c:11(int) rowid:12(int) column13:13(int) │ ├── cardinality: [1 - 2] - │ ├── volatile, side-effects + │ ├── volatile │ ├── lax-key: (7,12) │ ├── fd: ()-->(6,8), (7)~~>(5), (12)-->(9-11,14,15), (9)-->(10-12), (10,11)~~>(9,12), (10)-->(13), (7,12)-->(16) │ ├── prune: (5-16) @@ -472,7 +472,7 @@ project │ ├── project │ │ ├── columns: column13:13(int) column1:5(int!null) column6:6(int!null) column7:7(int) column8:8(int!null) a:9(int) b:10(int) c:11(int) rowid:12(int) │ │ ├── cardinality: [1 - 2] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── lax-key: (7,12) │ │ ├── fd: ()-->(6,8), (7)~~>(5), (12)-->(9-11), (9)-->(10-12), (10,11)~~>(9,12), (10)-->(13) │ │ ├── prune: (5-13) @@ -482,7 +482,7 @@ project │ │ │ ├── columns: column1:5(int!null) column6:6(int!null) column7:7(int) column8:8(int!null) a:9(int) b:10(int) c:11(int) rowid:12(int) │ │ │ ├── cardinality: [1 - 2] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── lax-key: (7,12) │ │ │ ├── fd: ()-->(6,8), (7)~~>(5), (12)-->(9-11), (9)-->(10-12), (10,11)~~>(9,12) │ │ │ ├── prune: (9-11) @@ -493,19 +493,19 @@ project │ │ │ │ ├── grouping columns: column7:7(int) │ │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" │ │ │ │ ├── cardinality: [1 - 2] - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── lax-key: (7) │ │ │ │ ├── fd: ()-->(6,8), (7)~~>(5,6,8) │ │ │ │ ├── project │ │ │ │ │ ├── columns: column8:8(int!null) column1:5(int!null) column6:6(int!null) column7:7(int) │ │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ ├── volatile │ │ │ │ │ ├── fd: ()-->(6,8) │ │ │ │ │ ├── prune: (5-8) │ │ │ │ │ ├── project │ │ │ │ │ │ ├── columns: column6:6(int!null) column7:7(int) column1:5(int!null) │ │ │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ ├── fd: ()-->(6) │ │ │ │ │ │ ├── prune: (5-7) │ │ │ │ │ │ ├── values @@ -518,7 +518,7 @@ project │ │ │ │ │ │ │ └── const: 2 [type=int] │ │ │ │ │ │ └── projections │ │ │ │ │ │ ├── const: 10 [as=column6:6, type=int] - │ │ │ │ │ │ └── function: unique_rowid [as=column7:7, type=int, volatile, side-effects] + │ │ │ │ │ │ └── function: unique_rowid [as=column7:7, type=int, volatile] │ │ │ │ │ └── projections │ │ │ │ │ └── plus [as=column8:8, type=int, outer=(6), immutable] │ │ │ │ │ ├── variable: column6:6 [type=int] @@ -601,10 +601,10 @@ upsert abc │ ├── upsert_b:18 => b:2 │ └── upsert_c:19 => c:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_a:17(int) upsert_b:18(int!null) upsert_c:19(int!null) upsert_rowid:20(int) y:6(int!null) column8:8(int!null) column9:9(int) column10:10(int!null) a:11(int) b:12(int) c:13(int) rowid:14(int) b_new:15(int!null) column16:16(int!null) - ├── volatile, side-effects + ├── volatile ├── key: (6) ├── fd: ()-->(8,10,15,16), (6)-->(9,11-14,17), (14)-->(11-13,18,19), (11)-->(12-14), (12,13)~~>(11,14), (9,14)-->(20) ├── prune: (6,8-20) @@ -612,7 +612,7 @@ upsert abc ├── interesting orderings: (+14) (+11) (+12,+13,+14) ├── project │ ├── columns: column16:16(int!null) y:6(int!null) column8:8(int!null) column9:9(int) column10:10(int!null) a:11(int) b:12(int) c:13(int) rowid:14(int) b_new:15(int!null) - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (6) │ ├── fd: ()-->(8,10,15,16), (6)-->(9,11-14), (14)-->(11-13), (11)-->(12-14), (12,13)~~>(11,14) │ ├── prune: (6,8-16) @@ -620,7 +620,7 @@ upsert abc │ ├── interesting orderings: (+14) (+11) (+12,+13,+14) │ ├── project │ │ ├── columns: b_new:15(int!null) y:6(int!null) column8:8(int!null) column9:9(int) column10:10(int!null) a:11(int) b:12(int) c:13(int) rowid:14(int) - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (6) │ │ ├── fd: ()-->(8,10,15), (6)-->(9,11-14), (14)-->(11-13), (11)-->(12-14), (12,13)~~>(11,14) │ │ ├── prune: (6,8-15) @@ -629,7 +629,7 @@ upsert abc │ │ ├── left-join (hash) │ │ │ ├── columns: y:6(int!null) column8:8(int!null) column9:9(int) column10:10(int!null) a:11(int) b:12(int) c:13(int) rowid:14(int) │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: (6) │ │ │ ├── fd: ()-->(8,10), (6)-->(9,11-14), (14)-->(11-13), (11)-->(12-14), (12,13)~~>(11,14) │ │ │ ├── prune: (12-14) @@ -639,18 +639,18 @@ upsert abc │ │ │ │ ├── columns: y:6(int!null) column8:8(int!null) column9:9(int) column10:10(int!null) │ │ │ │ ├── grouping columns: y:6(int!null) │ │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── key: (6) │ │ │ │ ├── fd: ()-->(8,10), (6)-->(8-10) │ │ │ │ ├── project │ │ │ │ │ ├── columns: column10:10(int!null) y:6(int!null) column8:8(int!null) column9:9(int) - │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ ├── volatile │ │ │ │ │ ├── fd: ()-->(8,10) │ │ │ │ │ ├── prune: (6,8-10) │ │ │ │ │ ├── interesting orderings: (+6) │ │ │ │ │ ├── project │ │ │ │ │ │ ├── columns: column8:8(int!null) column9:9(int) y:6(int!null) - │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ ├── fd: ()-->(8) │ │ │ │ │ │ ├── prune: (6,8,9) │ │ │ │ │ │ ├── interesting orderings: (+6) @@ -676,7 +676,7 @@ upsert abc │ │ │ │ │ │ │ └── null [type=unknown] │ │ │ │ │ │ └── projections │ │ │ │ │ │ ├── const: 10 [as=column8:8, type=int] - │ │ │ │ │ │ └── function: unique_rowid [as=column9:9, type=int, volatile, side-effects] + │ │ │ │ │ │ └── function: unique_rowid [as=column9:9, type=int, volatile] │ │ │ │ │ └── projections │ │ │ │ │ └── plus [as=column10:10, type=int, outer=(8), immutable] │ │ │ │ │ ├── variable: column8:8 [type=int] diff --git a/pkg/sql/opt/memo/testdata/logprops/with b/pkg/sql/opt/memo/testdata/logprops/with index 2e4a5c4b0d1f..c4746cc03e51 100644 --- a/pkg/sql/opt/memo/testdata/logprops/with +++ b/pkg/sql/opt/memo/testdata/logprops/with @@ -35,14 +35,14 @@ WITH foo AS (SELECT 1/0) SELECT * FROM foo with &1 (foo) ├── columns: "?column?":2(decimal!null) ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(2) ├── prune: (2) ├── project │ ├── columns: "?column?":1(decimal!null) │ ├── cardinality: [1 - 1] - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: () │ ├── fd: ()-->(1) │ ├── prune: (1) @@ -51,7 +51,7 @@ with &1 (foo) │ │ ├── key: () │ │ └── tuple [type=tuple] │ └── projections - │ └── div [as="?column?":1, type=decimal, immutable, side-effects] + │ └── div [as="?column?":1, type=decimal, immutable] │ ├── const: 1 [type=int] │ └── const: 0 [type=int] └── with-scan &1 (foo) @@ -73,7 +73,7 @@ WITH foo AS (SELECT 1) SELECT 1/0 FROM foo with &1 (foo) ├── columns: "?column?":3(decimal!null) ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(3) ├── prune: (3) @@ -92,7 +92,7 @@ with &1 (foo) └── project ├── columns: "?column?":3(decimal!null) ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(3) ├── prune: (3) @@ -109,7 +109,7 @@ with &1 (foo) │ └── cte-uses │ └── &1: count=1 used-columns=(1) └── projections - └── div [as="?column?":3, type=decimal, immutable, side-effects] + └── div [as="?column?":3, type=decimal, immutable] ├── const: 1 [type=int] └── const: 0 [type=int] diff --git a/pkg/sql/opt/memo/testdata/stats/delete b/pkg/sql/opt/memo/testdata/stats/delete index 7a7a1705a9dc..39515acc24be 100644 --- a/pkg/sql/opt/memo/testdata/stats/delete +++ b/pkg/sql/opt/memo/testdata/stats/delete @@ -40,14 +40,14 @@ WHERE x > 'foo' ---- with &1 ├── columns: x:7(string!null) y:8(int!null) z:9(float!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=3.33333333, distinct(7)=3.33333333, null(7)=0] ├── key: (7) ├── fd: ()-->(9), (7)-->(8) ├── delete xyz │ ├── columns: xyz.x:1(string!null) xyz.y:2(int!null) xyz.z:3(float!null) │ ├── fetch columns: xyz.x:4(string) xyz.y:5(int) xyz.z:6(float) - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── stats: [rows=10] │ ├── key: (1) │ ├── fd: ()-->(3), (1)-->(2) @@ -88,7 +88,7 @@ delete xyz ├── columns: x:1(string!null) y:2(int!null) z:3(float) ├── fetch columns: x:4(string) y:5(int) z:6(float) ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] ├── key: (1) ├── fd: (1)-->(2,3) diff --git a/pkg/sql/opt/memo/testdata/stats/insert b/pkg/sql/opt/memo/testdata/stats/insert index 9d418f09cefe..bc8eef66e861 100644 --- a/pkg/sql/opt/memo/testdata/stats/insert +++ b/pkg/sql/opt/memo/testdata/stats/insert @@ -40,7 +40,7 @@ WHERE z > 1.0 ---- with &1 ├── columns: x:8(string!null) y:9(int!null) z:10(float!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=69.4736842, distinct(10)=6.66666667, null(10)=0] ├── fd: ()-->(8) ├── insert xyz @@ -49,7 +49,7 @@ with &1 │ │ ├── b:5 => xyz.x:1 │ │ ├── a:4 => xyz.y:2 │ │ └── c:6 => xyz.z:3 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── stats: [rows=200] │ ├── fd: ()-->(1) │ └── project @@ -97,7 +97,7 @@ insert xyz │ ├── a:4 => y:2 │ └── c:6 => z:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] └── project ├── columns: a:4(int!null) b:5(string) c:6(float) diff --git a/pkg/sql/opt/memo/testdata/stats/limit b/pkg/sql/opt/memo/testdata/stats/limit index 053a08394e13..c48fdc6c742d 100644 --- a/pkg/sql/opt/memo/testdata/stats/limit +++ b/pkg/sql/opt/memo/testdata/stats/limit @@ -61,7 +61,7 @@ SELECT * FROM a WHERE s = 'foo' LIMIT (SELECT 5 AS c) ---- limit ├── columns: x:1(int!null) y:2(int) s:3(string!null) d:4(decimal!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=200] ├── key: (1) ├── fd: ()-->(3), (1)-->(2,4), (4)-->(1,2) diff --git a/pkg/sql/opt/memo/testdata/stats/srfs b/pkg/sql/opt/memo/testdata/stats/srfs index 2ea65df8fdae..2e54b6c909b5 100644 --- a/pkg/sql/opt/memo/testdata/stats/srfs +++ b/pkg/sql/opt/memo/testdata/stats/srfs @@ -9,15 +9,15 @@ JOIN generate_series(1, 4) c ON true ---- inner-join (cross) ├── columns: a:1(string) upper:2(string) generate_series:3(int) upper:4(string) c:5(int) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=100, distinct(1)=1, null(1)=0, distinct(2)=1, null(2)=90, distinct(3)=7, null(3)=1, distinct(4)=1, null(4)=90, distinct(5)=7, null(5)=1] ├── inner-join (cross) │ ├── columns: upper:1(string) upper:2(string) generate_series:3(int) upper:4(string) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10, distinct(1)=1, null(1)=0, distinct(2)=1, null(2)=9, distinct(3)=7, null(3)=0.1, distinct(4)=1, null(4)=9] │ ├── project-set │ │ ├── columns: upper:2(string) generate_series:3(int) upper:4(string) - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── stats: [rows=10, distinct(2)=1, null(2)=9, distinct(3)=7, null(3)=0.1, distinct(4)=1, null(4)=9] │ │ ├── values │ │ │ ├── cardinality: [1 - 1] @@ -26,7 +26,7 @@ inner-join (cross) │ │ │ └── () [type=tuple] │ │ └── zip │ │ ├── 'DEF' [type=string] - │ │ ├── generate_series(1, 3) [type=int, immutable, side-effects] + │ │ ├── generate_series(1, 3) [type=int, immutable] │ │ └── 'GHI' [type=string] │ ├── project-set │ │ ├── columns: upper:1(string) @@ -41,7 +41,7 @@ inner-join (cross) │ └── filters (true) ├── project-set │ ├── columns: generate_series:5(int) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10, distinct(5)=7, null(5)=0.1] │ ├── values │ │ ├── cardinality: [1 - 1] @@ -49,7 +49,7 @@ inner-join (cross) │ │ ├── key: () │ │ └── () [type=tuple] │ └── zip - │ └── generate_series(1, 4) [type=int, immutable, side-effects] + │ └── generate_series(1, 4) [type=int, immutable] └── filters (true) opt @@ -58,16 +58,16 @@ SELECT * FROM (SELECT * FROM upper('abc') a, generate_series(1, 2) b) GROUP BY a distinct-on ├── columns: a:1(string) b:2(int) ├── grouping columns: upper:1(string) generate_series:2(int) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=7, distinct(1,2)=7, null(1,2)=0] ├── key: (1,2) └── inner-join (cross) ├── columns: upper:1(string) generate_series:2(int) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=10, distinct(1,2)=7, null(1,2)=0] ├── project-set │ ├── columns: generate_series:2(int) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10, distinct(2)=7, null(2)=0.1] │ ├── values │ │ ├── cardinality: [1 - 1] @@ -75,7 +75,7 @@ distinct-on │ │ ├── key: () │ │ └── () [type=tuple] │ └── zip - │ └── generate_series(1, 2) [type=int, immutable, side-effects] + │ └── generate_series(1, 2) [type=int, immutable] ├── project-set │ ├── columns: upper:1(string) │ ├── stats: [rows=1, distinct(1)=1, null(1)=0] @@ -117,7 +117,7 @@ SELECT xy.*, generate_series(x, y), generate_series(0, 1) FROM xy ---- project-set ├── columns: x:1(int!null) y:2(int) generate_series:3(int) generate_series:4(int) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=10000, distinct(3)=700, null(3)=100, distinct(4)=7, null(4)=100, distinct(1,3)=10000, null(1,3)=0, distinct(2,4)=700, null(2,4)=1, distinct(3,4)=4900, null(3,4)=1] ├── fd: (1)-->(2) ├── scan xy @@ -126,8 +126,8 @@ project-set │ ├── key: (1) │ └── fd: (1)-->(2) └── zip - ├── generate_series(x:1, y:2) [type=int, outer=(1,2), immutable, side-effects] - └── generate_series(0, 1) [type=int, immutable, side-effects] + ├── generate_series(x:1, y:2) [type=int, outer=(1,2), immutable] + └── generate_series(0, 1) [type=int, immutable] exec-ddl CREATE TABLE articles ( @@ -161,17 +161,17 @@ SELECT id FROM articles WHERE title = ANY( distinct-on ├── columns: id:1(int!null) ├── grouping columns: id:1(int!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=9.85601173, distinct(1)=9.85601173, null(1)=0] ├── key: (1) └── select ├── columns: id:1(int!null) title:4(string!null) tag_list:6(string[]) upper:10(string!null) unnest:11(string) generate_series:12(int) lower:13(string) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=9.9, distinct(1)=9.85601173, null(1)=0, distinct(4)=9.9, null(4)=0, distinct(10)=9.9, null(10)=0] ├── fd: (1)-->(4,6), (4)==(10), (10)==(4) ├── project-set │ ├── columns: id:1(int!null) title:4(string) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int) lower:13(string) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10000, distinct(1)=1000, null(1)=0, distinct(4)=100, null(4)=100, distinct(10)=100, null(10)=9000] │ ├── fd: (1)-->(4,6) │ ├── scan articles @@ -181,8 +181,8 @@ distinct-on │ │ └── fd: (1)-->(4,6) │ └── zip │ ├── upper(title:4) [type=string, outer=(4), immutable] - │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable, side-effects] - │ ├── generate_series(0, 1) [type=int, immutable, side-effects] + │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable] + │ ├── generate_series(0, 1) [type=int, immutable] │ └── 'abc' [type=string] └── filters └── title:4 = upper:10 [type=bool, outer=(4,10), constraints=(/4: (/NULL - ]; /10: (/NULL - ]), fd=(4)==(10), (10)==(4)] @@ -195,17 +195,17 @@ SELECT id FROM articles WHERE title = ANY( distinct-on ├── columns: id:1(int!null) ├── grouping columns: id:1(int!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=13.9135391, distinct(1)=13.9135391, null(1)=0] ├── key: (1) └── select ├── columns: id:1(int!null) title:4(string!null) tag_list:6(string[]) upper:10(string) unnest:11(string!null) generate_series:12(int) lower:13(string) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=14.0014286, distinct(1)=13.9135391, null(1)=0, distinct(4)=14.0014286, null(4)=0, distinct(11)=14.0014286, null(11)=0] ├── fd: (1)-->(4,6), (4)==(11), (11)==(4) ├── project-set │ ├── columns: id:1(int!null) title:4(string) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int) lower:13(string) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10000, distinct(1)=1000, null(1)=0, distinct(4)=100, null(4)=100, distinct(11)=700, null(11)=100] │ ├── fd: (1)-->(4,6) │ ├── scan articles @@ -215,8 +215,8 @@ distinct-on │ │ └── fd: (1)-->(4,6) │ └── zip │ ├── upper(title:4) [type=string, outer=(4), immutable] - │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable, side-effects] - │ ├── generate_series(0, 1) [type=int, immutable, side-effects] + │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable] + │ ├── generate_series(0, 1) [type=int, immutable] │ └── 'abc' [type=string] └── filters └── title:4 = unnest:11 [type=bool, outer=(4,11), constraints=(/4: (/NULL - ]; /11: (/NULL - ]), fd=(4)==(11), (11)==(4)] @@ -229,17 +229,17 @@ SELECT id FROM articles WHERE id = ANY( distinct-on ├── columns: id:1(int!null) ├── grouping columns: id:1(int!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=6, distinct(1)=6, null(1)=0] ├── key: (1) └── select ├── columns: id:1(int!null) title:4(string) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int!null) lower:13(string) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=9.9, distinct(1)=6, null(1)=0, distinct(12)=6, null(12)=0] ├── fd: (1)-->(4,6), (1)==(12), (12)==(1) ├── project-set │ ├── columns: id:1(int!null) title:4(string) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int) lower:13(string) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10000, distinct(1)=1000, null(1)=0, distinct(12)=7, null(12)=100] │ ├── fd: (1)-->(4,6) │ ├── scan articles @@ -249,8 +249,8 @@ distinct-on │ │ └── fd: (1)-->(4,6) │ └── zip │ ├── upper(title:4) [type=string, outer=(4), immutable] - │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable, side-effects] - │ ├── generate_series(0, 1) [type=int, immutable, side-effects] + │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable] + │ ├── generate_series(0, 1) [type=int, immutable] │ └── 'abc' [type=string] └── filters └── id:1 = generate_series:12 [type=bool, outer=(1,12), constraints=(/1: (/NULL - ]; /12: (/NULL - ]), fd=(1)==(12), (12)==(1)] @@ -263,17 +263,17 @@ SELECT id FROM articles WHERE title = ANY( distinct-on ├── columns: id:1(int!null) ├── grouping columns: id:1(int!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=9.85601173, distinct(1)=9.85601173, null(1)=0] ├── key: (1) └── select ├── columns: id:1(int!null) title:4(string!null) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int) lower:13(string!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=9.9, distinct(1)=9.85601173, null(1)=0, distinct(4)=1e-10, null(4)=0, distinct(13)=1e-10, null(13)=0] ├── fd: (1)-->(4,6), (4)==(13), (13)==(4) ├── project-set │ ├── columns: id:1(int!null) title:4(string) tag_list:6(string[]) upper:10(string) unnest:11(string) generate_series:12(int) lower:13(string) - │ ├── immutable, side-effects + │ ├── immutable │ ├── stats: [rows=10000, distinct(1)=1000, null(1)=0, distinct(4)=100, null(4)=100, distinct(13)=1, null(13)=9000] │ ├── fd: (1)-->(4,6) │ ├── scan articles @@ -283,8 +283,8 @@ distinct-on │ │ └── fd: (1)-->(4,6) │ └── zip │ ├── upper(title:4) [type=string, outer=(4), immutable] - │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable, side-effects] - │ ├── generate_series(0, 1) [type=int, immutable, side-effects] + │ ├── unnest(tag_list:6) [type=string, outer=(6), immutable] + │ ├── generate_series(0, 1) [type=int, immutable] │ └── 'abc' [type=string] └── filters └── title:4 = lower:13 [type=bool, outer=(4,13), constraints=(/4: (/NULL - ]; /13: (/NULL - ]), fd=(4)==(13), (13)==(4)] diff --git a/pkg/sql/opt/memo/testdata/stats/update b/pkg/sql/opt/memo/testdata/stats/update index 0278a2c34b66..917e941b4e29 100644 --- a/pkg/sql/opt/memo/testdata/stats/update +++ b/pkg/sql/opt/memo/testdata/stats/update @@ -40,7 +40,7 @@ WHERE x > 'foo' ---- with &1 ├── columns: x:8(string!null) y:9(int!null) z:10(float!null) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=3.33333333, distinct(8)=3.33333333, null(8)=0] ├── key: (8) ├── fd: ()-->(9,10) @@ -49,7 +49,7 @@ with &1 │ ├── fetch columns: xyz.x:4(string) xyz.y:5(int) xyz.z:6(float) │ ├── update-mapping: │ │ └── y_new:7 => xyz.y:2 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── stats: [rows=10] │ ├── key: (1) │ ├── fd: ()-->(2,3) @@ -99,7 +99,7 @@ update xyz ├── update-mapping: │ └── x_new:7 => x:1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] ├── fd: ()-->(1) └── project diff --git a/pkg/sql/opt/memo/testdata/stats/upsert b/pkg/sql/opt/memo/testdata/stats/upsert index 2ec621611c75..6bd0f194f731 100644 --- a/pkg/sql/opt/memo/testdata/stats/upsert +++ b/pkg/sql/opt/memo/testdata/stats/upsert @@ -90,7 +90,7 @@ WHERE y=10 ---- with &1 ├── columns: x:16(string!null) y:17(int!null) z:18(float) - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=9.94974874, distinct(17)=0.994974874, null(17)=0] ├── fd: ()-->(17) ├── upsert xyz @@ -107,7 +107,7 @@ with &1 │ │ ├── upsert_x:13 => xyz.x:1 │ │ ├── upsert_y:14 => xyz.y:2 │ │ └── upsert_z:15 => xyz.z:3 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── stats: [rows=9.94974874] │ └── project │ ├── columns: upsert_x:13(string) upsert_y:14(int!null) upsert_z:15(float) a:4(int!null) b:5(string) column8:8(float) xyz.x:9(string) xyz.y:10(int) xyz.z:11(float) y_new:12(int!null) @@ -204,7 +204,7 @@ upsert xyz │ ├── a:4 => y:2 │ └── column8:8 => z:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] ├── fd: ()-->(3) └── project @@ -253,24 +253,24 @@ upsert uv ├── update-mapping: │ └── upsert_v:12 => v:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] └── project ├── columns: upsert_u:11(int) upsert_v:12(int) z:6(int) column7:7(int) u:8(int) v:9(int) v_new:10(int!null) - ├── volatile, side-effects + ├── volatile ├── stats: [rows=1000] ├── lax-key: (6,8) ├── fd: ()-->(10), (6)~~>(7), (8)-->(9), (9)~~>(8), (7,8)-->(11), (6,8)-->(12), (6,8)~~>(7,11) ├── project │ ├── columns: v_new:10(int!null) z:6(int) column7:7(int) u:8(int) v:9(int) - │ ├── volatile, side-effects + │ ├── volatile │ ├── stats: [rows=1000] │ ├── lax-key: (6,8) │ ├── fd: ()-->(10), (6)~~>(7), (8)-->(9), (9)~~>(8) │ ├── left-join (hash) │ │ ├── columns: z:6(int) column7:7(int) u:8(int) v:9(int) │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── stats: [rows=1000, distinct(9)=991, null(9)=0] │ │ ├── lax-key: (6,8) │ │ ├── fd: (6)~~>(7), (8)-->(9), (9)~~>(8) @@ -278,13 +278,13 @@ upsert uv │ │ │ ├── columns: z:6(int) column7:7(int) │ │ │ ├── grouping columns: z:6(int) │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── stats: [rows=1000, distinct(6)=1000, null(6)=0] │ │ │ ├── lax-key: (6) │ │ │ ├── fd: (6)~~>(7) │ │ │ ├── project │ │ │ │ ├── columns: column7:7(int) z:6(int) - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── stats: [rows=1000, distinct(6)=100, null(6)=0] │ │ │ │ ├── project │ │ │ │ │ ├── columns: z:6(int) @@ -298,7 +298,7 @@ upsert uv │ │ │ │ │ └── projections │ │ │ │ │ └── xyz.z:5::INT8 [as=z:6, type=int, outer=(5), immutable] │ │ │ │ └── projections - │ │ │ │ └── unique_rowid() [as=column7:7, type=int, volatile, side-effects] + │ │ │ │ └── unique_rowid() [as=column7:7, type=int, volatile] │ │ │ └── aggregations │ │ │ └── first-agg [as=column7:7, type=int, outer=(7)] │ │ │ └── column7:7 [type=int] @@ -337,7 +337,7 @@ upsert mno ├── update-mapping: │ └── upsert_o:13 => o:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=0] └── project ├── columns: upsert_m:11(int) upsert_n:12(int) upsert_o:13(int) m:4(int!null) n:5(int) o:6(int) m:7(int) n:8(int) o:9(int) o_new:10(int!null) diff --git a/pkg/sql/opt/memo/testdata/stats/values b/pkg/sql/opt/memo/testdata/stats/values index fe8ffff7417b..eb192b533f35 100644 --- a/pkg/sql/opt/memo/testdata/stats/values +++ b/pkg/sql/opt/memo/testdata/stats/values @@ -27,13 +27,13 @@ distinct-on ├── columns: x:1(int) y:2(int!null) ├── grouping columns: column1:1(int) column2:2(int!null) ├── cardinality: [1 - 5] - ├── volatile, side-effects + ├── volatile ├── stats: [rows=4, distinct(1,2)=4, null(1,2)=0] ├── key: (1,2) └── values ├── columns: column1:1(int) column2:2(int!null) ├── cardinality: [5 - 5] - ├── volatile, side-effects + ├── volatile ├── stats: [rows=5, distinct(1,2)=4, null(1,2)=0] ├── (1, 2) [type=tuple{int, int}] ├── (1, 2) [type=tuple{int, int}] diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 index 2ee5876f4ba9..171e47fe058f 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q08 @@ -62,7 +62,7 @@ ORDER BY sort ├── save-table-name: q8_sort_1 ├── columns: o_year:61(float) mkt_share:66(float!null) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=728.968264, distinct(61)=728.968264, null(61)=0, distinct(66)=728.968264, null(66)=0] ├── key: (61) ├── fd: (61)-->(66) @@ -70,7 +70,7 @@ sort └── project ├── save-table-name: q8_project_2 ├── columns: mkt_share:66(float!null) o_year:61(float) - ├── immutable, side-effects + ├── immutable ├── stats: [rows=728.968264, distinct(61)=728.968264, null(61)=0, distinct(66)=728.968264, null(66)=0] ├── key: (61) ├── fd: (61)-->(66) @@ -245,7 +245,7 @@ sort │ └── sum [as=sum:65, type=float, outer=(62)] │ └── volume:62 [type=float] └── projections - └── sum:64 / sum:65 [as=mkt_share:66, type=float, outer=(64,65), immutable, side-effects] + └── sum:64 / sum:65 [as=mkt_share:66, type=float, outer=(64,65), immutable] stats table=q8_sort_1 diff --git a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q14 b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q14 index d7ed576ff4c6..560d0d8c28be 100644 --- a/pkg/sql/opt/memo/testdata/stats_quality/tpch/q14 +++ b/pkg/sql/opt/memo/testdata/stats_quality/tpch/q14 @@ -34,7 +34,7 @@ project ├── save-table-name: q14_project_1 ├── columns: promo_revenue:30(float) ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── stats: [rows=1, distinct(30)=1, null(30)=0] ├── key: () ├── fd: ()-->(30) @@ -93,7 +93,7 @@ project │ └── sum [as=sum:29, type=float, outer=(28)] │ └── column28:28 [type=float] └── projections - └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, type=float, outer=(27,29), immutable, side-effects] + └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, type=float, outer=(27,29), immutable] stats table=q14_project_1 ---- diff --git a/pkg/sql/opt/norm/testdata/rules/comp b/pkg/sql/opt/norm/testdata/rules/comp index 1f3276a540f4..4aec87105324 100644 --- a/pkg/sql/opt/norm/testdata/rules/comp +++ b/pkg/sql/opt/norm/testdata/rules/comp @@ -69,7 +69,7 @@ SELECT * FROM a WHERE random()::int>a.i+a.i ---- select ├── columns: k:1!null i:2 f:3 s:4 j:5 d:6 - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-6) ├── scan a @@ -77,7 +77,7 @@ select │ ├── key: (1) │ └── fd: (1)-->(2-6) └── filters - └── random()::INT8 > (i:2 + i:2) [outer=(2), volatile, side-effects] + └── random()::INT8 > (i:2 + i:2) [outer=(2), volatile] # -------------------------------------------------- # NormalizeCmpPlusConst diff --git a/pkg/sql/opt/norm/testdata/rules/decorrelate b/pkg/sql/opt/norm/testdata/rules/decorrelate index e548e580083b..358653561a59 100644 --- a/pkg/sql/opt/norm/testdata/rules/decorrelate +++ b/pkg/sql/opt/norm/testdata/rules/decorrelate @@ -66,7 +66,7 @@ update xy │ ├── u:5 => x:1 │ └── v:6 => y:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── left-join (hash) ├── columns: x:3!null y:4 u:5 v:6 ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) @@ -103,7 +103,7 @@ upsert xy │ ├── upsert_x:9 => x:1 │ └── upsert_y:10 => y:2 ├── cardinality: [2 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_x:9 upsert_y:10 column1:3!null column2:4!null x:5 y:6 ├── cardinality: [2 - 2] @@ -147,7 +147,7 @@ delete xy ├── columns: ├── fetch columns: x:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── semi-join (hash) ├── columns: x:3!null ├── key: (3) @@ -169,17 +169,17 @@ SELECT generate_series(0, 5) FROM xy ---- inner-join (cross) ├── columns: generate_series:3 - ├── immutable, side-effects + ├── immutable ├── scan xy ├── project-set │ ├── columns: generate_series:3 - │ ├── immutable, side-effects + │ ├── immutable │ ├── values │ │ ├── cardinality: [1 - 1] │ │ ├── key: () │ │ └── () │ └── zip - │ └── generate_series(0, 5) [immutable, side-effects] + │ └── generate_series(0, 5) [immutable] └── filters (true) norm expect=DecorrelateProjectSet @@ -187,7 +187,7 @@ SELECT * FROM a WHERE i IN (SELECT generate_series(k, i) FROM xy) ---- semi-join-apply ├── columns: k:1!null i:2!null f:3 s:4 j:5 - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-5) ├── scan a @@ -197,18 +197,18 @@ semi-join-apply ├── inner-join (cross) │ ├── columns: generate_series:8 │ ├── outer: (1,2) - │ ├── immutable, side-effects + │ ├── immutable │ ├── scan xy │ ├── project-set │ │ ├── columns: generate_series:8 │ │ ├── outer: (1,2) - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── values │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── () │ │ └── zip - │ │ └── generate_series(k:1, i:2) [outer=(1,2), immutable, side-effects] + │ │ └── generate_series(k:1, i:2) [outer=(1,2), immutable] │ └── filters (true) └── filters └── i:2 = generate_series:8 [outer=(2,8), constraints=(/2: (/NULL - ]; /8: (/NULL - ]), fd=(2)==(8), (8)==(2)] @@ -218,39 +218,39 @@ SELECT generate_series(0, (SELECT generate_series(1,0) FROM xy)) FROM uv ---- inner-join (cross) ├── columns: generate_series:6 - ├── immutable, side-effects + ├── immutable ├── scan uv ├── project-set │ ├── columns: generate_series:6 - │ ├── immutable, side-effects + │ ├── immutable │ ├── values │ │ ├── cardinality: [1 - 1] │ │ ├── key: () │ │ └── () │ └── zip - │ └── function: generate_series [immutable, side-effects, subquery] + │ └── function: generate_series [immutable, subquery] │ ├── 0 │ └── subquery │ └── max1-row │ ├── columns: generate_series:5 │ ├── error: "more than one row returned by a subquery used as an expression" │ ├── cardinality: [0 - 1] - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: () │ ├── fd: ()-->(5) │ └── inner-join (cross) │ ├── columns: generate_series:5 - │ ├── immutable, side-effects + │ ├── immutable │ ├── scan xy │ ├── project-set │ │ ├── columns: generate_series:5 - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── values │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── () │ │ └── zip - │ │ └── generate_series(1, 0) [immutable, side-effects] + │ │ └── generate_series(1, 0) [immutable] │ └── filters (true) └── filters (true) @@ -2821,20 +2821,20 @@ SELECT * FROM xy WHERE EXISTS(SELECT generate_series(x, 10), generate_series(y, group-by ├── columns: x:1!null y:2 ├── grouping columns: x:1!null - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2) ├── project-set │ ├── columns: x:1!null y:2 generate_series:3 generate_series:4 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: (1)-->(2) │ ├── scan xy │ │ ├── columns: x:1!null y:2 │ │ ├── key: (1) │ │ └── fd: (1)-->(2) │ └── zip - │ ├── generate_series(x:1, 10) [outer=(1), immutable, side-effects] - │ └── generate_series(y:2, 10) [outer=(2), immutable, side-effects] + │ ├── generate_series(x:1, 10) [outer=(1), immutable] + │ └── generate_series(y:2, 10) [outer=(2), immutable] └── aggregations └── const-agg [as=y:2, outer=(2)] └── y:2 @@ -4876,10 +4876,10 @@ SELECT generate_series(1, (SELECT v FROM uv WHERE u=x)) FROM xy ---- project ├── columns: generate_series:5 - ├── immutable, side-effects + ├── immutable └── project-set ├── columns: v:4 generate_series:5 - ├── immutable, side-effects + ├── immutable ├── project │ ├── columns: v:4 │ └── left-join (hash) @@ -4897,7 +4897,7 @@ project │ └── filters │ └── u:3 = x:1 [outer=(1,3), constraints=(/1: (/NULL - ]; /3: (/NULL - ]), fd=(1)==(3), (3)==(1)] └── zip - └── generate_series(1, v:4) [outer=(4), immutable, side-effects] + └── generate_series(1, v:4) [outer=(4), immutable] # Zip correlation within EXISTS. norm expect=(HoistProjectSetSubquery,TryDecorrelateSemiJoin,TryDecorrelateProjectSet) @@ -4906,12 +4906,12 @@ SELECT * FROM xy WHERE EXISTS(SELECT * FROM generate_series(1, (SELECT v FROM uv group-by ├── columns: x:1!null y:2 ├── grouping columns: x:1!null - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2) ├── project-set │ ├── columns: x:1!null y:2 v:4 generate_series:5 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: (1)-->(2,4) │ ├── project │ │ ├── columns: x:1!null y:2 v:4 @@ -4933,7 +4933,7 @@ group-by │ │ └── filters │ │ └── u:3 = x:1 [outer=(1,3), constraints=(/1: (/NULL - ]; /3: (/NULL - ]), fd=(1)==(3), (3)==(1)] │ └── zip - │ └── generate_series(1, v:4) [outer=(4), immutable, side-effects] + │ └── generate_series(1, v:4) [outer=(4), immutable] └── aggregations └── const-agg [as=y:2, outer=(2)] └── y:2 @@ -4944,10 +4944,10 @@ SELECT generate_series((select y FROM xy WHERE x=k), (SELECT v FROM uv WHERE u=k ---- project ├── columns: generate_series:10 - ├── immutable, side-effects + ├── immutable └── project-set ├── columns: y:7 v:9 generate_series:10 - ├── immutable, side-effects + ├── immutable ├── project │ ├── columns: y:7 v:9 │ └── left-join (hash) @@ -4976,7 +4976,7 @@ project │ └── filters │ └── u:8 = k:1 [outer=(1,8), constraints=(/1: (/NULL - ]; /8: (/NULL - ]), fd=(1)==(8), (8)==(1)] └── zip - └── generate_series(y:7, v:9) [outer=(7,9), immutable, side-effects] + └── generate_series(y:7, v:9) [outer=(7,9), immutable] # Multiple functions. norm expect=HoistProjectSetSubquery @@ -4987,10 +4987,10 @@ FROM a ---- project ├── columns: generate_series:8 information_schema._pg_expandarray:13 - ├── immutable, side-effects + ├── immutable ├── project-set │ ├── columns: v:7 generate_series:8 xy.x:9 x:11 n:12 - │ ├── immutable, side-effects + │ ├── immutable │ ├── project │ │ ├── columns: v:7 xy.x:9 │ │ └── left-join (hash) @@ -5018,8 +5018,8 @@ project │ │ └── filters │ │ └── xy.x:9 = k:1 [outer=(1,9), constraints=(/1: (/NULL - ]; /9: (/NULL - ]), fd=(1)==(9), (9)==(1)] │ └── zip - │ ├── generate_series(1, v:7) [outer=(7), immutable, side-effects] - │ └── information_schema._pg_expandarray(ARRAY[xy.x:9]) [outer=(9), immutable, side-effects] + │ ├── generate_series(1, v:7) [outer=(7), immutable] + │ └── information_schema._pg_expandarray(ARRAY[xy.x:9]) [outer=(9), immutable] └── projections └── ((x:11, n:12) AS x, n) [as=information_schema._pg_expandarray:13, outer=(11,12)] @@ -5028,11 +5028,11 @@ SELECT a, generate_series(1, (SELECT a)) FROM (VALUES (1)) AS v (a) ---- project ├── columns: a:1!null generate_series:3 - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1) └── project-set ├── columns: column1:1!null a:2 generate_series:3 - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1,2) ├── inner-join-apply │ ├── columns: column1:1!null a:2 @@ -5054,18 +5054,18 @@ project │ │ └── (column1:1,) │ └── filters (true) └── zip - └── generate_series(1, a:2) [outer=(2), immutable, side-effects] + └── generate_series(1, a:2) [outer=(2), immutable] norm expect=HoistProjectSetSubquery SELECT a, generate_series(1, (SELECT a)), generate_series(1, (SELECT a)) FROM (VALUES (1)) AS v (a) ---- project ├── columns: a:1!null generate_series:3 generate_series:5 - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1) └── project-set ├── columns: column1:1!null a:2 generate_series:3 a:4 generate_series:5 - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1,2,4) ├── inner-join-apply │ ├── columns: column1:1!null a:2 a:4 @@ -5100,8 +5100,8 @@ project │ │ └── (column1:1,) │ └── filters (true) └── zip - ├── generate_series(1, a:2) [outer=(2), immutable, side-effects] - └── generate_series(1, a:4) [outer=(4), immutable, side-effects] + ├── generate_series(1, a:2) [outer=(2), immutable] + └── generate_series(1, a:4) [outer=(4), immutable] exec-ddl CREATE TABLE articles ( @@ -5130,13 +5130,13 @@ limit ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 ├── internal-ordering: +8 ├── cardinality: [0 - 10] - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-9) ├── ordering: +8 ├── sort │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: (1) │ ├── fd: (1)-->(2-9) │ ├── ordering: +8 @@ -5144,23 +5144,23 @@ limit │ └── group-by │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 │ ├── grouping columns: id:1!null - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: (1) │ ├── fd: (1)-->(2-9) │ ├── select │ │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 unnest:10!null - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── fd: ()-->(10), (1)-->(2-9) │ │ ├── project-set │ │ │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 unnest:10 - │ │ │ ├── immutable, side-effects + │ │ │ ├── immutable │ │ │ ├── fd: (1)-->(2-9) │ │ │ ├── scan a0 │ │ │ │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 │ │ │ │ ├── key: (1) │ │ │ │ └── fd: (1)-->(2-9) │ │ │ └── zip - │ │ │ └── unnest(tag_list:6) [outer=(6), immutable, side-effects] + │ │ │ └── unnest(tag_list:6) [outer=(6), immutable] │ │ └── filters │ │ └── unnest:10 = 'dragons' [outer=(10), constraints=(/10: [/'dragons' - /'dragons']; tight), fd=()-->(10)] │ └── aggregations @@ -5190,23 +5190,23 @@ SELECT * FROM articles, xy WHERE EXISTS( ---- project ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 x:10!null y:11 - ├── immutable, side-effects + ├── immutable ├── key: (1,10) ├── fd: (1)-->(2-9), (1,10)-->(2-9,11) └── select ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 x:10!null y:11 true_agg:17!null - ├── immutable, side-effects + ├── immutable ├── key: (1,10) ├── fd: (1)-->(2-9), (1,10)-->(2-9,11,17) ├── group-by │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 x:10!null y:11 true_agg:17 │ ├── grouping columns: id:1!null x:10!null - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: (1,10) │ ├── fd: (1)-->(2-9), (1,10)-->(2-9,11,17) │ ├── inner-join-apply │ │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 x:10!null y:11 true:16 - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── fd: (1)-->(2-9), (1,10)-->(11) │ │ ├── scan articles │ │ │ ├── columns: id:1!null body:2 description:3 title:4 slug:5 tag_list:6 user_id:7 created_at:8 updated_at:9 @@ -5215,7 +5215,7 @@ project │ │ ├── left-join-apply │ │ │ ├── columns: x:10!null y:11 true:16 │ │ │ ├── outer: (1,4,6) - │ │ │ ├── immutable, side-effects + │ │ │ ├── immutable │ │ │ ├── fd: (10)-->(11) │ │ │ ├── scan xy │ │ │ │ ├── columns: x:10!null y:11 @@ -5224,21 +5224,21 @@ project │ │ │ ├── project │ │ │ │ ├── columns: true:16!null │ │ │ │ ├── outer: (1,4,6,10) - │ │ │ │ ├── immutable, side-effects + │ │ │ │ ├── immutable │ │ │ │ ├── fd: ()-->(16) │ │ │ │ ├── project-set │ │ │ │ │ ├── columns: generate_series:12 length:13 upper:14 unnest:15 │ │ │ │ │ ├── outer: (1,4,6,10) - │ │ │ │ │ ├── immutable, side-effects + │ │ │ │ │ ├── immutable │ │ │ │ │ ├── values │ │ │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ │ │ ├── key: () │ │ │ │ │ │ └── () │ │ │ │ │ └── zip - │ │ │ │ │ ├── generate_series(x:10, id:1) [outer=(1,10), immutable, side-effects] + │ │ │ │ │ ├── generate_series(x:10, id:1) [outer=(1,10), immutable] │ │ │ │ │ ├── length(title:4) [outer=(4), immutable] │ │ │ │ │ ├── upper(title:4) [outer=(4), immutable] - │ │ │ │ │ └── unnest(tag_list:6) [outer=(6), immutable, side-effects] + │ │ │ │ │ └── unnest(tag_list:6) [outer=(6), immutable] │ │ │ │ └── projections │ │ │ │ └── true [as=true:16] │ │ │ └── filters (true) @@ -5275,15 +5275,15 @@ SELECT id FROM articles WHERE title = ANY( distinct-on ├── columns: id:1!null ├── grouping columns: id:1!null - ├── immutable, side-effects + ├── immutable ├── key: (1) └── select ├── columns: id:1!null title:4!null tag_list:6 upper:10 unnest:11!null generate_series:12 lower:13 - ├── immutable, side-effects + ├── immutable ├── fd: (1)-->(4,6), (4)==(11), (11)==(4) ├── project-set │ ├── columns: id:1!null title:4 tag_list:6 upper:10 unnest:11 generate_series:12 lower:13 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: (1)-->(4,6) │ ├── scan articles │ │ ├── columns: id:1!null title:4 tag_list:6 @@ -5291,8 +5291,8 @@ distinct-on │ │ └── fd: (1)-->(4,6) │ └── zip │ ├── upper(title:4) [outer=(4), immutable] - │ ├── unnest(tag_list:6) [outer=(6), immutable, side-effects] - │ ├── generate_series(0, 1) [immutable, side-effects] + │ ├── unnest(tag_list:6) [outer=(6), immutable] + │ ├── generate_series(0, 1) [immutable] │ └── 'abc' └── filters └── title:4 = unnest:11 [outer=(4,11), constraints=(/4: (/NULL - ]; /11: (/NULL - ]), fd=(4)==(11), (11)==(4)] diff --git a/pkg/sql/opt/norm/testdata/rules/fold_constants b/pkg/sql/opt/norm/testdata/rules/fold_constants index ea1e5637bd8c..218cca6fa7d9 100644 --- a/pkg/sql/opt/norm/testdata/rules/fold_constants +++ b/pkg/sql/opt/norm/testdata/rules/fold_constants @@ -312,7 +312,7 @@ SELECT 1::INT / 0::INT values ├── columns: "?column?":1 ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(1) └── (1 / 0,) @@ -869,7 +869,7 @@ SELECT now(), current_user(), current_database() values ├── columns: now:1 current_user:2 current_database:3 ├── cardinality: [1 - 1] - ├── stable, side-effects + ├── stable ├── key: () ├── fd: ()-->(1-3) └── (now(), current_user(), current_database()) diff --git a/pkg/sql/opt/norm/testdata/rules/groupby b/pkg/sql/opt/norm/testdata/rules/groupby index 427a5f1c0d5b..c5cc77da950d 100644 --- a/pkg/sql/opt/norm/testdata/rules/groupby +++ b/pkg/sql/opt/norm/testdata/rules/groupby @@ -732,7 +732,7 @@ insert nullablecols │ ├── i:6 => c3:3 │ └── i:6 => rowid:4 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── upsert-distinct-on ├── columns: i:6!null ├── grouping columns: i:6!null @@ -795,7 +795,7 @@ upsert nullablecols ├── update-mapping: │ └── upsert_c3:22 => c3:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_c3:22!null i:6!null c1:15 c2:16 c3:17 rowid:18 ├── key: (6,18) @@ -1006,7 +1006,7 @@ insert xy │ ├── y:4 => x:1 │ └── column5:5 => y:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: y:4!null column5:5 ├── cardinality: [0 - 1] @@ -1063,7 +1063,7 @@ upsert xy ├── update-mapping: │ └── upsert_y:10 => y:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_y:10 y:4!null column5:5 x:6 y:7 ├── cardinality: [0 - 1] @@ -1114,7 +1114,7 @@ insert xy │ ├── y:4 => x:1 │ └── column5:5 => y:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── upsert-distinct-on ├── columns: y:4 column5:5 ├── grouping columns: y:4 @@ -1166,7 +1166,7 @@ upsert xy ├── update-mapping: │ └── upsert_y:10 => y:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_y:10 y:4 column5:5 x:6 y:7 ├── lax-key: (4,6) @@ -1223,7 +1223,7 @@ upsert abc ├── update-mapping: │ └── "?column?":7 => a:1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── left-join (hash) ├── columns: b:5!null "?column?":7!null "?column?":8!null a:9 b:10 c:11 ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) @@ -1273,7 +1273,7 @@ upsert abc ├── update-mapping: │ └── upsert_c:14 => c:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_c:14!null b:5!null c:6!null "?column?":7 a:8 b:9 c:10 ├── lax-key: (6-10) @@ -1738,7 +1738,7 @@ insert a │ ├── "?column?":12 => s:4 │ └── column14:14 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: i:7!null "?column?":11!null "?column?":12!null column13:13 column14:14 ├── cardinality: [0 - 1] @@ -1850,7 +1850,7 @@ upsert a ├── update-mapping: │ └── upsert_f:23 => f:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_f:23 i:7!null "?column?":11!null "?column?":12!null column13:13 column14:14 k:15 i:16 f:17 s:18 j:19 ├── cardinality: [0 - 1] @@ -2118,12 +2118,12 @@ distinct-on ├── columns: x:1 ├── grouping columns: column1:1 ├── cardinality: [1 - 2] - ├── volatile, side-effects + ├── volatile ├── key: (1) └── values ├── columns: column1:1 ├── cardinality: [2 - 2] - ├── volatile, side-effects + ├── volatile ├── (1,) └── (unique_rowid(),) @@ -2191,7 +2191,7 @@ insert a │ ├── column2:7 => s:4 │ └── column10:10 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column1:6!null column2:7 column3:8 column9:9 column10:10 ├── cardinality: [0 - 2] @@ -2244,7 +2244,7 @@ upsert a ├── update-mapping: │ └── upsert_f:19 => f:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_f:19 column1:6!null column2:7 column3:8 column9:9 column10:10 k:11 i:12 f:13 s:14 j:15 ├── cardinality: [2 - 2] @@ -2294,7 +2294,7 @@ upsert a ├── update-mapping: │ └── upsert_f:19 => f:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_f:19 column1:6!null column2:7!null column3:8!null column9:9 column10:10 k:11 i:12 f:13 s:14 j:15 ├── cardinality: [1 - 3] @@ -2357,7 +2357,7 @@ insert a │ ├── column2:7 => s:4 │ └── column10:10 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column1:6!null column2:7!null column3:8!null column4:9!null column10:10 ├── cardinality: [0 - 3] @@ -2440,7 +2440,7 @@ insert a │ ├── column2:7 => s:4 │ └── column10:10 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── upsert-distinct-on ├── columns: column1:6!null column2:7!null column3:8!null column9:9 column10:10 ├── grouping columns: column3:8!null column9:9 @@ -2549,65 +2549,65 @@ insert a │ ├── column2:7 => s:4 │ └── column10:10 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 ├── cardinality: [0 - 2] - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(10), (6)~~>(7-9) └── select ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 i:17 s:19 i:22 f:23 ├── cardinality: [0 - 2] - ├── volatile, side-effects + ├── volatile ├── lax-key: (6,17,19,22,23) ├── fd: ()-->(10,19,22), (6)~~>(7-9) ├── left-join (hash) │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 i:17 s:19 i:22 f:23 │ ├── cardinality: [0 - 2] │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ ├── volatile, side-effects + │ ├── volatile │ ├── lax-key: (6,17,19,22,23) │ ├── fd: ()-->(10,19), (6)~~>(7-9) │ ├── select │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 i:17 s:19 │ │ ├── cardinality: [0 - 2] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── lax-key: (6,17,19) │ │ ├── fd: ()-->(10,19), (6)~~>(7-9) │ │ ├── left-join (hash) │ │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 i:17 s:19 │ │ │ ├── cardinality: [0 - 2] │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── lax-key: (6,17,19) │ │ │ ├── fd: ()-->(10), (6)~~>(7-9) │ │ │ ├── upsert-distinct-on │ │ │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 │ │ │ │ ├── grouping columns: column1:6 │ │ │ │ ├── cardinality: [0 - 2] - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── lax-key: (6) │ │ │ │ ├── fd: ()-->(10), (6)~~>(7-10) │ │ │ │ ├── select │ │ │ │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 k:11 │ │ │ │ │ ├── cardinality: [0 - 2] - │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ ├── volatile │ │ │ │ │ ├── fd: ()-->(10,11) │ │ │ │ │ ├── left-join (hash) │ │ │ │ │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null column10:10 k:11 │ │ │ │ │ │ ├── cardinality: [2 - 2] │ │ │ │ │ │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more) - │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ ├── fd: ()-->(10) │ │ │ │ │ │ ├── project │ │ │ │ │ │ │ ├── columns: column10:10 column1:6 column2:7!null column3:8!null column4:9!null │ │ │ │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ ├── fd: ()-->(10) │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── columns: column1:6 column2:7!null column3:8!null column4:9!null │ │ │ │ │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ │ │ │ │ ├── volatile, side-effects + │ │ │ │ │ │ │ │ ├── volatile │ │ │ │ │ │ │ │ ├── (unique_rowid(), 'foo', 1, 1.0) │ │ │ │ │ │ │ │ └── (unique_rowid(), 'bar', 2, 2.0) │ │ │ │ │ │ │ └── projections @@ -2660,7 +2660,7 @@ insert a │ ├── "?column?":11 => s:4 │ └── column13:13 => j:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── upsert-distinct-on ├── columns: i:7!null "?column?":11!null column12:12 column13:13 ├── grouping columns: i:7!null diff --git a/pkg/sql/opt/norm/testdata/rules/inline b/pkg/sql/opt/norm/testdata/rules/inline index e8c3fdd91fd2..fa49b676bef3 100644 --- a/pkg/sql/opt/norm/testdata/rules/inline +++ b/pkg/sql/opt/norm/testdata/rules/inline @@ -172,7 +172,7 @@ update computed │ ├── b_new:8 => b:2 │ └── column9:9 => c:3 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: column9:9!null a_new:7!null b_new:8!null a:4!null b:5 c:6 ├── key: (4) diff --git a/pkg/sql/opt/norm/testdata/rules/join b/pkg/sql/opt/norm/testdata/rules/join index df5f9cbac094..c3368e10e14b 100644 --- a/pkg/sql/opt/norm/testdata/rules/join +++ b/pkg/sql/opt/norm/testdata/rules/join @@ -926,17 +926,17 @@ SELECT * FROM t1, t2 WHERE a = b AND age(b, TIMESTAMPTZ '2017-01-01') > INTERVAL ---- inner-join (cross) ├── columns: a:1!null b:3!null - ├── stable, side-effects + ├── stable ├── fd: (1)==(3), (3)==(1) ├── scan t1 │ └── columns: a:1 ├── select │ ├── columns: b:3 - │ ├── immutable, side-effects + │ ├── immutable │ ├── scan t2 │ │ └── columns: b:3 │ └── filters - │ └── age(b:3, '2017-01-01 00:00:00+00:00') > '1 day' [outer=(3), immutable, side-effects] + │ └── age(b:3, '2017-01-01 00:00:00+00:00') > '1 day' [outer=(3), immutable] └── filters └── a:1 = b:3 [outer=(1,3), stable, constraints=(/1: (/NULL - ]; /3: (/NULL - ]), fd=(1)==(3), (3)==(1)] @@ -2350,19 +2350,19 @@ SELECT * FROM xy WHERE EXISTS(SELECT generate_series(x, 10)) group-by ├── columns: x:1!null y:2 ├── grouping columns: x:1!null - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2) ├── project-set │ ├── columns: x:1!null y:2 generate_series:3 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: (1)-->(2) │ ├── scan xy │ │ ├── columns: x:1!null y:2 │ │ ├── key: (1) │ │ └── fd: (1)-->(2) │ └── zip - │ └── generate_series(x:1, 10) [outer=(1), immutable, side-effects] + │ └── generate_series(x:1, 10) [outer=(1), immutable] └── aggregations └── const-agg [as=y:2, outer=(2)] └── y:2 diff --git a/pkg/sql/opt/norm/testdata/rules/limit b/pkg/sql/opt/norm/testdata/rules/limit index a73c0a6b5804..91494c110234 100644 --- a/pkg/sql/opt/norm/testdata/rules/limit +++ b/pkg/sql/opt/norm/testdata/rules/limit @@ -97,7 +97,7 @@ SELECT * FROM (SELECT * FROM a LIMIT 0) LIMIT -1 limit ├── columns: k:1!null i:2!null f:3!null s:4!null j:5!null ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(1-5) ├── values @@ -280,7 +280,7 @@ SELECT * FROM a LIMIT -1 limit ├── columns: k:1!null i:2 f:3 s:4 j:5 ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(1-5) ├── scan a @@ -1095,7 +1095,7 @@ SELECT * FROM ab LEFT JOIN uv ON a = u LIMIT -1 limit ├── columns: a:1!null b:2 u:3 v:4 ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(1-4) ├── left-join (hash) diff --git a/pkg/sql/opt/norm/testdata/rules/project_set b/pkg/sql/opt/norm/testdata/rules/project_set index 970727a0c8d7..d4c65e5956ed 100644 --- a/pkg/sql/opt/norm/testdata/rules/project_set +++ b/pkg/sql/opt/norm/testdata/rules/project_set @@ -218,10 +218,10 @@ SELECT unnest(x) FROM unnest(ARRAY[[1,2,3],[4,5],[6]]) AS x ---- project ├── columns: unnest:2 - ├── immutable, side-effects + ├── immutable └── project-set ├── columns: unnest:1!null unnest:2 - ├── immutable, side-effects + ├── immutable ├── values │ ├── columns: unnest:1!null │ ├── cardinality: [3 - 3] @@ -229,7 +229,7 @@ project │ ├── (ARRAY[4,5],) │ └── (ARRAY[6],) └── zip - └── unnest(unnest:1) [outer=(1), immutable, side-effects] + └── unnest(unnest:1) [outer=(1), immutable] # No-op case - an unnest with multiple inputs is not matched. norm expect-not=ConvertZipArraysToValues @@ -237,16 +237,16 @@ SELECT unnest(ARRAY[1,2,3], ARRAY[4,5,6]) ---- project ├── columns: unnest:3 - ├── immutable, side-effects + ├── immutable ├── project-set │ ├── columns: unnest:1 unnest:2 - │ ├── immutable, side-effects + │ ├── immutable │ ├── values │ │ ├── cardinality: [1 - 1] │ │ ├── key: () │ │ └── () │ └── zip - │ └── unnest(ARRAY[1,2,3], ARRAY[4,5,6]) [immutable, side-effects] + │ └── unnest(ARRAY[1,2,3], ARRAY[4,5,6]) [immutable] └── projections └── ((unnest:1, unnest:2) AS unnest, unnest) [as=unnest:3, outer=(1,2)] @@ -256,17 +256,17 @@ SELECT unnest(ARRAY[1,2,3]), unnest(ARRAY[1,2,3], ARRAY[4,5,6]) ---- project ├── columns: unnest:1 unnest:4 - ├── immutable, side-effects + ├── immutable ├── project-set │ ├── columns: unnest:1 unnest:2 unnest:3 - │ ├── immutable, side-effects + │ ├── immutable │ ├── values │ │ ├── cardinality: [1 - 1] │ │ ├── key: () │ │ └── () │ └── zip - │ ├── unnest(ARRAY[1,2,3]) [immutable, side-effects] - │ └── unnest(ARRAY[1,2,3], ARRAY[4,5,6]) [immutable, side-effects] + │ ├── unnest(ARRAY[1,2,3]) [immutable] + │ └── unnest(ARRAY[1,2,3], ARRAY[4,5,6]) [immutable] └── projections └── ((unnest:2, unnest:3) AS unnest, unnest) [as=unnest:4, outer=(2,3)] @@ -276,13 +276,13 @@ SELECT unnest((SELECT array_agg(y) FROM xy)) ---- project-set ├── columns: unnest:5 - ├── immutable, side-effects + ├── immutable ├── values │ ├── cardinality: [1 - 1] │ ├── key: () │ └── () └── zip - └── function: unnest [immutable, side-effects, subquery] + └── function: unnest [immutable, subquery] └── subquery └── scalar-group-by ├── columns: array_agg:4 @@ -301,11 +301,11 @@ SELECT json_array_elements(j) FROM xy ---- project ├── columns: json_array_elements:4 - ├── immutable, side-effects + ├── immutable └── project-set ├── columns: j:3 json_array_elements:4 - ├── immutable, side-effects + ├── immutable ├── scan xy │ └── columns: j:3 └── zip - └── json_array_elements(j:3) [outer=(3), immutable, side-effects] + └── json_array_elements(j:3) [outer=(3), immutable] diff --git a/pkg/sql/opt/norm/testdata/rules/prune_cols b/pkg/sql/opt/norm/testdata/rules/prune_cols index b53553a4b497..beb279727027 100644 --- a/pkg/sql/opt/norm/testdata/rules/prune_cols +++ b/pkg/sql/opt/norm/testdata/rules/prune_cols @@ -1617,18 +1617,18 @@ SELECT a, b, generate_series(c, 10) FROM abcde ---- project ├── columns: a:1!null b:2 generate_series:6 - ├── immutable, side-effects + ├── immutable ├── fd: (1)-->(2) └── project-set ├── columns: a:1!null b:2 c:3 generate_series:6 - ├── immutable, side-effects + ├── immutable ├── fd: (1)-->(2,3), (2,3)~~>(1) ├── scan abcde │ ├── columns: a:1!null b:2 c:3 │ ├── key: (1) │ └── fd: (1)-->(2,3), (2,3)~~>(1) └── zip - └── generate_series(c:3, 10) [outer=(3), immutable, side-effects] + └── generate_series(c:3, 10) [outer=(3), immutable] norm expect=PruneProjectSetCols SELECT k FROM a WHERE EXISTS(SELECT * FROM ROWS FROM (generate_series(i, k), length(s))) @@ -1636,18 +1636,18 @@ SELECT k FROM a WHERE EXISTS(SELECT * FROM ROWS FROM (generate_series(i, k), len distinct-on ├── columns: k:1!null ├── grouping columns: k:1!null - ├── immutable, side-effects + ├── immutable ├── key: (1) └── project-set ├── columns: k:1!null i:2 s:4 generate_series:5 length:6 - ├── immutable, side-effects + ├── immutable ├── fd: (1)-->(2,4) ├── scan a │ ├── columns: k:1!null i:2 s:4 │ ├── key: (1) │ └── fd: (1)-->(2,4) └── zip - ├── generate_series(i:2, k:1) [outer=(1,2), immutable, side-effects] + ├── generate_series(i:2, k:1) [outer=(1,2), immutable] └── length(s:4) [outer=(4), immutable] # -------------------------------------------------- @@ -1834,7 +1834,7 @@ delete a ├── columns: ├── fetch columns: k:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan a ├── columns: k:5!null └── key: (5) @@ -1847,7 +1847,7 @@ delete a ├── columns: ├── fetch columns: k:5 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── limit ├── columns: k:5!null column9:9!null ├── internal-ordering: +9 @@ -1889,7 +1889,7 @@ delete abcde ├── columns: ├── fetch columns: a:6 b:7 c:8 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── select ├── columns: a:6!null b:7 c:8 ├── key: (6) @@ -1909,7 +1909,7 @@ delete mutation ├── columns: ├── fetch columns: a:6 b:7 d:9 e:10 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan mutation ├── columns: a:6!null b:7 d:9 e:10 ├── key: (6) @@ -1921,7 +1921,7 @@ DELETE FROM a RETURNING k, s delete a ├── columns: k:1!null s:4 ├── fetch columns: k:5 s:8 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(4) └── scan a @@ -1939,7 +1939,7 @@ update "family" ├── update-mapping: │ └── c:8 => b:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── select ├── columns: a:6!null b:7 c:8 ├── key: (6) @@ -1961,7 +1961,7 @@ update "family" ├── update-mapping: │ └── a_new:11 => a:1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: a_new:11!null a:6!null b:7 c:8 d:9 e:10 ├── immutable @@ -1986,13 +1986,13 @@ UPDATE family SET c=c+1 RETURNING b ---- project ├── columns: b:2 - ├── volatile, side-effects, mutations + ├── volatile, mutations └── update "family" ├── columns: a:1!null b:2 ├── fetch columns: a:6 b:7 c:8 d:9 ├── update-mapping: │ └── c_new:11 => c:3 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(2) └── project @@ -2023,7 +2023,7 @@ upsert a ├── update-mapping: │ └── upsert_i:15 => i:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_i:15 column1:5!null column2:6!null column7:7 column8:8 k:9 i:10 f:11 s:12 ├── cardinality: [1 - 1] @@ -2079,7 +2079,7 @@ upsert a │ ├── upsert_f:16 => f:3 │ └── upsert_s:17 => s:4 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-4) └── project @@ -2135,7 +2135,7 @@ upsert "family" ├── update-mapping: │ └── column2:7 => b:2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── left-join (cross) ├── columns: column1:6!null column2:7!null column8:8 a:9 b:10 ├── cardinality: [1 - 1] @@ -2167,7 +2167,7 @@ INSERT INTO family VALUES (1, 2, 3, 4, 5) ON CONFLICT (a) DO UPDATE SET c = 10 R project ├── columns: e:5 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(5) └── upsert "family" @@ -2186,7 +2186,7 @@ project │ ├── upsert_a:17 => a:1 │ └── upsert_e:21 => e:5 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1,5) └── project @@ -2241,7 +2241,7 @@ upsert "family" ├── update-mapping: │ └── upsert_d:20 => d:4 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_d:20!null column1:6!null column2:7!null column3:8!null column4:9!null column10:10 a:11 c:13 d:14 ├── cardinality: [1 - 1] @@ -2291,7 +2291,7 @@ upsert mutation │ ├── upsert_b:17 => b:2 │ └── column9:9 => d:4 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: upsert_b:17!null column1:6!null column2:7!null column3:8!null column9:9 a:10 b:11 c:12 d:13 e:14 ├── cardinality: [1 - 1] @@ -2352,13 +2352,13 @@ UPDATE returning_test SET a = a + 1 RETURNING * ---- project ├── columns: a:1 b:2 c:3 d:4 e:5 f:6 g:7 - ├── volatile, side-effects, mutations + ├── volatile, mutations └── update returning_test ├── columns: a:1 b:2 c:3 d:4 e:5 f:6 g:7 rowid:8!null ├── fetch columns: a:9 b:10 c:11 d:12 e:13 f:14 g:15 rowid:16 ├── update-mapping: │ └── a_new:17 => a:1 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (8) ├── fd: (8)-->(1-7) └── project @@ -2380,7 +2380,7 @@ UPDATE returning_test SET d = a + d RETURNING a, d ---- project ├── columns: a:1 d:4 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── lax-key: (1,4) ├── fd: (1)~~>(4) └── update returning_test @@ -2388,7 +2388,7 @@ project ├── fetch columns: a:9 d:12 e:13 f:14 g:15 rowid:16 ├── update-mapping: │ └── d_new:17 => d:4 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (8) ├── fd: (8)-->(1,4), (1)~~>(4,8) └── project @@ -2409,13 +2409,13 @@ UPDATE returning_test SET a = a + d RETURNING a ---- project ├── columns: a:1 - ├── volatile, side-effects, mutations + ├── volatile, mutations └── update returning_test ├── columns: a:1 rowid:8!null ├── fetch columns: a:9 rowid:16 ├── update-mapping: │ └── a_new:17 => a:1 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (8) ├── fd: (8)-->(1) └── project @@ -2436,7 +2436,7 @@ UPDATE returning_test SET (b, a) = (a, a + b) RETURNING a, b, c ---- project ├── columns: a:1 b:2 c:3 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── lax-key: (1-3) ├── fd: (2)~~>(1,3) └── update returning_test @@ -2445,7 +2445,7 @@ project ├── update-mapping: │ ├── a_new:17 => a:1 │ └── a:9 => b:2 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (8) ├── fd: (8)-->(1-3), (2)~~>(1,3,8) └── project @@ -2469,16 +2469,16 @@ SELECT a FROM [SELECT a, b FROM [UPDATE returning_test SET a = a + 1 RETURNING a ---- with &1 ├── columns: a:21 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: returning_test.a:1 returning_test.b:2 returning_test.c:3 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── update returning_test │ ├── columns: returning_test.a:1 returning_test.b:2 returning_test.c:3 rowid:8!null │ ├── fetch columns: returning_test.a:9 returning_test.b:10 returning_test.c:11 rowid:16 │ ├── update-mapping: │ │ └── a_new:17 => returning_test.a:1 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (8) │ ├── fd: (8)-->(1-3) │ └── project @@ -2510,16 +2510,16 @@ SELECT a FROM [SELECT a, b FROM [UPDATE returning_test SET a = a + 1 RETURNING a ---- with &1 ├── columns: a:21!null - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: returning_test.a:1 returning_test.b:2 returning_test.c:3 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── update returning_test │ ├── columns: returning_test.a:1 returning_test.b:2 returning_test.c:3 rowid:8!null │ ├── fetch columns: returning_test.a:9 returning_test.b:10 returning_test.c:11 rowid:16 │ ├── update-mapping: │ │ └── a_new:17 => returning_test.a:1 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (8) │ ├── fd: (8)-->(1-3) │ └── project @@ -2556,17 +2556,17 @@ FROM ---- with &2 ├── columns: a:9 b:10 a:31!null b:32 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (9)~~>(10) ├── project │ ├── columns: returning_test.a:11 returning_test.b:12 returning_test.c:13 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── update returning_test │ ├── columns: returning_test.a:11 returning_test.b:12 returning_test.c:13 rowid:18!null │ ├── fetch columns: returning_test.a:19 returning_test.b:20 returning_test.c:21 rowid:26 │ ├── update-mapping: │ │ └── a_new:27 => returning_test.a:11 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (18) │ ├── fd: (18)-->(11-13) │ └── project @@ -2617,7 +2617,7 @@ INSERT INTO returning_test VALUES (1, 2, 'c') ON CONFLICT (a) DO UPDATE SET a = project ├── columns: a:1 b:2 c:3 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-3) └── upsert returning_test @@ -2641,26 +2641,26 @@ project │ ├── upsert_c:25 => c:3 │ └── upsert_rowid:30 => rowid:8 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-3,8) └── project ├── columns: upsert_a:23 upsert_b:24 upsert_c:25 upsert_rowid:30 column1:9!null column2:10!null column3:11!null column12:12 column13:13 a:14 b:15 c:16 rowid:21 ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(9-16,21,23-25,30) ├── left-join (cross) │ ├── columns: column1:9!null column2:10!null column3:11!null column12:12 column13:13 a:14 b:15 c:16 rowid:21 │ ├── cardinality: [1 - 1] │ ├── multiplicity: left-rows(exactly-one), right-rows(exactly-one) - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(9-16,21) │ ├── values │ │ ├── columns: column1:9!null column2:10!null column3:11!null column12:12 column13:13 │ │ ├── cardinality: [1 - 1] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: () │ │ ├── fd: ()-->(9-13) │ │ └── (1, 2, 'c', CAST(NULL AS INT8), unique_rowid()) @@ -2687,13 +2687,13 @@ DELETE FROM returning_test WHERE a < b + d RETURNING a, b, d ---- project ├── columns: a:1!null b:2 d:4 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(2,4) └── delete returning_test ├── columns: a:1!null b:2 d:4 rowid:8!null ├── fetch columns: a:9 b:10 d:12 rowid:16 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (8) ├── fd: (8)-->(1,2,4), (1)-->(2,4,8) └── select @@ -2714,7 +2714,7 @@ UPSERT INTO returning_test (a, b, c) VALUES (1, 2, 'c') RETURNING a, b, c, d project ├── columns: a:1!null b:2!null c:3!null d:4 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-4) └── upsert returning_test @@ -2741,20 +2741,20 @@ project │ ├── upsert_d:22 => d:4 │ └── upsert_rowid:26 => rowid:8 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-4,8) └── project ├── columns: upsert_d:22 upsert_rowid:26 column1:9!null column2:10!null column3:11!null column12:12 column13:13 a:14 b:15 c:16 d:17 rowid:21 ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(9-17,21,22,26) ├── left-join (hash) │ ├── columns: column1:9!null column2:10!null column3:11!null column12:12 column13:13 a:14 b:15 c:16 d:17 rowid:21 │ ├── cardinality: [1 - 1] │ ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-one) - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(9-17,21) │ ├── ensure-upsert-distinct-on @@ -2762,13 +2762,13 @@ project │ │ ├── grouping columns: column13:13 │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" │ │ ├── cardinality: [1 - 1] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: () │ │ ├── fd: ()-->(9-13) │ │ ├── values │ │ │ ├── columns: column1:9!null column2:10!null column3:11!null column12:12 column13:13 │ │ │ ├── cardinality: [1 - 1] - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: () │ │ │ ├── fd: ()-->(9-13) │ │ │ └── (1, 2, 'c', CAST(NULL AS INT8), unique_rowid()) @@ -2809,7 +2809,7 @@ update abcde ├── update-mapping: │ ├── "family".b:12 => abcde.b:2 │ └── "family".c:13 => abcde.c:3 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (1) ├── fd: (1)-->(12,13) └── inner-join (hash) diff --git a/pkg/sql/opt/norm/testdata/rules/scalar b/pkg/sql/opt/norm/testdata/rules/scalar index 48f17431fe61..38759519443f 100644 --- a/pkg/sql/opt/norm/testdata/rules/scalar +++ b/pkg/sql/opt/norm/testdata/rules/scalar @@ -1486,39 +1486,39 @@ SELECT ARRAY(SELECT generate_series(1, a.k) ORDER BY 1 DESC) FROM a ---- project ├── columns: array:9 - ├── immutable, side-effects + ├── immutable ├── group-by │ ├── columns: k:1!null canary:10 array_agg:11 │ ├── grouping columns: k:1!null │ ├── internal-ordering: -7 - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: (1) │ ├── fd: (1)-->(10,11) │ ├── sort │ │ ├── columns: k:1!null generate_series:7 canary:10 - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── ordering: -7 │ │ └── left-join-apply │ │ ├── columns: k:1!null generate_series:7 canary:10 - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── scan a │ │ │ ├── columns: k:1!null │ │ │ └── key: (1) │ │ ├── project │ │ │ ├── columns: canary:10!null generate_series:7 │ │ │ ├── outer: (1) - │ │ │ ├── immutable, side-effects + │ │ │ ├── immutable │ │ │ ├── fd: ()-->(10) │ │ │ ├── project-set │ │ │ │ ├── columns: generate_series:7 │ │ │ │ ├── outer: (1) - │ │ │ │ ├── immutable, side-effects + │ │ │ │ ├── immutable │ │ │ │ ├── values │ │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ │ ├── key: () │ │ │ │ │ └── () │ │ │ │ └── zip - │ │ │ │ └── generate_series(1, k:1) [outer=(1), immutable, side-effects] + │ │ │ │ └── generate_series(1, k:1) [outer=(1), immutable] │ │ │ └── projections │ │ │ └── true [as=canary:10] │ │ └── filters (true) diff --git a/pkg/sql/opt/norm/testdata/rules/select b/pkg/sql/opt/norm/testdata/rules/select index 9feeeabe5dd8..29750ca12db7 100644 --- a/pkg/sql/opt/norm/testdata/rules/select +++ b/pkg/sql/opt/norm/testdata/rules/select @@ -1445,7 +1445,7 @@ SELECT k, g FROM a, generate_series(0, a.k, 10) AS g WHERE k = 1 ---- project-set ├── columns: k:1!null g:6 - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1) ├── select │ ├── columns: k:1!null @@ -1458,7 +1458,7 @@ project-set │ └── filters │ └── k:1 = 1 [outer=(1), constraints=(/1: [/1 - /1]; tight), fd=()-->(1)] └── zip - └── generate_series(0, k:1, 10) [outer=(1), immutable, side-effects] + └── generate_series(0, k:1, 10) [outer=(1), immutable] # Make sure that filters aren't pushed down when not bound by the input, so PushSelectIntoProjectSet is not triggered. norm expect-not=PushSelectIntoProjectSet @@ -1466,15 +1466,15 @@ SELECT k, g FROM a, generate_series(0, a.k, 10) AS g WHERE g > 1 ---- select ├── columns: k:1!null g:6!null - ├── immutable, side-effects + ├── immutable ├── project-set │ ├── columns: k:1!null generate_series:6 - │ ├── immutable, side-effects + │ ├── immutable │ ├── scan a │ │ ├── columns: k:1!null │ │ └── key: (1) │ └── zip - │ └── generate_series(0, k:1, 10) [outer=(1), immutable, side-effects] + │ └── generate_series(0, k:1, 10) [outer=(1), immutable] └── filters └── generate_series:6 > 1 [outer=(6), constraints=(/6: [/2 - ]; tight)] @@ -1484,11 +1484,11 @@ SELECT k, g FROM a, generate_series(0, a.k, 10) AS g WHERE g > 1 AND k = 1 ---- select ├── columns: k:1!null g:6!null - ├── immutable, side-effects + ├── immutable ├── fd: ()-->(1) ├── project-set │ ├── columns: k:1!null generate_series:6 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: ()-->(1) │ ├── select │ │ ├── columns: k:1!null @@ -1501,7 +1501,7 @@ select │ │ └── filters │ │ └── k:1 = 1 [outer=(1), constraints=(/1: [/1 - /1]; tight), fd=()-->(1)] │ └── zip - │ └── generate_series(0, k:1, 10) [outer=(1), immutable, side-effects] + │ └── generate_series(0, k:1, 10) [outer=(1), immutable] └── filters └── generate_series:6 > 1 [outer=(6), constraints=(/6: [/2 - ]; tight)] @@ -1691,27 +1691,27 @@ union ├── columns: k:11!null ├── left columns: b.k:1 ├── right columns: a.i:7 - ├── volatile, side-effects + ├── volatile ├── key: (11) ├── select │ ├── columns: b.k:1!null │ ├── cardinality: [0 - 8] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ ├── scan b │ │ ├── columns: b.k:1!null │ │ └── key: (1) │ └── filters │ ├── (b.k:1 < 10) AND (b.k:1 > 1) [outer=(1), constraints=(/1: [/2 - /9]; tight)] - │ └── random() < 0.5 [volatile, side-effects] + │ └── random() < 0.5 [volatile] └── select ├── columns: a.i:7!null - ├── volatile, side-effects + ├── volatile ├── scan a │ └── columns: a.i:7 └── filters ├── (a.i:7 < 10) AND (a.i:7 > 1) [outer=(7), constraints=(/7: [/2 - /9]; tight)] - └── random() < 0.5 [volatile, side-effects] + └── random() < 0.5 [volatile] norm expect=PushFilterIntoSetOp SELECT * FROM @@ -1776,15 +1776,15 @@ union-all ├── columns: k:23!null ├── left columns: k:11 ├── right columns: k:22 - ├── volatile, side-effects + ├── volatile ├── union-all │ ├── columns: k:11!null │ ├── left columns: b.k:1 │ ├── right columns: b.k:6 - │ ├── volatile, side-effects + │ ├── volatile │ ├── select │ │ ├── columns: b.k:1!null - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (1) │ │ ├── scan b │ │ │ ├── columns: b.k:1!null @@ -1802,10 +1802,10 @@ union-all │ │ │ │ └── fd: (24)-->(25-28) │ │ │ └── filters │ │ │ └── a.k:24 = 1 [outer=(24), constraints=(/24: [/1 - /1]; tight), fd=()-->(24)] - │ │ └── random() < 0.5 [volatile, side-effects] + │ │ └── random() < 0.5 [volatile] │ └── select │ ├── columns: b.k:6!null - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (6) │ ├── scan b │ │ ├── columns: b.k:6!null @@ -1823,15 +1823,15 @@ union-all │ │ │ └── fd: (24)-->(25-28) │ │ └── filters │ │ └── a.k:24 = 1 [outer=(24), constraints=(/24: [/1 - /1]; tight), fd=()-->(24)] - │ └── random() < 0.5 [volatile, side-effects] + │ └── random() < 0.5 [volatile] └── union-all ├── columns: k:22!null ├── left columns: b.k:12 ├── right columns: b.k:17 - ├── volatile, side-effects + ├── volatile ├── select │ ├── columns: b.k:12!null - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (12) │ ├── scan b │ │ ├── columns: b.k:12!null @@ -1849,10 +1849,10 @@ union-all │ │ │ └── fd: (24)-->(25-28) │ │ └── filters │ │ └── a.k:24 = 1 [outer=(24), constraints=(/24: [/1 - /1]; tight), fd=()-->(24)] - │ └── random() < 0.5 [volatile, side-effects] + │ └── random() < 0.5 [volatile] └── select ├── columns: b.k:17!null - ├── volatile, side-effects + ├── volatile ├── key: (17) ├── scan b │ ├── columns: b.k:17!null @@ -1870,7 +1870,7 @@ union-all │ │ └── fd: (24)-->(25-28) │ └── filters │ └── a.k:24 = 1 [outer=(24), constraints=(/24: [/1 - /1]; tight), fd=()-->(24)] - └── random() < 0.5 [volatile, side-effects] + └── random() < 0.5 [volatile] # No-op case because the filter references outer columns. norm expect-not=PushFilterIntoSetOp @@ -1926,7 +1926,7 @@ except ├── left columns: column1:1!null column2:2!null ├── right columns: column1:3 column2:4 ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: (1,2) ├── values │ ├── columns: column1:1!null column2:2!null @@ -1937,7 +1937,7 @@ except └── select ├── columns: column1:3!null column2:4!null ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(3,4) ├── values @@ -1947,7 +1947,7 @@ except │ ├── fd: ()-->(3,4) │ └── (0, 1) └── filters - └── (1 / 0) > 0 [immutable, side-effects] + └── (1 / 0) > 0 [immutable] norm SELECT * FROM ((values (1.0::decimal)) EXCEPT (values (1.00::decimal))) WHERE column1::string != '1.00'; diff --git a/pkg/sql/opt/norm/testdata/rules/side_effects b/pkg/sql/opt/norm/testdata/rules/side_effects index a8dac927a2ad..3fd63f7d1e22 100644 --- a/pkg/sql/opt/norm/testdata/rules/side_effects +++ b/pkg/sql/opt/norm/testdata/rules/side_effects @@ -1,4 +1,4 @@ -# See Logical.CanHaveSideEffects comment for the optimizer's side-effect policy. +# See VolatilitySet comment for the optimizer's side-effect policy. exec-ddl CREATE TABLE a (k INT PRIMARY KEY, i INT, f FLOAT, s STRING, j JSON) @@ -18,13 +18,13 @@ SELECT * FROM a ORDER BY length('foo'), random()+1.0 ---- sort ├── columns: k:1!null i:2 f:3 s:4 j:5 [hidden: column7:7] - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-5,7) ├── ordering: +7 └── project ├── columns: column7:7 k:1!null i:2 f:3 s:4 j:5 - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-5,7) ├── scan a @@ -32,7 +32,7 @@ sort │ ├── key: (1) │ └── fd: (1)-->(2-5) └── projections - └── random() + 1.0 [as=column7:7, volatile, side-effects] + └── random() + 1.0 [as=column7:7, volatile] # Don't allow GROUP BY column to be eliminated if it has a side effect. norm @@ -40,16 +40,16 @@ SELECT avg(f) FROM a WHERE i=5 GROUP BY i+(random()*10)::int, i+1 ---- project ├── columns: avg:6 - ├── volatile, side-effects + ├── volatile └── group-by ├── columns: avg:6 column7:7 ├── grouping columns: column7:7 - ├── volatile, side-effects + ├── volatile ├── key: (7) ├── fd: (7)-->(6) ├── project │ ├── columns: column7:7 f:3 - │ ├── volatile, side-effects + │ ├── volatile │ ├── select │ │ ├── columns: i:2!null f:3 │ │ ├── fd: ()-->(2) @@ -58,7 +58,7 @@ project │ │ └── filters │ │ └── i:2 = 5 [outer=(2), constraints=(/2: [/5 - /5]; tight), fd=()-->(2)] │ └── projections - │ └── i:2 + (random() * 10.0)::INT8 [as=column7:7, outer=(2), volatile, side-effects] + │ └── i:2 + (random() * 10.0)::INT8 [as=column7:7, outer=(2), volatile] └── aggregations └── avg [as=avg:6, outer=(3)] └── f:3 @@ -77,12 +77,12 @@ SELECT * FROM a INNER JOIN xy ON k=x WHERE k=random() inner-join (hash) ├── columns: k:1!null i:2 f:3 s:4 j:5 x:6!null y:7 ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-one) - ├── volatile, side-effects + ├── volatile ├── key: (6) ├── fd: (1)-->(2-5), (6)-->(7), (1)==(6), (6)==(1) ├── select │ ├── columns: k:1!null i:2 f:3 s:4 j:5 - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ ├── fd: (1)-->(2-5) │ ├── scan a @@ -90,10 +90,10 @@ inner-join (hash) │ │ ├── key: (1) │ │ └── fd: (1)-->(2-5) │ └── filters - │ └── k:1 = random() [outer=(1), volatile, side-effects, constraints=(/1: (/NULL - ])] + │ └── k:1 = random() [outer=(1), volatile, constraints=(/1: (/NULL - ])] ├── select │ ├── columns: x:6!null y:7 - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (6) │ ├── fd: (6)-->(7) │ ├── scan xy @@ -101,7 +101,7 @@ inner-join (hash) │ │ ├── key: (6) │ │ └── fd: (6)-->(7) │ └── filters - │ └── x:6 = random() [outer=(6), volatile, side-effects, constraints=(/6: (/NULL - ])] + │ └── x:6 = random() [outer=(6), volatile, constraints=(/6: (/NULL - ])] └── filters └── k:1 = x:6 [outer=(1,6), constraints=(/1: (/NULL - ]; /6: (/NULL - ]), fd=(1)==(6), (6)==(1)] @@ -162,11 +162,11 @@ SELECT CASE WHEN i<0 THEN (SELECT y FROM xy WHERE x=i LIMIT (random()*10)::int) ---- project ├── columns: case:8 - ├── volatile, side-effects + ├── volatile ├── scan a │ └── columns: i:2 └── projections - └── case [as=case:8, outer=(2), volatile, side-effects, correlated-subquery] + └── case [as=case:8, outer=(2), volatile, correlated-subquery] ├── true ├── when │ ├── i:2 < 0 @@ -175,14 +175,14 @@ project │ ├── columns: y:7 │ ├── outer: (2) │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(7) │ └── limit │ ├── columns: x:6!null y:7 │ ├── outer: (2) │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(6,7) │ ├── select @@ -206,7 +206,7 @@ SELECT * FROM a WHERE (CASE WHEN i<0 THEN 5 ELSE (SELECT y FROM xy WHERE x=i AND ---- select ├── columns: k:1!null i:2 f:3 s:4 j:5 - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-5) ├── scan a @@ -214,7 +214,7 @@ select │ ├── key: (1) │ └── fd: (1)-->(2-5) └── filters - └── eq [outer=(1,2), immutable, side-effects, correlated-subquery, constraints=(/1: (/NULL - ])] + └── eq [outer=(1,2), immutable, correlated-subquery, constraints=(/1: (/NULL - ])] ├── k:1 └── case ├── true @@ -226,14 +226,14 @@ select ├── columns: y:7 ├── outer: (2) ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(7) └── select ├── columns: x:6!null y:7 ├── outer: (2) ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(6,7) ├── scan xy @@ -242,7 +242,7 @@ select │ └── fd: (6)-->(7) └── filters ├── x:6 = i:2 [outer=(2,6), constraints=(/2: (/NULL - ]; /6: (/NULL - ]), fd=(2)==(6), (6)==(2)] - └── (5 / y:7) > 1 [outer=(7), immutable, side-effects] + └── (5 / y:7) > 1 [outer=(7), immutable] # Don't decorrelate IFERROR branch if there are side effects @@ -251,7 +251,7 @@ SELECT * FROM a WHERE IFERROR(1/0, (SELECT y::DECIMAL FROM xy WHERE x = i AND 5/ ---- select ├── columns: k:1!null i:2 f:3 s:4 j:5 - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-5) ├── scan a @@ -259,7 +259,7 @@ select │ ├── key: (1) │ └── fd: (1)-->(2-5) └── filters - └── eq [outer=(1,2), immutable, side-effects, correlated-subquery, constraints=(/1: (/NULL - ])] + └── eq [outer=(1,2), immutable, correlated-subquery, constraints=(/1: (/NULL - ])] ├── k:1 └── if-err ├── 1 / 0 @@ -269,14 +269,14 @@ select ├── columns: y:8 ├── outer: (2) ├── cardinality: [0 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(8) ├── select │ ├── columns: x:6!null xy.y:7 │ ├── outer: (2) │ ├── cardinality: [0 - 1] - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: () │ ├── fd: ()-->(6,7) │ ├── scan xy @@ -285,7 +285,7 @@ select │ │ └── fd: (6)-->(7) │ └── filters │ ├── x:6 = i:2 [outer=(2,6), constraints=(/2: (/NULL - ]; /6: (/NULL - ]), fd=(2)==(6), (6)==(2)] - │ └── (5 / xy.y:7) > 1 [outer=(7), immutable, side-effects] + │ └── (5 / xy.y:7) > 1 [outer=(7), immutable] └── projections └── xy.y:7::DECIMAL [as=y:8, outer=(7), immutable] @@ -295,12 +295,12 @@ SELECT * FROM a WHERE IFERROR((1/0)::int, (SELECT y FROM xy WHERE x = i))=k ---- project ├── columns: k:1!null i:2 f:3 s:4 j:5 - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-5) └── select ├── columns: k:1!null i:2 f:3 s:4 j:5 x:6 y:7 - ├── immutable, side-effects + ├── immutable ├── key: (1) ├── fd: (1)-->(2-7), (6)-->(7) ├── left-join (hash) @@ -319,4 +319,4 @@ project │ └── filters │ └── x:6 = i:2 [outer=(2,6), constraints=(/2: (/NULL - ]; /6: (/NULL - ]), fd=(2)==(6), (6)==(2)] └── filters - └── k:1 = IFERROR((1 / 0)::INT8, y:7) [outer=(1,7), immutable, side-effects, constraints=(/1: (/NULL - ])] + └── k:1 = IFERROR((1 / 0)::INT8, y:7) [outer=(1,7), immutable, constraints=(/1: (/NULL - ])] diff --git a/pkg/sql/opt/norm/testdata/rules/window b/pkg/sql/opt/norm/testdata/rules/window index c1cc30512a34..6814db68e2a3 100644 --- a/pkg/sql/opt/norm/testdata/rules/window +++ b/pkg/sql/opt/norm/testdata/rules/window @@ -158,14 +158,14 @@ SELECT * FROM (SELECT i, s, f, rank() OVER (PARTITION BY i, f) FROM a) WHERE ran ---- window partition=(2,3) ├── columns: i:2 s:4 f:3 rank:6 - ├── volatile, side-effects + ├── volatile ├── select │ ├── columns: i:2 f:3 s:4 - │ ├── volatile, side-effects + │ ├── volatile │ ├── scan a │ │ └── columns: i:2 f:3 s:4 │ └── filters - │ └── random() < 0.5 [volatile, side-effects] + │ └── random() < 0.5 [volatile] └── windows └── rank [as=rank:6] diff --git a/pkg/sql/opt/norm/testdata/rules/with b/pkg/sql/opt/norm/testdata/rules/with index ef9cf30802c0..ff2e33830b66 100644 --- a/pkg/sql/opt/norm/testdata/rules/with +++ b/pkg/sql/opt/norm/testdata/rules/with @@ -430,7 +430,7 @@ WITH foo AS (INSERT INTO a VALUES (1) RETURNING *) SELECT * FROM foo with &1 (foo) ├── columns: k:11!null i:12 f:13 s:14 j:15 ├── cardinality: [1 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(11-15) ├── insert a @@ -442,7 +442,7 @@ with &1 (foo) │ │ ├── column9:9 => a.s:4 │ │ └── column10:10 => a.j:5 │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-5) │ └── values @@ -469,13 +469,13 @@ WITH foo AS (SELECT crdb_internal.notice('foo')) SELECT * FROM foo with &1 (foo) ├── columns: crdb_internal.notice:2 ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(2) ├── values │ ├── columns: crdb_internal.notice:1 │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(1) │ └── (crdb_internal.notice('foo'),) @@ -583,7 +583,7 @@ WITH cte AS (INSERT INTO child VALUES (1, 1) RETURNING c) SELECT c FROM cte UNIO with &2 (cte) ├── columns: c:10(int!null) ├── cardinality: [1 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── stats: [rows=2, distinct(10)=2, null(10)=0] ├── cost: 1037.7025 ├── key: (10) @@ -594,7 +594,7 @@ with &2 (cte) │ │ └── column2:4 => t.public.child.p:2 │ ├── input binding: &1 │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── stats: [rows=1] │ ├── cost: 1037.5925 │ ├── key: () @@ -745,13 +745,13 @@ with &1 (foo) ├── columns: "?column?":2 ├── materialized ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(2) ├── values │ ├── columns: "?column?":1 │ ├── cardinality: [1 - 1] - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: () │ ├── fd: ()-->(1) │ └── (1 / 0,) @@ -770,7 +770,7 @@ WITH foo AS NOT MATERIALIZED (SELECT 1/0) SELECT * FROM foo values ├── columns: "?column?":2 ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(2) └── (1 / 0,) diff --git a/pkg/sql/opt/norm/testdata/rules/zero_cardinality b/pkg/sql/opt/norm/testdata/rules/zero_cardinality index f81229e41c14..f1b71c858134 100644 --- a/pkg/sql/opt/norm/testdata/rules/zero_cardinality +++ b/pkg/sql/opt/norm/testdata/rules/zero_cardinality @@ -75,7 +75,7 @@ SELECT * FROM (SELECT CASE WHEN k < 0 THEN 3 / 0 ELSE 3 END FROM b) WHERE false project ├── columns: case:6!null ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(6) ├── values @@ -84,4 +84,4 @@ project │ ├── key: () │ └── fd: ()-->(1) └── projections - └── CASE WHEN k:1 < 0 THEN 3 / 0 ELSE 3 END [as=case:6, outer=(1), immutable, side-effects] + └── CASE WHEN k:1 < 0 THEN 3 / 0 ELSE 3 END [as=case:6, outer=(1), immutable] diff --git a/pkg/sql/opt/props/logical.go b/pkg/sql/opt/props/logical.go index 1d01449fcccd..cd31202e62a4 100644 --- a/pkg/sql/opt/props/logical.go +++ b/pkg/sql/opt/props/logical.go @@ -90,77 +90,6 @@ type Shared struct { // VolatilitySet contains the set of volatilities contained in the expression. VolatilitySet VolatilitySet - // CanHaveSideEffects is true if the expression modifies state outside its - // own scope, or if depends upon state that may change across evaluations. An - // expression can have side effects if it can do any of the following: - // - // 1. Trigger a run-time error - // 10 / col -- division by zero error possible - // crdb_internal.force_error('', '') -- triggers run-time error - // - // 2. Modify outside session or database state - // nextval(seq) -- modifies database sequence value - // SELECT * FROM [INSERT ...] -- inserts rows into database - // - // 3. Return different results when repeatedly called with same input - // ORDER BY random() -- random can return different values - // ts < clock_timestamp() -- clock_timestamp can return different vals - // - // The optimizer makes *only* the following side-effect related guarantees: - // - // 1. CASE/IF branches are only evaluated if the branch condition is true. - // Therefore, the following is guaranteed to never raise a divide by - // zero error, regardless of how cleverly the optimizer rewrites the - // expression: - // - // CASE WHEN divisor<>0 THEN dividend / divisor ELSE NULL END - // - // While this example is trivial, a more complex example might have - // correlated subqueries that cannot be hoisted outside the CASE - // expression in the usual way, since that would trigger premature - // evaluation. - // - // 2. Expressions with side effects are never treated as constant - // expressions, even though they do not depend on other columns in the - // query: - // - // SELECT * FROM xy ORDER BY random() - // - // If the random() expression were treated as a constant, then the ORDER - // BY could be dropped by the optimizer, since ordering by a constant is - // a no-op. Instead, the optimizer treats it like it would an expression - // that depends upon a column. - // - // 3. A common table expression (CTE) with side effects will only be - // evaluated one time. This will typically prevent inlining of the CTE - // into the query body. For example: - // - // WITH a AS (INSERT ... RETURNING ...) SELECT * FROM a, a - // - // Although the "a" CTE is referenced twice, it must be evaluated only - // one time (and its results cached to satisfy the second reference). - // - // As long as the optimizer provides these guarantees, it is free to rewrite, - // reorder, duplicate, and eliminate as if no side effects were present. As an - // example, the optimizer is free to eliminate the unused "nextval" column in - // this query: - // - // SELECT x FROM (SELECT nextval(seq), x FROM xy) - // => - // SELECT x FROM xy - // - // It's also allowed to duplicate side-effecting expressions during predicate - // pushdown: - // - // SELECT * FROM xy INNER JOIN xz ON xy.x=xz.x WHERE xy.x=random() - // => - // SELECT * - // FROM (SELECT * FROM xy WHERE xy.x=random()) - // INNER JOIN (SELECT * FROM xz WHERE xz.x=random()) - // ON xy.x=xz.x - // - CanHaveSideEffects bool - // CanMutate is true if the subtree rooted at this expression contains at // least one operator that modifies schema (like CreateTable) or writes or // deletes rows (like Insert). diff --git a/pkg/sql/opt/props/verify.go b/pkg/sql/opt/props/verify.go index 1e33910b30f3..a8b85f44e0ce 100644 --- a/pkg/sql/opt/props/verify.go +++ b/pkg/sql/opt/props/verify.go @@ -22,7 +22,7 @@ import ( // // 1. The properties must have been built. // 2. If HasCorrelatedSubquery is true, then HasSubquery must be true as well. -// 3. If Mutate is true, then CanHaveSideEffects must also be true. +// 3. If Mutate is true, then VolatilitySet must contain Volatile. // func (s *Shared) Verify() { if !s.Populated { @@ -31,8 +31,8 @@ func (s *Shared) Verify() { if s.HasCorrelatedSubquery && !s.HasSubquery { panic(errors.AssertionFailedf("HasSubquery cannot be false if HasCorrelatedSubquery is true")) } - if s.CanMutate && !s.CanHaveSideEffects { - panic(errors.AssertionFailedf("CanHaveSideEffects cannot be false if CanMutate is true")) + if s.CanMutate && !s.VolatilitySet.HasVolatile() { + panic(errors.AssertionFailedf("HasVolatile cannot be false if CanMutate is true")) } } @@ -85,7 +85,7 @@ func (r *Relational) VerifyAgainst(other *Relational) { } // NotNullCols, FuncDeps are best effort, so they might differ. - // OuterCols, CanHaveSideEffects, and HasPlaceholder might differ if a + // OuterCols, VolatilitySet, and HasPlaceholder might differ if a // subexpression containing them was elided. } diff --git a/pkg/sql/opt/props/volatility.go b/pkg/sql/opt/props/volatility.go index a3a61046246a..fe9685befef0 100644 --- a/pkg/sql/opt/props/volatility.go +++ b/pkg/sql/opt/props/volatility.go @@ -25,8 +25,58 @@ import "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" // memo if we don't constant fold stable operators, and subsequently fold them // each time we try to execute an instance of the query. // -// TODO(radu): transfer the comment for CanHaveSideEffects here clarifying the -// optimizer policy around volatility and side-effects. +// The optimizer makes *only* the following side-effect related guarantees: +// +// 1. CASE/IF branches are only evaluated if the branch condition is true or +// if all operators are LeakProof. Therefore, the following is guaranteed +// to never raise a divide by zero error, regardless of how cleverly the +// optimizer rewrites the expression: +// +// CASE WHEN divisor<>0 THEN dividend / divisor ELSE NULL END +// +// While this example is trivial, a more complex example might have +// correlated subqueries that cannot be hoisted outside the CASE +// expression in the usual way, since that would trigger premature +// evaluation. +// +// 2. Volatile expressions are never treated as constant expressions, even +// though they do not depend on other columns in the query: +// +// SELECT * FROM xy ORDER BY random() +// +// If the random() expression were treated as a constant, then the ORDER +// BY could be dropped by the optimizer, since ordering by a constant is +// a no-op. Instead, the optimizer treats it like it would an expression +// that depends upon a column. +// +// 3. A common table expression (CTE) containing Volatile operators will only +// be evaluated one time. This will typically prevent inlining of the CTE +// into the query body. For example: +// +// WITH a AS (INSERT ... RETURNING ...) SELECT * FROM a, a +// +// Although the "a" CTE is referenced twice, it must be evaluated only +// one time (and its results cached to satisfy the second reference). +// +// As long as the optimizer provides these guarantees, it is free to rewrite, +// reorder, duplicate, and eliminate as if no side effects were present. As an +// example, the optimizer is free to eliminate the unused "nextval" column in +// this query: +// +// SELECT x FROM (SELECT nextval(seq), x FROM xy) +// => +// SELECT x FROM xy +// +// It's also allowed to duplicate side-effecting expressions during predicate +// pushdown: +// +// SELECT * FROM xy INNER JOIN xz ON xy.x=xz.x WHERE xy.x=random() +// => +// SELECT * +// FROM (SELECT * FROM xy WHERE xy.x=random()) +// INNER JOIN (SELECT * FROM xz WHERE xz.x=random()) +// ON xy.x=xz.x +// type VolatilitySet uint8 // Add a volatility to the set. diff --git a/pkg/sql/opt/xform/testdata/external/nova b/pkg/sql/opt/xform/testdata/external/nova index c2f83245dbe7..f1e1365923fc 100644 --- a/pkg/sql/opt/xform/testdata/external/nova +++ b/pkg/sql/opt/xform/testdata/external/nova @@ -159,7 +159,7 @@ order by anon_1.flavors_id asc ---- project ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── ordering: +1 @@ -167,14 +167,14 @@ project ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 ├── left ordering: +1 ├── right ordering: +28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── ordering: +1 ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 │ ├── internal-ordering: +1 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── ordering: +1 @@ -338,18 +338,18 @@ order by anon_1.flavors_flavorid asc, anon_1.flavors_id asc ---- sort ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11!null anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:38 flavor_extra_specs_1_updated_at:39 flavor_extra_specs_1_id:34 flavor_extra_specs_1_key:35 flavor_extra_specs_1_value:36 flavor_extra_specs_1_flavor_id:37 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,34) ├── fd: ()-->(11), (1)-->(2-10,12,14,15), (7)-->(1-6,8-10,12,14,15), (2)-->(1,3-10,12,14,15), (34)-->(35-39), (35,37)-->(34,36,38,39) ├── ordering: +7 opt(11) [actual: +7] └── project ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 flavors.created_at:14 flavors.updated_at:15 flavor_extra_specs_1.id:34 key:35 value:36 flavor_extra_specs_1.flavor_id:37 flavor_extra_specs_1.created_at:38 flavor_extra_specs_1.updated_at:39 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,34) ├── fd: ()-->(11), (1)-->(2-10,12,14,15), (7)-->(1-6,8-10,12,14,15), (2)-->(1,3-10,12,14,15), (34)-->(35-39), (35,37)-->(34,36,38,39) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:32 flavor_extra_specs_1.id:34 key:35 value:36 flavor_extra_specs_1.flavor_id:37 flavor_extra_specs_1.created_at:38 flavor_extra_specs_1.updated_at:39 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,34) ├── fd: ()-->(11), (1)-->(2-10,12,14,15,32), (7)-->(1-6,8-10,12,14,15), (2)-->(1,3-10,12,14,15), (34)-->(35-39), (35,37)-->(34,36,38,39) ├── scan flavor_extra_specs_1 @@ -359,7 +359,7 @@ sort ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:32 │ ├── internal-ordering: +7 opt(11) - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: ()-->(11), (1)-->(2-10,12,14,15,32), (7)-->(1-6,8-10,12,14,15), (2)-->(1,3-10,12,14,15) │ ├── offset @@ -593,18 +593,18 @@ order by anon_1.instance_types_flavorid asc, ---- sort ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7 anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── ordering: +7,+1 └── project ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -621,7 +621,7 @@ sort ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 │ ├── internal-ordering: +7,+1 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -944,12 +944,12 @@ from (select instance_types.created_at as instance_types_created_at, ---- project ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2!null anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7 anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)-->(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)-->(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -965,7 +965,7 @@ project │ └── instance_type_extra_specs_1.deleted:32 = $7 [outer=(32), constraints=(/32: (/NULL - ])] ├── limit │ ├── columns: instance_types.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)-->(1,3-12,14-16) │ ├── offset @@ -1125,12 +1125,12 @@ from (select instance_types.created_at as instance_types_created_at, ---- project ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7 anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -1146,7 +1146,7 @@ project │ └── instance_type_extra_specs_1.deleted:32 = $7 [outer=(32), constraints=(/32: (/NULL - ])] ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -1298,12 +1298,12 @@ from (select flavors.created_at as flavors_created_at, ---- project ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -1312,7 +1312,7 @@ project │ └── fd: (25)-->(26-30), (26,28)-->(25,27,29,30) ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── offset @@ -1457,12 +1457,12 @@ from (select flavors.created_at as flavors_created_at, ---- project ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -1471,7 +1471,7 @@ project │ └── fd: (25)-->(26-30), (26,28)-->(25,27,29,30) ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── offset @@ -1620,18 +1620,18 @@ order by anon_1.flavors_flavorid asc, anon_1.flavors_id asc ---- sort ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── ordering: +7 └── project ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -1641,7 +1641,7 @@ sort ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 │ ├── internal-ordering: +7 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── offset @@ -1805,18 +1805,18 @@ order by anon_1.instance_types_flavorid asc, ---- sort ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7 anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── ordering: +7,+1 └── project ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -1833,7 +1833,7 @@ sort ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 │ ├── internal-ordering: +7,+1 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)~~>(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -2000,12 +2000,12 @@ from (select instance_types.created_at as instance_types_created_at, ---- project ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7!null anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -2021,7 +2021,7 @@ project │ └── instance_type_extra_specs_1.deleted:32 = $7 [outer=(32), constraints=(/32: (/NULL - ])] ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -2314,18 +2314,18 @@ order by anon_1.instance_types_flavorid asc, ---- sort ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7!null anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── ordering: +7,+1 └── project ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -2342,7 +2342,7 @@ sort ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 │ ├── internal-ordering: +7,+1 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -2502,18 +2502,18 @@ order by anon_1.flavors_flavorid asc, anon_1.flavors_id asc ---- sort ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── ordering: +7 └── project ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -2523,7 +2523,7 @@ sort ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 │ ├── internal-ordering: +7 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── offset @@ -2687,7 +2687,7 @@ order by anon_1.instance_types_flavorid asc, ---- project ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7 anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11!null anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:45 instance_type_extra_specs_1_updated_at:46 instance_type_extra_specs_1_deleted_at:44 instance_type_extra_specs_1_deleted:43 instance_type_extra_specs_1_id:39 instance_type_extra_specs_1_key:40 instance_type_extra_specs_1_value:41 instance_type_extra_specs_1_instance_type_id:42 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,39) ├── fd: ()-->(11), (1)-->(2-10,12-16), (7,13)~~>(1-6,8-10,12,14-16), (2,13)~~>(1,3-10,12,14-16), (39)-->(40-46), (40,42,43)~~>(39,41,44-46) ├── ordering: +7,+1 opt(11) [actual: +7,+1] @@ -2695,21 +2695,21 @@ project ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:37 instance_type_extra_specs_1.id:39 key:40 value:41 instance_type_extra_specs_1.instance_type_id:42 instance_type_extra_specs_1.deleted:43 instance_type_extra_specs_1.deleted_at:44 instance_type_extra_specs_1.created_at:45 instance_type_extra_specs_1.updated_at:46 ├── key columns: [39] = [39] ├── lookup columns are key - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,39) ├── fd: ()-->(11), (1)-->(2-10,12-16,37), (7,13)~~>(1-6,8-10,12,14-16), (2,13)~~>(1,3-10,12,14-16), (39)-->(40-46), (40,42,43)~~>(39,41,44-46) ├── ordering: +7,+1 opt(11) [actual: +7,+1] ├── left-join (lookup instance_type_extra_specs@secondary) │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:37 instance_type_extra_specs_1.id:39 key:40 instance_type_extra_specs_1.instance_type_id:42 instance_type_extra_specs_1.deleted:43 │ ├── key columns: [1] = [42] - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1,39) │ ├── fd: ()-->(11), (1)-->(2-10,12-16,37), (7,13)~~>(1-6,8-10,12,14-16), (2,13)~~>(1,3-10,12,14-16), (39)-->(40,42,43), (40,42,43)~~>(39) │ ├── ordering: +7,+1 opt(11) [actual: +7,+1] │ ├── limit │ │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7 swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11!null is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:37 │ │ ├── internal-ordering: +7,+1 opt(11) - │ │ ├── immutable, side-effects, has-placeholder + │ │ ├── immutable, has-placeholder │ │ ├── key: (1) │ │ ├── fd: ()-->(11), (1)-->(2-10,12-16,37), (7,13)~~>(1-6,8-10,12,14-16), (2,13)~~>(1,3-10,12,14-16) │ │ ├── ordering: +7,+1 opt(11) [actual: +7,+1] @@ -2958,18 +2958,18 @@ order by anon_1.instance_types_deleted asc, ---- sort ├── columns: anon_1_instance_types_created_at:15 anon_1_instance_types_updated_at:16 anon_1_instance_types_deleted_at:14 anon_1_instance_types_deleted:13!null anon_1_instance_types_id:1!null anon_1_instance_types_name:2 anon_1_instance_types_memory_mb:3!null anon_1_instance_types_vcpus:4!null anon_1_instance_types_root_gb:5 anon_1_instance_types_ephemeral_gb:6 anon_1_instance_types_flavorid:7!null anon_1_instance_types_swap:8!null anon_1_instance_types_rxtx_factor:9 anon_1_instance_types_vcpu_weight:10 anon_1_instance_types_disabled:11 anon_1_instance_types_is_public:12 instance_type_extra_specs_1_created_at:34 instance_type_extra_specs_1_updated_at:35 instance_type_extra_specs_1_deleted_at:33 instance_type_extra_specs_1_deleted:32 instance_type_extra_specs_1_id:28 instance_type_extra_specs_1_key:29 instance_type_extra_specs_1_value:30 instance_type_extra_specs_1_instance_type_id:31 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── ordering: +13,+1 └── project ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) └── right-join (hash) ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 instance_type_extra_specs_1.id:28 key:29 value:30 instance_type_extra_specs_1.instance_type_id:31 instance_type_extra_specs_1.deleted:32 instance_type_extra_specs_1.deleted_at:33 instance_type_extra_specs_1.created_at:34 instance_type_extra_specs_1.updated_at:35 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,28) ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16), (28)-->(29-35), (29,31,32)~~>(28,30,33-35) ├── select @@ -2986,7 +2986,7 @@ sort ├── limit │ ├── columns: instance_types.id:1!null name:2 memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 instance_types.deleted:13!null instance_types.deleted_at:14 instance_types.created_at:15 instance_types.updated_at:16 true_agg:26 │ ├── internal-ordering: +13,+1 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-16,26), (7,13)-->(1-6,8-12,14-16), (2,13)~~>(1,3-12,14-16) │ ├── offset @@ -3145,12 +3145,12 @@ from (select flavors.created_at as flavors_created_at, ---- project ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -3159,7 +3159,7 @@ project │ └── fd: (25)-->(26-30), (26,28)-->(25,27,29,30) ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 flavors.created_at:14 flavors.updated_at:15 true_agg:23 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-12,14,15,23), (7)-->(1-6,8-12,14,15), (2)-->(1,3-12,14,15) │ ├── offset @@ -3307,18 +3307,18 @@ order by anon_1.flavors_flavorid asc, anon_1.flavors_id asc ---- sort ├── columns: anon_1_flavors_created_at:14 anon_1_flavors_updated_at:15 anon_1_flavors_id:1!null anon_1_flavors_name:2!null anon_1_flavors_memory_mb:3!null anon_1_flavors_vcpus:4!null anon_1_flavors_root_gb:5 anon_1_flavors_ephemeral_gb:6 anon_1_flavors_flavorid:7!null anon_1_flavors_swap:8!null anon_1_flavors_rxtx_factor:9 anon_1_flavors_vcpu_weight:10 anon_1_flavors_disabled:11 anon_1_flavors_is_public:12 anon_1_flavors_description:13 flavor_extra_specs_1_created_at:29 flavor_extra_specs_1_updated_at:30 flavor_extra_specs_1_id:25 flavor_extra_specs_1_key:26 flavor_extra_specs_1_value:27 flavor_extra_specs_1_flavor_id:28 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-15), (7)-->(1-6,8-15), (2)-->(1,3-15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── ordering: +7 └── project ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 description:13 flavors.created_at:14 flavors.updated_at:15 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-15), (7)-->(1-6,8-15), (2)-->(1,3-15), (25)-->(26-30), (26,28)-->(25,27,29,30) └── right-join (hash) ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 description:13 flavors.created_at:14 flavors.updated_at:15 true_agg:23 flavor_extra_specs_1.id:25 key:26 value:27 flavor_extra_specs_1.flavor_id:28 flavor_extra_specs_1.created_at:29 flavor_extra_specs_1.updated_at:30 - ├── immutable, side-effects, has-placeholder + ├── immutable, has-placeholder ├── key: (1,25) ├── fd: (1)-->(2-15,23), (7)-->(1-6,8-15), (2)-->(1,3-15), (25)-->(26-30), (26,28)-->(25,27,29,30) ├── scan flavor_extra_specs_1 @@ -3328,7 +3328,7 @@ sort ├── limit │ ├── columns: flavors.id:1!null name:2!null memory_mb:3!null vcpus:4!null root_gb:5 ephemeral_gb:6 flavorid:7!null swap:8!null rxtx_factor:9 vcpu_weight:10 disabled:11 is_public:12 description:13 flavors.created_at:14 flavors.updated_at:15 true_agg:23 │ ├── internal-ordering: +7 - │ ├── immutable, side-effects, has-placeholder + │ ├── immutable, has-placeholder │ ├── key: (1) │ ├── fd: (1)-->(2-15,23), (7)-->(1-6,8-15), (2)-->(1,3-15) │ ├── sort diff --git a/pkg/sql/opt/xform/testdata/external/tpcc b/pkg/sql/opt/xform/testdata/external/tpcc index fefe5b021614..2f6ec9787365 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc +++ b/pkg/sql/opt/xform/testdata/external/tpcc @@ -24,7 +24,7 @@ RETURNING d_tax, d_next_o_id project ├── columns: d_tax:9 d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(9,11) └── update district @@ -33,7 +33,7 @@ project ├── update-mapping: │ └── d_next_o_id_new:23 => d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1,2,9,11) └── project @@ -151,7 +151,7 @@ insert "order" │ └── column7:15 => o_all_local:8 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:9!null column2:10!null column3:11!null column4:12!null column5:13!null column6:14!null column7:15!null column16:16 │ ├── cardinality: [1 - 1] @@ -189,7 +189,7 @@ insert new_order │ └── column3:6 => no_w_id:3 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:4!null column2:5!null column3:6!null │ ├── cardinality: [1 - 1] @@ -312,11 +312,11 @@ update stock │ ├── s_order_cnt_new:37 => s_order_cnt:15 │ └── s_remote_cnt_new:38 => s_remote_cnt:16 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: s_quantity_new:35 s_ytd_new:36 s_order_cnt_new:37 s_remote_cnt_new:38 s_i_id:18!null s_w_id:19!null s_quantity:20 s_dist_01:21 s_dist_02:22 s_dist_03:23 s_dist_04:24 s_dist_05:25 s_dist_06:26 s_dist_07:27 s_dist_08:28 s_dist_09:29 s_dist_10:30 s_ytd:31 s_order_cnt:32 s_remote_cnt:33 s_data:34 ├── cardinality: [0 - 13] - ├── volatile, side-effects + ├── volatile ├── key: (18) ├── fd: ()-->(19), (18)-->(20-38) ├── scan stock @@ -339,7 +339,7 @@ update stock │ ├── key: (18) │ └── fd: ()-->(19), (18)-->(20-34) └── projections - ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile, side-effects] + ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 6 WHEN (7853, 0) THEN 9 WHEN (8497, 0) THEN 13 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 2 WHEN (41382, 0) THEN 3 WHEN (55952, 0) THEN 10 WHEN (64817, 0) THEN 31 WHEN (66335, 0) THEN 9 WHEN (76567, 0) THEN 7 WHEN (81680, 0) THEN 4 WHEN (89641, 0) THEN 13 WHEN (89905, 0) THEN 20 END [as=s_ytd_new:36, outer=(18,19)] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 1 WHEN (7853, 0) THEN 1 WHEN (8497, 0) THEN 2 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 1 WHEN (41382, 0) THEN 1 WHEN (55952, 0) THEN 1 WHEN (64817, 0) THEN 4 WHEN (66335, 0) THEN 2 WHEN (76567, 0) THEN 1 WHEN (81680, 0) THEN 1 WHEN (89641, 0) THEN 2 WHEN (89905, 0) THEN 4 END [as=s_order_cnt_new:37, outer=(18,19)] └── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 0 WHEN (7853, 0) THEN 0 WHEN (8497, 0) THEN 0 WHEN (10904, 0) THEN 0 WHEN (16152, 0) THEN 0 WHEN (41382, 0) THEN 0 WHEN (55952, 0) THEN 0 WHEN (64817, 0) THEN 0 WHEN (66335, 0) THEN 0 WHEN (76567, 0) THEN 0 WHEN (81680, 0) THEN 0 WHEN (89641, 0) THEN 0 WHEN (89905, 0) THEN 0 END [as=s_remote_cnt_new:38, outer=(18,19)] @@ -370,7 +370,7 @@ insert order_line │ └── column9:19 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: ol_amount:21 column20:20 column1:11!null column2:12!null column3:13!null column4:14!null column5:15!null column6:16!null column7:17!null column9:19!null │ ├── cardinality: [6 - 6] @@ -433,7 +433,7 @@ RETURNING w_name, w_street_1, w_street_2, w_city, w_state, w_zip project ├── columns: w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(2-7) └── update warehouse @@ -442,7 +442,7 @@ project ├── update-mapping: │ └── w_ytd:20 => warehouse.w_ytd:9 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project @@ -467,7 +467,7 @@ RETURNING d_name, d_street_1, d_street_2, d_city, d_state, d_zip project ├── columns: d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(3-8) └── update district @@ -476,7 +476,7 @@ project ├── update-mapping: │ └── d_ytd:24 => district.d_ytd:10 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project @@ -556,7 +556,7 @@ RETURNING project ├── columns: c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 case:49 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(4-17,49) ├── update customer @@ -568,7 +568,7 @@ project │ │ ├── c_payment_cnt_new:45 => c_payment_cnt:19 │ │ └── c_data_new:46 => c_data:21 │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project @@ -611,11 +611,11 @@ insert history │ └── column8:17 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column7:16!null column8:17!null column18:18 h_amount:19!null │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(10-14,16-19) │ └── (1343, 5, 10, 5, 10, '2019-08-26 16:50:41+00:00', '8 Kdcgphy3', gen_random_uuid(), 3860.61) @@ -811,7 +811,7 @@ RETURNING project ├── columns: o_d_id:2!null o_c_id:4 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: (2)-->(4) └── update "order" @@ -820,7 +820,7 @@ project ├── update-mapping: │ └── o_carrier_id_new:17 => o_carrier_id:6 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: ()-->(1,3), (2)-->(4) └── project @@ -882,7 +882,7 @@ update customer │ ├── c_balance:45 => customer.c_balance:17 │ └── c_delivery_cnt_new:43 => c_delivery_cnt:20 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: c_balance:45 c_delivery_cnt_new:43 c_id:22!null c_d_id:23!null c_w_id:24!null c_first:25 c_middle:26 c_last:27 c_street_1:28 c_street_2:29 c_city:30 c_state:31 c_zip:32 c_phone:33 c_since:34 c_credit:35 c_credit_lim:36 c_discount:37 customer.c_balance:38 c_ytd_payment:39 c_payment_cnt:40 c_delivery_cnt:41 c_data:42 ├── cardinality: [0 - 10] @@ -928,7 +928,7 @@ delete new_order ├── columns: ├── fetch columns: no_o_id:4 no_d_id:5 no_w_id:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan new_order ├── columns: no_o_id:4!null no_d_id:5!null no_w_id:6!null ├── constraint: /6/5/4 @@ -969,7 +969,7 @@ update order_line ├── update-mapping: │ └── ol_delivery_d_new:21 => ol_delivery_d:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: ol_delivery_d_new:21!null ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null ol_number:14!null ol_i_id:15!null ol_supply_w_id:16 ol_delivery_d:17 ol_quantity:18 ol_amount:19 ol_dist_info:20 ├── key: (12,14) diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats index d80c06765b58..f8f5e18fab42 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats @@ -27,7 +27,7 @@ RETURNING d_tax, d_next_o_id project ├── columns: d_tax:9 d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(9,11) └── update district @@ -36,7 +36,7 @@ project ├── update-mapping: │ └── d_next_o_id_new:23 => d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1,2,9,11) └── project @@ -154,7 +154,7 @@ insert "order" │ └── column7:15 => o_all_local:8 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:9!null column2:10!null column3:11!null column4:12!null column5:13!null column6:14!null column7:15!null column16:16 │ ├── cardinality: [1 - 1] @@ -192,7 +192,7 @@ insert new_order │ └── column3:6 => no_w_id:3 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:4!null column2:5!null column3:6!null │ ├── cardinality: [1 - 1] @@ -315,11 +315,11 @@ update stock │ ├── s_order_cnt_new:37 => s_order_cnt:15 │ └── s_remote_cnt_new:38 => s_remote_cnt:16 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: s_quantity_new:35 s_ytd_new:36 s_order_cnt_new:37 s_remote_cnt_new:38 s_i_id:18!null s_w_id:19!null s_quantity:20 s_dist_01:21 s_dist_02:22 s_dist_03:23 s_dist_04:24 s_dist_05:25 s_dist_06:26 s_dist_07:27 s_dist_08:28 s_dist_09:29 s_dist_10:30 s_ytd:31 s_order_cnt:32 s_remote_cnt:33 s_data:34 ├── cardinality: [0 - 13] - ├── volatile, side-effects + ├── volatile ├── key: (18) ├── fd: ()-->(19), (18)-->(20-38) ├── scan stock @@ -342,7 +342,7 @@ update stock │ ├── key: (18) │ └── fd: ()-->(19), (18)-->(20-34) └── projections - ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile, side-effects] + ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 6 WHEN (7853, 0) THEN 9 WHEN (8497, 0) THEN 13 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 2 WHEN (41382, 0) THEN 3 WHEN (55952, 0) THEN 10 WHEN (64817, 0) THEN 31 WHEN (66335, 0) THEN 9 WHEN (76567, 0) THEN 7 WHEN (81680, 0) THEN 4 WHEN (89641, 0) THEN 13 WHEN (89905, 0) THEN 20 END [as=s_ytd_new:36, outer=(18,19)] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 1 WHEN (7853, 0) THEN 1 WHEN (8497, 0) THEN 2 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 1 WHEN (41382, 0) THEN 1 WHEN (55952, 0) THEN 1 WHEN (64817, 0) THEN 4 WHEN (66335, 0) THEN 2 WHEN (76567, 0) THEN 1 WHEN (81680, 0) THEN 1 WHEN (89641, 0) THEN 2 WHEN (89905, 0) THEN 4 END [as=s_order_cnt_new:37, outer=(18,19)] └── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 0 WHEN (7853, 0) THEN 0 WHEN (8497, 0) THEN 0 WHEN (10904, 0) THEN 0 WHEN (16152, 0) THEN 0 WHEN (41382, 0) THEN 0 WHEN (55952, 0) THEN 0 WHEN (64817, 0) THEN 0 WHEN (66335, 0) THEN 0 WHEN (76567, 0) THEN 0 WHEN (81680, 0) THEN 0 WHEN (89641, 0) THEN 0 WHEN (89905, 0) THEN 0 END [as=s_remote_cnt_new:38, outer=(18,19)] @@ -373,7 +373,7 @@ insert order_line │ └── column9:19 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: ol_amount:21 column20:20 column1:11!null column2:12!null column3:13!null column4:14!null column5:15!null column6:16!null column7:17!null column9:19!null │ ├── cardinality: [6 - 6] @@ -436,7 +436,7 @@ RETURNING w_name, w_street_1, w_street_2, w_city, w_state, w_zip project ├── columns: w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(2-7) └── update warehouse @@ -445,7 +445,7 @@ project ├── update-mapping: │ └── w_ytd:20 => warehouse.w_ytd:9 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project @@ -470,7 +470,7 @@ RETURNING d_name, d_street_1, d_street_2, d_city, d_state, d_zip project ├── columns: d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(3-8) └── update district @@ -479,7 +479,7 @@ project ├── update-mapping: │ └── d_ytd:24 => district.d_ytd:10 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project @@ -559,7 +559,7 @@ RETURNING project ├── columns: c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 case:49 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(4-17,49) ├── update customer @@ -571,7 +571,7 @@ project │ │ ├── c_payment_cnt_new:45 => c_payment_cnt:19 │ │ └── c_data_new:46 => c_data:21 │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project @@ -614,11 +614,11 @@ insert history │ └── column8:17 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column7:16!null column8:17!null column18:18 h_amount:19!null │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(10-14,16-19) │ └── (1343, 5, 10, 5, 10, '2019-08-26 16:50:41+00:00', '8 Kdcgphy3', gen_random_uuid(), 3860.61) @@ -814,7 +814,7 @@ RETURNING project ├── columns: o_d_id:2!null o_c_id:4 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: (2)-->(4) └── update "order" @@ -823,7 +823,7 @@ project ├── update-mapping: │ └── o_carrier_id_new:17 => o_carrier_id:6 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: ()-->(1,3), (2)-->(4) └── project @@ -885,7 +885,7 @@ update customer │ ├── c_balance:45 => customer.c_balance:17 │ └── c_delivery_cnt_new:43 => c_delivery_cnt:20 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: c_balance:45 c_delivery_cnt_new:43 c_id:22!null c_d_id:23!null c_w_id:24!null c_first:25 c_middle:26 c_last:27 c_street_1:28 c_street_2:29 c_city:30 c_state:31 c_zip:32 c_phone:33 c_since:34 c_credit:35 c_credit_lim:36 c_discount:37 customer.c_balance:38 c_ytd_payment:39 c_payment_cnt:40 c_delivery_cnt:41 c_data:42 ├── cardinality: [0 - 10] @@ -931,7 +931,7 @@ delete new_order ├── columns: ├── fetch columns: no_o_id:4 no_d_id:5 no_w_id:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan new_order ├── columns: no_o_id:4!null no_d_id:5!null no_w_id:6!null ├── constraint: /6/5/4 @@ -971,7 +971,7 @@ update order_line ├── update-mapping: │ └── ol_delivery_d_new:21 => ol_delivery_d:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: ol_delivery_d_new:21!null ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null ol_number:14!null ol_i_id:15!null ol_supply_w_id:16 ol_delivery_d:17 ol_quantity:18 ol_amount:19 ol_dist_info:20 ├── key: (12,14) diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats index 8f9f9cc2c178..08eeb20ae242 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats @@ -21,7 +21,7 @@ RETURNING d_tax, d_next_o_id project ├── columns: d_tax:9 d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(9,11) └── update district @@ -30,7 +30,7 @@ project ├── update-mapping: │ └── d_next_o_id_new:23 => d_next_o_id:11 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1,2,9,11) └── project @@ -148,7 +148,7 @@ insert "order" │ └── column7:15 => o_all_local:8 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:9!null column2:10!null column3:11!null column4:12!null column5:13!null column6:14!null column7:15!null column16:16 │ ├── cardinality: [1 - 1] @@ -186,7 +186,7 @@ insert new_order │ └── column3:6 => no_w_id:3 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:4!null column2:5!null column3:6!null │ ├── cardinality: [1 - 1] @@ -309,11 +309,11 @@ update stock │ ├── s_order_cnt_new:37 => s_order_cnt:15 │ └── s_remote_cnt_new:38 => s_remote_cnt:16 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: s_quantity_new:35 s_ytd_new:36 s_order_cnt_new:37 s_remote_cnt_new:38 s_i_id:18!null s_w_id:19!null s_quantity:20 s_dist_01:21 s_dist_02:22 s_dist_03:23 s_dist_04:24 s_dist_05:25 s_dist_06:26 s_dist_07:27 s_dist_08:28 s_dist_09:29 s_dist_10:30 s_ytd:31 s_order_cnt:32 s_remote_cnt:33 s_data:34 ├── cardinality: [0 - 13] - ├── volatile, side-effects + ├── volatile ├── key: (18) ├── fd: ()-->(19), (18)-->(20-38) ├── scan stock @@ -336,7 +336,7 @@ update stock │ ├── key: (18) │ └── fd: ()-->(19), (18)-->(20-34) └── projections - ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile, side-effects] + ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:35, outer=(18,19), volatile] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 6 WHEN (7853, 0) THEN 9 WHEN (8497, 0) THEN 13 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 2 WHEN (41382, 0) THEN 3 WHEN (55952, 0) THEN 10 WHEN (64817, 0) THEN 31 WHEN (66335, 0) THEN 9 WHEN (76567, 0) THEN 7 WHEN (81680, 0) THEN 4 WHEN (89641, 0) THEN 13 WHEN (89905, 0) THEN 20 END [as=s_ytd_new:36, outer=(18,19)] ├── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 1 WHEN (7853, 0) THEN 1 WHEN (8497, 0) THEN 2 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 1 WHEN (41382, 0) THEN 1 WHEN (55952, 0) THEN 1 WHEN (64817, 0) THEN 4 WHEN (66335, 0) THEN 2 WHEN (76567, 0) THEN 1 WHEN (81680, 0) THEN 1 WHEN (89641, 0) THEN 2 WHEN (89905, 0) THEN 4 END [as=s_order_cnt_new:37, outer=(18,19)] └── CASE (s_i_id:18, s_w_id:19) WHEN (6823, 0) THEN 0 WHEN (7853, 0) THEN 0 WHEN (8497, 0) THEN 0 WHEN (10904, 0) THEN 0 WHEN (16152, 0) THEN 0 WHEN (41382, 0) THEN 0 WHEN (55952, 0) THEN 0 WHEN (64817, 0) THEN 0 WHEN (66335, 0) THEN 0 WHEN (76567, 0) THEN 0 WHEN (81680, 0) THEN 0 WHEN (89641, 0) THEN 0 WHEN (89905, 0) THEN 0 END [as=s_remote_cnt_new:38, outer=(18,19)] @@ -367,7 +367,7 @@ insert order_line │ └── column9:19 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: ol_amount:21 column20:20 column1:11!null column2:12!null column3:13!null column4:14!null column5:15!null column6:16!null column7:17!null column9:19!null │ ├── cardinality: [6 - 6] @@ -430,7 +430,7 @@ RETURNING w_name, w_street_1, w_street_2, w_city, w_state, w_zip project ├── columns: w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(2-7) └── update warehouse @@ -439,7 +439,7 @@ project ├── update-mapping: │ └── w_ytd:20 => warehouse.w_ytd:9 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project @@ -464,7 +464,7 @@ RETURNING d_name, d_street_1, d_street_2, d_city, d_state, d_zip project ├── columns: d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(3-8) └── update district @@ -473,7 +473,7 @@ project ├── update-mapping: │ └── d_ytd:24 => district.d_ytd:10 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project @@ -553,7 +553,7 @@ RETURNING project ├── columns: c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 case:49 ├── cardinality: [0 - 1] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(4-17,49) ├── update customer @@ -565,7 +565,7 @@ project │ │ ├── c_payment_cnt_new:45 => c_payment_cnt:19 │ │ └── c_data_new:46 => c_data:21 │ ├── cardinality: [0 - 1] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project @@ -608,11 +608,11 @@ insert history │ └── column8:17 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── values │ ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column7:16!null column8:17!null column18:18 h_amount:19!null │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(10-14,16-19) │ └── (1343, 5, 10, 5, 10, '2019-08-26 16:50:41+00:00', '8 Kdcgphy3', gen_random_uuid(), 3860.61) @@ -812,7 +812,7 @@ RETURNING project ├── columns: o_d_id:2!null o_c_id:4 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: (2)-->(4) └── update "order" @@ -821,7 +821,7 @@ project ├── update-mapping: │ └── o_carrier_id_new:17 => o_carrier_id:6 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (2) ├── fd: ()-->(1,3), (2)-->(4) └── project @@ -883,7 +883,7 @@ update customer │ ├── c_balance:45 => customer.c_balance:17 │ └── c_delivery_cnt_new:43 => c_delivery_cnt:20 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: c_balance:45 c_delivery_cnt_new:43 c_id:22!null c_d_id:23!null c_w_id:24!null c_first:25 c_middle:26 c_last:27 c_street_1:28 c_street_2:29 c_city:30 c_state:31 c_zip:32 c_phone:33 c_since:34 c_credit:35 c_credit_lim:36 c_discount:37 customer.c_balance:38 c_ytd_payment:39 c_payment_cnt:40 c_delivery_cnt:41 c_data:42 ├── cardinality: [0 - 10] @@ -929,7 +929,7 @@ delete new_order ├── columns: ├── fetch columns: no_o_id:4 no_d_id:5 no_w_id:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan new_order ├── columns: no_o_id:4!null no_d_id:5!null no_w_id:6!null ├── constraint: /6/5/4 @@ -969,7 +969,7 @@ update order_line ├── update-mapping: │ └── ol_delivery_d_new:21 => ol_delivery_d:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: ol_delivery_d_new:21!null ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null ol_number:14!null ol_i_id:15!null ol_supply_w_id:16 ol_delivery_d:17 ol_quantity:18 ol_amount:19 ol_dist_info:20 ├── key: (12,14) diff --git a/pkg/sql/opt/xform/testdata/external/tpch b/pkg/sql/opt/xform/testdata/external/tpch index bb48660ee701..d36e9faba1cc 100644 --- a/pkg/sql/opt/xform/testdata/external/tpch +++ b/pkg/sql/opt/xform/testdata/external/tpch @@ -833,13 +833,13 @@ ORDER BY ---- sort ├── columns: o_year:61 mkt_share:66!null - ├── immutable, side-effects + ├── immutable ├── key: (61) ├── fd: (61)-->(66) ├── ordering: +61 └── project ├── columns: mkt_share:66!null o_year:61 - ├── immutable, side-effects + ├── immutable ├── key: (61) ├── fd: (61)-->(66) ├── group-by @@ -953,7 +953,7 @@ sort │ └── sum [as=sum:65, outer=(62)] │ └── volume:62 └── projections - └── sum:64 / sum:65 [as=mkt_share:66, outer=(64,65), immutable, side-effects] + └── sum:64 / sum:65 [as=mkt_share:66, outer=(64,65), immutable] # -------------------------------------------------- # Q9 @@ -1536,7 +1536,7 @@ WHERE project ├── columns: promo_revenue:30 ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(30) ├── scalar-group-by @@ -1574,7 +1574,7 @@ project │ └── sum [as=sum:29, outer=(28)] │ └── column28:28 └── projections - └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, outer=(27,29), immutable, side-effects] + └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, outer=(27,29), immutable] # -------------------------------------------------- # Q15 diff --git a/pkg/sql/opt/xform/testdata/external/tpch-no-stats b/pkg/sql/opt/xform/testdata/external/tpch-no-stats index 83d687d29df9..693f13e12f2b 100644 --- a/pkg/sql/opt/xform/testdata/external/tpch-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpch-no-stats @@ -854,13 +854,13 @@ ORDER BY ---- sort ├── columns: o_year:61 mkt_share:66!null - ├── immutable, side-effects + ├── immutable ├── key: (61) ├── fd: (61)-->(66) ├── ordering: +61 └── project ├── columns: mkt_share:66!null o_year:61 - ├── immutable, side-effects + ├── immutable ├── key: (61) ├── fd: (61)-->(66) ├── group-by @@ -974,7 +974,7 @@ sort │ └── sum [as=sum:65, outer=(62)] │ └── volume:62 └── projections - └── sum:64 / sum:65 [as=mkt_share:66, outer=(64,65), immutable, side-effects] + └── sum:64 / sum:65 [as=mkt_share:66, outer=(64,65), immutable] # -------------------------------------------------- # Q9 @@ -1531,7 +1531,7 @@ WHERE project ├── columns: promo_revenue:30 ├── cardinality: [1 - 1] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(30) ├── scalar-group-by @@ -1568,7 +1568,7 @@ project │ └── sum [as=sum:29, outer=(28)] │ └── column28:28 └── projections - └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, outer=(27,29), immutable, side-effects] + └── (sum:27 * 100.0) / sum:29 [as=promo_revenue:30, outer=(27,29), immutable] # -------------------------------------------------- # Q15 diff --git a/pkg/sql/opt/xform/testdata/external/trading b/pkg/sql/opt/xform/testdata/external/trading index a0410fa7a677..2c8dc7bb7381 100644 --- a/pkg/sql/opt/xform/testdata/external/trading +++ b/pkg/sql/opt/xform/testdata/external/trading @@ -1232,11 +1232,11 @@ insert transactions │ ├── column6:13 => operationid:6 │ └── column14:14 => version:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── values ├── columns: column1:8!null column2:9!null column3:10!null column4:11!null column5:12!null column6:13!null column14:14 ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(8-14) └── (1, false, '2020-03-01 00:00:00+00:00', 'the-account', 'the-customer', '70f03eb1-4f58-4c26-b72d-c524a9d537dd', cluster_logical_timestamp()) @@ -1263,18 +1263,18 @@ upsert transactions │ ├── column5:12 => customername:5 │ └── column6:13 => operationid:6 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── left-join (cross) ├── columns: column1:8!null column2:9!null column3:10!null column4:11!null column5:12!null column6:13!null column14:14 dealerid:15 isbuy:16 date:17 accountname:18 customername:19 operationid:20 version:21 ├── cardinality: [1 - 1] ├── multiplicity: left-rows(exactly-one), right-rows(exactly-one) - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(8-21) ├── values │ ├── columns: column1:8!null column2:9!null column3:10!null column4:11!null column5:12!null column6:13!null column14:14 │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(8-14) │ └── (1, false, '2020-03-01 00:00:00+00:00', 'the-account', 'the-customer', '70f03eb1-4f58-4c26-b72d-c524a9d537dd', cluster_logical_timestamp()) @@ -1319,11 +1319,11 @@ upsert transactiondetails │ └── buyprice:30 => transactiondetails.buyprice:8 ├── input binding: &2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: upsert_dealerid:31 upsert_isbuy:32 upsert_transactiondate:33 upsert_cardid:34 sellprice:29 buyprice:30 "?column?":11!null bool:12!null current_timestamp:13!null int8:14!null int8:15!null column18:18 transactiondetails.dealerid:21 transactiondetails.isbuy:22 transactiondate:23 cardid:24 quantity:25 transactiondetails.sellprice:26 transactiondetails.buyprice:27 transactiondetails.version:28 │ ├── cardinality: [1 - 2] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (14,15) │ ├── fd: ()-->(11-13), (14,15)-->(18,21-33), (21-25)-->(26-28), (21)-->(31), (21,22)-->(32), (21,23)-->(33), (14,21,24)-->(34) │ ├── left-join (lookup transactiondetails) @@ -1331,7 +1331,7 @@ upsert transactiondetails │ │ ├── key columns: [11 12 13 14 15] = [21 22 23 24 25] │ │ ├── lookup columns are key │ │ ├── cardinality: [1 - 2] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (14,15) │ │ ├── fd: ()-->(11-13), (14,15)-->(18-28), (21-25)-->(26-28) │ │ ├── ensure-upsert-distinct-on @@ -1339,13 +1339,13 @@ upsert transactiondetails │ │ │ ├── grouping columns: int8:14!null int8:15!null │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" │ │ │ ├── cardinality: [1 - 2] - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: (14,15) │ │ │ ├── fd: ()-->(11-13), (14,15)-->(11-13,18-20) │ │ │ ├── project │ │ │ │ ├── columns: sellprice:19 buyprice:20 column18:18 "?column?":11!null bool:12!null current_timestamp:13!null int8:14!null int8:15!null │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── fd: ()-->(11-13) │ │ │ │ ├── values │ │ │ │ │ ├── columns: detail_b:54!null detail_c:55!null detail_q:56!null detail_s:57!null @@ -1355,7 +1355,7 @@ upsert transactiondetails │ │ │ │ └── projections │ │ │ │ ├── crdb_internal.round_decimal_values(detail_s:57::STRING::DECIMAL(10,4), 4) [as=sellprice:19, outer=(57), immutable] │ │ │ │ ├── crdb_internal.round_decimal_values(detail_b:54::STRING::DECIMAL(10,4), 4) [as=buyprice:20, outer=(54), immutable] - │ │ │ │ ├── cluster_logical_timestamp() [as=column18:18, volatile, side-effects] + │ │ │ │ ├── cluster_logical_timestamp() [as=column18:18, volatile] │ │ │ │ ├── 1 [as="?column?":11] │ │ │ │ ├── false [as=bool:12] │ │ │ │ ├── '2017-05-10 13:00:00+00:00' [as=current_timestamp:13] @@ -1419,7 +1419,7 @@ delete inventorydetails ├── columns: ├── fetch columns: dealerid:6 cardid:7 accountname:8 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan inventorydetails@inventorydetails_auto_index_inventorydetailscardidkey ├── columns: dealerid:6!null cardid:7!null accountname:8!null ├── constraint: /7/6/8 @@ -1451,7 +1451,7 @@ update ci ├── update-mapping: │ └── actualinventory_new:33 => actualinventory:12 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: actualinventory_new:33 ci.dealerid:15!null ci.cardid:16!null buyprice:17!null sellprice:18!null discount:19!null desiredinventory:20!null actualinventory:21!null maxinventory:22!null ci.version:23!null c:24!null q:25!null ├── key: (16) diff --git a/pkg/sql/opt/xform/testdata/external/trading-mutation b/pkg/sql/opt/xform/testdata/external/trading-mutation index f1d12d9e7249..1398b6524788 100644 --- a/pkg/sql/opt/xform/testdata/external/trading-mutation +++ b/pkg/sql/opt/xform/testdata/external/trading-mutation @@ -1237,11 +1237,11 @@ insert transactions │ ├── column16:16 => version:7 │ └── column17:17 => olddate:8 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── values ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column6:15!null column16:16 column17:17!null ├── cardinality: [1 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(10-17) └── (1, false, '2020-03-01 00:00:00+00:00', 'the-account', 'the-customer', '70f03eb1-4f58-4c26-b72d-c524a9d537dd', cluster_logical_timestamp(), '0001-01-01 00:00:00+00:00') @@ -1270,18 +1270,18 @@ upsert transactions │ ├── column6:15 => operationid:6 │ └── column17:17 => olddate:8 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── left-join (cross) ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column6:15!null column16:16 column17:17!null dealerid:18 isbuy:19 date:20 accountname:21 customername:22 operationid:23 version:24 olddate:25 extra:26 ├── cardinality: [1 - 1] ├── multiplicity: left-rows(exactly-one), right-rows(exactly-one) - ├── volatile, side-effects + ├── volatile ├── key: () ├── fd: ()-->(10-26) ├── values │ ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null column5:14!null column6:15!null column16:16 column17:17!null │ ├── cardinality: [1 - 1] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: () │ ├── fd: ()-->(10-17) │ └── (1, false, '2020-03-01 00:00:00+00:00', 'the-account', 'the-customer', '70f03eb1-4f58-4c26-b72d-c524a9d537dd', cluster_logical_timestamp(), '0001-01-01 00:00:00+00:00') @@ -1328,11 +1328,11 @@ upsert transactiondetails │ └── upsert_discount:44 => transactiondetails.discount:10 ├── input binding: &2 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: upsert_dealerid:38 upsert_isbuy:39 upsert_transactiondate:40 upsert_cardid:41 upsert_discount:44 sellprice:35 buyprice:36 "?column?":13!null bool:14!null current_timestamp:15!null int8:16!null int8:17!null column20:20 discount:24!null transactiondetails.dealerid:25 transactiondetails.isbuy:26 transactiondate:27 cardid:28 quantity:29 transactiondetails.sellprice:30 transactiondetails.buyprice:31 transactiondetails.version:32 transactiondetails.discount:33 transactiondetails.extra:34 │ ├── cardinality: [1 - 2] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (16,17) │ ├── fd: ()-->(13-15,24), (16,17)-->(20,25-36,38-40,44), (25-29)-->(30-34), (25)-->(38), (25,26)-->(39), (25,27)-->(40), (16,25,28)-->(41) │ ├── left-join (lookup transactiondetails) @@ -1340,7 +1340,7 @@ upsert transactiondetails │ │ ├── key columns: [13 14 15 16 17] = [25 26 27 28 29] │ │ ├── lookup columns are key │ │ ├── cardinality: [1 - 2] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── key: (16,17) │ │ ├── fd: ()-->(13-15,24), (16,17)-->(20,22,23,25-34), (25-29)-->(30-34) │ │ ├── ensure-upsert-distinct-on @@ -1348,13 +1348,13 @@ upsert transactiondetails │ │ │ ├── grouping columns: int8:16!null int8:17!null │ │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" │ │ │ ├── cardinality: [1 - 2] - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── key: (16,17) │ │ │ ├── fd: ()-->(13-15,24), (16,17)-->(13-15,20,22-24) │ │ │ ├── project │ │ │ │ ├── columns: sellprice:22 buyprice:23 discount:24!null column20:20 "?column?":13!null bool:14!null current_timestamp:15!null int8:16!null int8:17!null │ │ │ │ ├── cardinality: [2 - 2] - │ │ │ │ ├── volatile, side-effects + │ │ │ │ ├── volatile │ │ │ │ ├── fd: ()-->(13-15,24) │ │ │ │ ├── values │ │ │ │ │ ├── columns: detail_b:64!null detail_c:65!null detail_q:66!null detail_s:67!null @@ -1365,7 +1365,7 @@ upsert transactiondetails │ │ │ │ ├── crdb_internal.round_decimal_values(detail_s:67::STRING::DECIMAL(10,4), 4) [as=sellprice:22, outer=(67), immutable] │ │ │ │ ├── crdb_internal.round_decimal_values(detail_b:64::STRING::DECIMAL(10,4), 4) [as=buyprice:23, outer=(64), immutable] │ │ │ │ ├── 0.0000 [as=discount:24] - │ │ │ │ ├── cluster_logical_timestamp() [as=column20:20, volatile, side-effects] + │ │ │ │ ├── cluster_logical_timestamp() [as=column20:20, volatile] │ │ │ │ ├── 1 [as="?column?":13] │ │ │ │ ├── false [as=bool:14] │ │ │ │ ├── '2017-05-10 13:00:00+00:00' [as=current_timestamp:15] @@ -1432,7 +1432,7 @@ delete inventorydetails ├── columns: ├── fetch columns: dealerid:8 cardid:9 accountname:10 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── scan inventorydetails@inventorydetails_auto_index_inventorydetailscardidkey ├── columns: dealerid:8!null cardid:9!null accountname:10!null ├── constraint: /9/8/10 @@ -1467,7 +1467,7 @@ update ci │ ├── column44:44 => notes:16 │ └── column45:45 => oldinventory:17 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: discountbuyprice:47 column44:44 column45:45!null actualinventory_new:43 ci.dealerid:19!null ci.cardid:20!null buyprice:21!null sellprice:22!null discount:23!null desiredinventory:24!null actualinventory:25!null maxinventory:26!null ci.version:27!null ci.discountbuyprice:28 notes:29 oldinventory:30 ci.extra:31 c:32!null q:33!null ├── immutable diff --git a/pkg/sql/opt/xform/testdata/external/ycsb b/pkg/sql/opt/xform/testdata/external/ycsb index 7c990e3aa20a..3412e23d76b3 100644 --- a/pkg/sql/opt/xform/testdata/external/ycsb +++ b/pkg/sql/opt/xform/testdata/external/ycsb @@ -29,7 +29,7 @@ update usertable ├── update-mapping: │ └── field5_new:23 => field5:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: field5_new:23!null ycsb_key:12!null field5:18 ├── cardinality: [0 - 1] @@ -105,7 +105,7 @@ insert usertable │ ├── column10:21 => field8:10 │ └── column11:22 => field9:11 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── values ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column6:17!null column7:18!null column8:19!null column9:20!null column10:21!null column11:22!null ├── cardinality: [1 - 1] @@ -173,7 +173,7 @@ update usertable ├── update-mapping: │ └── field5_new:23 => field5:7 ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations └── project ├── columns: field5_new:23!null ycsb_key:12!null field5:18 ├── cardinality: [0 - 1] diff --git a/pkg/sql/opt/xform/testdata/physprops/limit_hint b/pkg/sql/opt/xform/testdata/physprops/limit_hint index 35245f274f88..fbe0b8f0c2d3 100644 --- a/pkg/sql/opt/xform/testdata/physprops/limit_hint +++ b/pkg/sql/opt/xform/testdata/physprops/limit_hint @@ -387,11 +387,11 @@ SELECT *, generate_series(1, t.x) FROM t LIMIT 10 limit ├── columns: x:1!null y:2 z:3 generate_series:4 ├── cardinality: [0 - 10] - ├── immutable, side-effects + ├── immutable ├── fd: (1)-->(2,3) ├── project-set │ ├── columns: x:1!null y:2 z:3 generate_series:4 - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: (1)-->(2,3) │ ├── limit hint: 10.00 │ ├── scan t @@ -400,7 +400,7 @@ limit │ │ ├── fd: (1)-->(2,3) │ │ └── limit hint: 10.00 │ └── zip - │ └── generate_series(1, x:1) [outer=(1), immutable, side-effects] + │ └── generate_series(1, x:1) [outer=(1), immutable] └── 10 # -------------------------------------------------- @@ -507,26 +507,26 @@ SELECT DISTINCT t44683.c0 FROM t44683, v44683 LIMIT -1; limit ├── columns: c0:1 ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(1) ├── distinct-on │ ├── columns: c0:1 │ ├── grouping columns: c0:1 │ ├── cardinality: [0 - 0] - │ ├── immutable, side-effects + │ ├── immutable │ ├── key: (1) │ ├── limit hint: 1.00 │ └── inner-join (cross) │ ├── columns: c0:1 │ ├── cardinality: [0 - 0] │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ ├── immutable, side-effects + │ ├── immutable │ ├── scan t44683 │ │ └── columns: c0:1 │ ├── limit │ │ ├── cardinality: [0 - 0] - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── key: () │ │ ├── scan t44683 │ │ │ └── limit hint: 1.00 @@ -554,13 +554,13 @@ SELECT * FROM v0, t0 NATURAL JOIN t1 LIMIT -1 project ├── columns: c0:3!null c0:4!null ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(3,4) └── limit ├── columns: "?column?":3!null t0.c0:4!null t1.c0:6!null ├── cardinality: [0 - 0] - ├── immutable, side-effects + ├── immutable ├── key: () ├── fd: ()-->(3,4,6) ├── inner-join (lookup t0@t0_c0_key) @@ -568,26 +568,26 @@ project │ ├── key columns: [6] = [4] │ ├── lookup columns are key │ ├── cardinality: [0 - 0] - │ ├── immutable, side-effects + │ ├── immutable │ ├── fd: ()-->(3), (4)==(6), (6)==(4) │ ├── limit hint: 1.00 │ ├── inner-join (cross) │ │ ├── columns: "?column?":3!null t1.c0:6 │ │ ├── cardinality: [0 - 0] │ │ ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more) - │ │ ├── immutable, side-effects + │ │ ├── immutable │ │ ├── fd: ()-->(3) │ │ ├── scan t1 │ │ │ └── columns: t1.c0:6 │ │ ├── project │ │ │ ├── columns: "?column?":3!null │ │ │ ├── cardinality: [0 - 0] - │ │ │ ├── immutable, side-effects + │ │ │ ├── immutable │ │ │ ├── key: () │ │ │ ├── fd: ()-->(3) │ │ │ ├── limit │ │ │ │ ├── cardinality: [0 - 0] - │ │ │ │ ├── immutable, side-effects + │ │ │ │ ├── immutable │ │ │ │ ├── key: () │ │ │ │ ├── scan t1 │ │ │ │ │ └── limit hint: 1.00 diff --git a/pkg/sql/opt/xform/testdata/physprops/ordering b/pkg/sql/opt/xform/testdata/physprops/ordering index be26327a4521..570845fc9802 100644 --- a/pkg/sql/opt/xform/testdata/physprops/ordering +++ b/pkg/sql/opt/xform/testdata/physprops/ordering @@ -1454,13 +1454,13 @@ SELECT * FROM [INSERT INTO abc SELECT * FROM xyz ORDER BY y, z LIMIT 2 RETURNING sort ├── columns: a:7!null b:8!null c:9!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (7-9) ├── ordering: +8 └── with &1 ├── columns: a:7!null b:8!null c:9!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (7-9) ├── insert abc │ ├── columns: abc.a:1!null abc.b:2!null abc.c:3!null @@ -1469,7 +1469,7 @@ sort │ │ ├── y:5 => abc.b:2 │ │ └── z:6 => abc.c:3 │ ├── cardinality: [0 - 2] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (1-3) │ └── limit │ ├── columns: x:4!null y:5!null z:6!null @@ -1503,12 +1503,12 @@ ORDER BY y sort ├── columns: x:9!null y:10!null z:11!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── ordering: +10 └── with &1 ├── columns: x:9!null y:10!null z:11!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── insert xyz │ ├── columns: xyz.x:1!null xyz.y:2!null xyz.z:3!null │ ├── insert-mapping: @@ -1516,7 +1516,7 @@ sort │ │ ├── c:6 => xyz.y:2 │ │ └── d:7 => xyz.z:3 │ ├── cardinality: [0 - 2] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── scan abcd@cd │ ├── columns: b:5 c:6 d:7 │ └── limit: 2 @@ -1539,13 +1539,13 @@ ORDER BY y sort ├── columns: x:9!null y:10!null z:11!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (9)==(10), (10)==(9) ├── ordering: +(9|10) [actual: +9] └── with &1 ├── columns: x:9!null y:10!null z:11!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (9)==(10), (10)==(9) ├── insert xyz │ ├── columns: xyz.x:1!null xyz.y:2!null xyz.z:3!null @@ -1554,7 +1554,7 @@ sort │ │ ├── c:6 => xyz.y:2 │ │ └── d:7 => xyz.z:3 │ ├── cardinality: [0 - 2] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── scan abcd@cd │ ├── columns: b:5 c:6 d:7 │ └── limit: 2 @@ -1578,7 +1578,7 @@ SELECT * FROM [INSERT INTO abc SELECT * FROM xyz ORDER BY y, z RETURNING *] ---- with &1 ├── columns: a:7!null b:8!null c:9!null - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: (7-9) ├── insert abc │ ├── columns: abc.a:1!null abc.b:2!null abc.c:3!null @@ -1586,7 +1586,7 @@ with &1 │ │ ├── x:4 => abc.a:1 │ │ ├── y:5 => abc.b:2 │ │ └── z:6 => abc.c:3 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (1-3) │ └── scan xyz │ ├── columns: x:4!null y:5!null z:6!null @@ -1609,16 +1609,16 @@ SELECT * FROM [UPDATE abcd SET (a, b)=(1, 2) RETURNING *] ORDER BY c ---- sort ├── columns: a:13!null b:14!null c:15 d:16 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(13,14) ├── ordering: +15 opt(13,14) [actual: +15] └── with &1 ├── columns: a:13!null b:14!null c:15 d:16 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: ()-->(13,14) ├── project │ ├── columns: abcd.a:1!null abcd.b:2!null abcd.c:3 abcd.d:4 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── fd: ()-->(1,2) │ └── update abcd │ ├── columns: abcd.a:1!null abcd.b:2!null abcd.c:3 abcd.d:4 rowid:5!null @@ -1626,7 +1626,7 @@ sort │ ├── update-mapping: │ │ ├── a_new:11 => abcd.a:1 │ │ └── b_new:12 => abcd.b:2 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: ()-->(1,2), (5)-->(3,4) │ └── project @@ -1658,23 +1658,23 @@ ORDER BY c, d sort ├── columns: a:12 b:13 c:14 d:15 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── ordering: +14,+15 └── with &1 ├── columns: a:12 b:13 c:14 d:15 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── update abcd │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 rowid:5!null │ ├── fetch columns: abcd.a:6 abcd.b:7 abcd.c:8 abcd.d:9 rowid:10 │ ├── update-mapping: │ │ └── b_new:11 => abcd.b:2 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: (5)-->(1-4) │ └── project @@ -1710,25 +1710,25 @@ ORDER BY b, d sort ├── columns: a:12 b:13!null c:14!null d:15 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (13)==(14), (14)==(13) ├── ordering: +(13|14),+15 [actual: +13,+15] └── with &1 ├── columns: a:12 b:13!null c:14!null d:15 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (13)==(14), (14)==(13) ├── project │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── update abcd │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 rowid:5!null │ ├── fetch columns: abcd.a:6 abcd.b:7 abcd.c:8 abcd.d:9 rowid:10 │ ├── update-mapping: │ │ └── b_new:11 => abcd.b:2 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: (5)-->(1-4) │ └── project @@ -1779,12 +1779,12 @@ ORDER BY b sort ├── columns: a:14!null b:15!null c:16!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── ordering: +15 └── with &1 ├── columns: a:14!null b:15!null c:16!null ├── cardinality: [0 - 2] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── upsert abc │ ├── columns: abc.a:1!null abc.b:2!null abc.c:3!null │ ├── canary column: 7 @@ -1800,7 +1800,7 @@ sort │ │ ├── upsert_b:12 => abc.b:2 │ │ └── upsert_c:13 => abc.c:3 │ ├── cardinality: [0 - 2] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── project │ ├── columns: upsert_a:11!null upsert_b:12 upsert_c:13 x:4!null y:5!null z:6!null abc.a:7 abc.b:8 abc.c:9 │ ├── cardinality: [0 - 2] @@ -1858,18 +1858,18 @@ SELECT * FROM [DELETE FROM abcd RETURNING *] ORDER BY c ---- sort ├── columns: a:11 b:12 c:13 d:14 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── ordering: +13 └── with &1 ├── columns: a:11 b:12 c:13 d:14 - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── delete abcd │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 rowid:5!null │ ├── fetch columns: abcd.a:6 abcd.b:7 abcd.c:8 abcd.d:9 rowid:10 - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: (5)-->(1-4) │ └── scan abcd @@ -1893,21 +1893,21 @@ ORDER BY c, d sort ├── columns: a:11 b:12 c:13 d:14 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── ordering: +13,+14 └── with &1 ├── columns: a:11 b:12 c:13 d:14 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── project │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── delete abcd │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 rowid:5!null │ ├── fetch columns: abcd.a:6 abcd.b:7 abcd.c:8 abcd.d:9 rowid:10 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: (5)-->(1-4) │ └── scan abcd@cd @@ -1935,23 +1935,23 @@ ORDER BY b, d sort ├── columns: a:11 b:12!null c:13!null d:14 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (12)==(13), (13)==(12) ├── ordering: +(12|13),+14 [actual: +12,+14] └── with &1 ├── columns: a:11 b:12!null c:13!null d:14 ├── cardinality: [0 - 10] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── fd: (12)==(13), (13)==(12) ├── project │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ └── delete abcd │ ├── columns: abcd.a:1 abcd.b:2 abcd.c:3 abcd.d:4 rowid:5!null │ ├── fetch columns: abcd.a:6 abcd.b:7 abcd.c:8 abcd.d:9 rowid:10 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── key: (5) │ ├── fd: (5)-->(1-4) │ └── scan abcd@cd diff --git a/pkg/sql/opt/xform/testdata/rules/join b/pkg/sql/opt/xform/testdata/rules/join index f137659be5d3..dc2db718c829 100644 --- a/pkg/sql/opt/xform/testdata/rules/join +++ b/pkg/sql/opt/xform/testdata/rules/join @@ -1655,7 +1655,7 @@ GROUP BY n.name, n.geom ---- project ├── columns: name:13!null popn_per_sqkm:16 - ├── immutable, side-effects + ├── immutable ├── group-by │ ├── columns: name:13!null n.geom:14 sum:15 │ ├── grouping columns: name:13!null n.geom:14 @@ -1685,7 +1685,7 @@ project │ └── sum [as=sum:15, outer=(3)] │ └── popn_total:3 └── projections - └── sum:15 / (st_area(n.geom:14) / 1e+06) [as=popn_per_sqkm:16, outer=(14,15), immutable, side-effects] + └── sum:15 / (st_area(n.geom:14) / 1e+06) [as=popn_per_sqkm:16, outer=(14,15), immutable] memo expect=GenerateGeoLookupJoins SELECT @@ -2236,17 +2236,17 @@ SELECT q,r FROM pqr WHERE q = 1 AND r = 2 FOR UPDATE ---- select ├── columns: q:2!null r:3!null - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(2,3) ├── index-join pqr │ ├── columns: q:2 r:3 - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(2) │ └── scan pqr@q │ ├── columns: p:1!null q:2!null │ ├── constraint: /2/1: [/1 - /1] │ ├── locking: for-update - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ └── fd: ()-->(2) └── filters @@ -2477,12 +2477,12 @@ FROM with &1 ├── columns: bool:22!null ├── cardinality: [0 - 0] - ├── volatile, side-effects, mutations + ├── volatile, mutations ├── key: () ├── fd: ()-->(22) ├── project │ ├── columns: "?column?":16!null - │ ├── volatile, side-effects, mutations + │ ├── volatile, mutations │ ├── fd: ()-->(16) │ ├── insert abc │ │ ├── columns: abc.rowid:8!null @@ -2491,15 +2491,15 @@ with &1 │ │ │ ├── column14:14 => abc.b:6 │ │ │ ├── column14:14 => abc.c:7 │ │ │ └── column15:15 => abc.rowid:8 - │ │ ├── volatile, side-effects, mutations + │ │ ├── volatile, mutations │ │ └── project │ │ ├── columns: column14:14 column15:15 "?column?":13!null - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── fd: ()-->(13,14) │ │ ├── scan abc │ │ └── projections │ │ ├── CAST(NULL AS INT8) [as=column14:14] - │ │ ├── unique_rowid() [as=column15:15, volatile, side-effects] + │ │ ├── unique_rowid() [as=column15:15, volatile] │ │ └── 1 [as="?column?":13] │ └── projections │ └── 1 [as="?column?":16] @@ -2588,56 +2588,56 @@ union-all ├── left columns: "?column?":3 ├── right columns: "?column?":6 ├── cardinality: [4 - 12] - ├── volatile, side-effects + ├── volatile ├── project │ ├── columns: "?column?":3!null │ ├── cardinality: [2 - 6] - │ ├── volatile, side-effects + │ ├── volatile │ ├── fd: ()-->(3) │ ├── left-join (cross) │ │ ├── cardinality: [2 - 6] │ │ ├── multiplicity: left-rows(one-or-more), right-rows(one-or-more) - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── values │ │ │ ├── cardinality: [2 - 2] │ │ │ ├── () │ │ │ └── () │ │ ├── select │ │ │ ├── cardinality: [0 - 3] - │ │ │ ├── volatile, side-effects + │ │ │ ├── volatile │ │ │ ├── values │ │ │ │ ├── cardinality: [3 - 3] │ │ │ │ ├── () │ │ │ │ ├── () │ │ │ │ └── () │ │ │ └── filters - │ │ │ └── random() = 0.0 [volatile, side-effects] + │ │ │ └── random() = 0.0 [volatile] │ │ └── filters (true) │ └── projections │ └── 1 [as="?column?":3] └── project ├── columns: "?column?":6!null ├── cardinality: [2 - 6] - ├── volatile, side-effects + ├── volatile ├── fd: ()-->(6) ├── left-join (cross) │ ├── cardinality: [2 - 6] │ ├── multiplicity: left-rows(one-or-more), right-rows(one-or-more) - │ ├── volatile, side-effects + │ ├── volatile │ ├── values │ │ ├── cardinality: [2 - 2] │ │ ├── () │ │ └── () │ ├── select │ │ ├── cardinality: [0 - 3] - │ │ ├── volatile, side-effects + │ │ ├── volatile │ │ ├── values │ │ │ ├── cardinality: [3 - 3] │ │ │ ├── () │ │ │ ├── () │ │ │ └── () │ │ └── filters - │ │ └── random() = 0.0 [volatile, side-effects] + │ │ └── random() = 0.0 [volatile] │ └── filters (true) └── projections └── 1 [as="?column?":6] @@ -2867,19 +2867,19 @@ SELECT b,a FROM t5 WHERE b @> '{"a":1, "c":2}' FOR UPDATE ---- select ├── columns: b:2 a:1!null - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2) ├── index-join t5 │ ├── columns: a:1!null b:2 - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ ├── fd: (1)-->(2) │ └── scan t5@b_idx │ ├── columns: a:1!null │ ├── constraint: /2/1: [/'{"a": 1}' - /'{"a": 1}'] │ ├── locking: for-update - │ ├── volatile, side-effects + │ ├── volatile │ └── key: (1) └── filters └── b:2 @> '{"a": 1, "c": 2}' [outer=(2), immutable] diff --git a/pkg/sql/opt/xform/testdata/rules/limit b/pkg/sql/opt/xform/testdata/rules/limit index 8c1078414c62..0448a80fd78d 100644 --- a/pkg/sql/opt/xform/testdata/rules/limit +++ b/pkg/sql/opt/xform/testdata/rules/limit @@ -148,7 +148,7 @@ SELECT s FROM a LIMIT (SELECT k FROM a LIMIT 1) ---- limit ├── columns: s:4 - ├── immutable, side-effects + ├── immutable ├── scan a@s_idx │ └── columns: s:4 └── subquery @@ -188,7 +188,7 @@ scan a ├── columns: k:1!null i:2 f:3 s:4 j:5 ├── limit: 1 ├── locking: for-update - ├── volatile, side-effects + ├── volatile ├── key: () └── fd: ()-->(1-5) @@ -201,7 +201,7 @@ scan a@s_idx ├── constraint: /4/1: [/'foo' - /'foo'] ├── limit: 1 ├── locking: for-update - ├── volatile, side-effects + ├── volatile ├── key: () └── fd: ()-->(4) @@ -601,7 +601,7 @@ SELECT * FROM kuv ORDER BY u LIMIT 5 FOR UPDATE index-join kuv ├── columns: k:1!null u:2 v:3 ├── cardinality: [0 - 5] - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2,3) ├── ordering: +2 @@ -609,7 +609,7 @@ index-join kuv ├── columns: k:1!null u:2 ├── limit: 5 ├── locking: for-update - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2) └── ordering: +2 diff --git a/pkg/sql/opt/xform/testdata/rules/scan b/pkg/sql/opt/xform/testdata/rules/scan index 2098672cb22b..6ed172cd433d 100644 --- a/pkg/sql/opt/xform/testdata/rules/scan +++ b/pkg/sql/opt/xform/testdata/rules/scan @@ -492,7 +492,7 @@ SELECT s, i, f FROM a ORDER BY s FOR UPDATE scan a@s_idx ├── columns: s:4 i:2 f:3 ├── locking: for-update - ├── volatile, side-effects + ├── volatile └── ordering: +4 # Collated strings are treated properly. diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index d43f8ba5fd6f..1da7ab4c6c92 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -983,7 +983,7 @@ scan a ├── constraint: /1: [/1 - /1] ├── locking: for-update ├── cardinality: [0 - 1] - ├── volatile, side-effects + ├── volatile ├── key: () └── fd: ()-->(1) @@ -993,7 +993,7 @@ SELECT * FROM b WHERE v >= 1 AND v <= 10 FOR UPDATE index-join b ├── columns: k:1!null u:2 v:3!null j:4 ├── cardinality: [0 - 10] - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-4), (3)-->(1,2,4) └── scan b@v @@ -1001,7 +1001,7 @@ index-join b ├── constraint: /3: [/1 - /10] ├── locking: for-update ├── cardinality: [0 - 10] - ├── volatile, side-effects + ├── volatile ├── key: (1) └── fd: (1)-->(3), (3)-->(1) @@ -1011,13 +1011,13 @@ SELECT * FROM b WHERE v >= 1 AND v <= 10 AND k+u = 1 FOR UPDATE select ├── columns: k:1!null u:2 v:3!null j:4 ├── cardinality: [0 - 10] - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(2-4), (3)-->(1,2,4) ├── index-join b │ ├── columns: k:1!null u:2 v:3 j:4 │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ ├── fd: (1)-->(2-4), (3)-->(1), (3)~~>(1,2,4) │ └── scan b@v @@ -1025,7 +1025,7 @@ select │ ├── constraint: /3: [/1 - /10] │ ├── locking: for-update │ ├── cardinality: [0 - 10] - │ ├── volatile, side-effects + │ ├── volatile │ ├── key: (1) │ └── fd: (1)-->(3), (3)-->(1) └── filters @@ -1285,18 +1285,18 @@ SELECT k FROM b WHERE j @> '{"a": "b"}' FOR UPDATE ---- project ├── columns: k:1!null - ├── volatile, side-effects + ├── volatile ├── key: (1) └── index-join b ├── columns: k:1!null j:4 - ├── volatile, side-effects + ├── volatile ├── key: (1) ├── fd: (1)-->(4) └── scan b@inv_idx ├── columns: k:1!null ├── constraint: /4/1: [/'{"a": "b"}' - /'{"a": "b"}'] ├── locking: for-update - ├── volatile, side-effects + ├── volatile └── key: (1) # Tests for array inverted indexes.