diff --git a/pkg/sql/opt/memo/statistics_builder.go b/pkg/sql/opt/memo/statistics_builder.go index 17eeff0c4650..9147ba1697a8 100644 --- a/pkg/sql/opt/memo/statistics_builder.go +++ b/pkg/sql/opt/memo/statistics_builder.go @@ -15,7 +15,6 @@ import ( "reflect" "github.com/cockroachdb/cockroach/pkg/geo/geoindex" - "github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo" "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/constraint" "github.com/cockroachdb/cockroach/pkg/sql/opt/props" @@ -735,12 +734,12 @@ func (sb *statisticsBuilder) constrainScan( // want. invertedConstrainedCol := scan.Table.ColumnID(idx.VirtualInvertedColumn().Ordinal()) constrainedCols.Add(invertedConstrainedCol) - colSet := opt.MakeColSet(invertedConstrainedCol) - if sb.shouldUseHistogram(relProps, colSet) { + if sb.shouldUseHistogram(relProps) { // TODO(mjibson): set distinctCount to something correct. Max is // fine for now because ensureColStat takes the minimum of the // passed value and colSet's distinct count. const distinctCount = math.MaxFloat64 + colSet := opt.MakeColSet(invertedConstrainedCol) sb.ensureColStat(colSet, distinctCount, scan, s) inputStat, _ := sb.colStatFromInput(colSet, scan) @@ -835,7 +834,7 @@ func (sb *statisticsBuilder) colStatScan(colSet opt.ColSet, scan *ScanExpr) *pro inputColStat := sb.colStatTable(scan.Table, colSet) colStat := sb.copyColStat(colSet, s, inputColStat) - if sb.shouldUseHistogram(relProps, colSet) { + if sb.shouldUseHistogram(relProps) { colStat.Histogram = inputColStat.Histogram } @@ -2580,27 +2579,14 @@ func (sb *statisticsBuilder) finalizeFromRowCountAndDistinctCounts( } } -func (sb *statisticsBuilder) shouldUseHistogram(relProps *props.Relational, cols opt.ColSet) bool { +func (sb *statisticsBuilder) shouldUseHistogram(relProps *props.Relational) bool { // If we know that the cardinality is below a certain threshold (e.g., due to // a constraint on a key column), don't bother adding the overhead of // creating a histogram. if relProps.Cardinality.Max < minCardinalityForHistogram { return false } - allowHist := true - cols.ForEach(func(col opt.ColumnID) { - colTyp := sb.md.ColumnMeta(col).Type - switch colTyp { - case types.Geometry, types.Geography: - // Special case these since ColumnTypeIsInvertedIndexable returns true for - // them, but they are supported in histograms now. - default: - if colinfo.ColumnTypeIsInvertedIndexable(colTyp) { - allowHist = false - } - } - }) - return allowHist + return true } // rowsProcessed calculates and returns the number of rows processed by the @@ -3050,7 +3036,7 @@ func (sb *statisticsBuilder) applyIndexConstraint( sb.updateDistinctCountFromUnappliedConjuncts(col, e, s, numConjuncts, lowerBound) } - if !sb.shouldUseHistogram(relProps, constrainedCols) { + if !sb.shouldUseHistogram(relProps) { return constrainedCols, histCols } @@ -3105,12 +3091,12 @@ func (sb *statisticsBuilder) applyConstraintSet( continue } - cols := opt.MakeColSet(col) - if !sb.shouldUseHistogram(relProps, cols) { + if !sb.shouldUseHistogram(relProps) { continue } // Calculate histogram. + cols := opt.MakeColSet(col) if sb.updateHistogram(c, cols, e, s) { histCols.UnionWith(cols) } diff --git a/pkg/sql/opt/memo/testdata/stats/inverted-array b/pkg/sql/opt/memo/testdata/stats/inverted-array new file mode 100644 index 000000000000..31ba885c3758 --- /dev/null +++ b/pkg/sql/opt/memo/testdata/stats/inverted-array @@ -0,0 +1,130 @@ +exec-ddl +CREATE TABLE t ( + k INT PRIMARY KEY, + a INT[], + INVERTED INDEX a_idx (a) +) +---- + +# Histogram boundaries are for JSON values `{}`, `{1}`, `{2}`, `{3}`. The +# row_count is lower than the sum of the histogram buckets num_eq's because some +# rows can have multiple inverted index entries, for example `{1, 2}`. There +# are: +# +# - 1000 rows total +# - 10 empty arrays +# - 990 arrays encoded into 1010 index entries +# +exec-ddl +ALTER TABLE t INJECT STATISTICS '[ + { + "columns": ["a"], + "created_at": "2018-01-01 1:00:00.00000+00:00", + "row_count": 1000, + "distinct_count": 3, + "null_count": 0, + "histo_col_type": "BYTES", + "histo_buckets": [ + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x43" + }, + { + "distinct_range": 0, + "num_eq": 990, + "num_range": 0, + "upper_bound": "\\x89" + }, + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x8a" + }, + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x8b" + } + ] + } +]' +---- + +# Containment of an empty array requires a scan over all array entries. +opt +SELECT * FROM t@a_idx WHERE a @> '{}' +---- +index-join t + ├── columns: k:1(int!null) a:2(int[]!null) + ├── immutable + ├── stats: [rows=333.333333] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans: ["", ""] + ├── stats: [rows=1020] + ├── key: (1) + └── scan t@a_idx + ├── columns: k:1(int!null) a_inverted_key:4(int[]!null) + ├── inverted constraint: /4/1 + │ └── spans: ["", ""] + ├── flags: force-index=a_idx + ├── stats: [rows=1020, distinct(1)=1000, null(1)=0, distinct(4)=4, null(4)=0] + │ histogram(4)= 0 10 0 990 0 10 0 10 + │ <--- '\x43' --- '\x89' --- '\x8a' --- '\x8b' + ├── key: (1) + └── fd: (1)-->(4) + +# An inverted index scan is preferred for a more selective filter. +opt +SELECT * FROM t WHERE a @> '{2}' +---- +index-join t + ├── columns: k:1(int!null) a:2(int[]!null) + ├── immutable + ├── stats: [rows=111.111111] + ├── key: (1) + ├── fd: (1)-->(2) + └── scan t@a_idx + ├── columns: k:1(int!null) + ├── inverted constraint: /4/1 + │ └── spans: ["\x8a", "\x8a"] + ├── stats: [rows=10, distinct(4)=1, null(4)=0] + │ histogram(4)= 0 10 0 0 + │ <--- '\x8a' --- '\x8b' + └── key: (1) + +# A disjunction requires scanning all entries that match either the left or the +# right. +opt +SELECT * FROM t WHERE a @> '{2}' OR a @> '{3}' +---- +index-join t + ├── columns: k:1(int!null) a:2(int[]!null) + ├── immutable + ├── stats: [rows=333.333333, distinct(2)=3, null(2)=0] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans: ["\x8a", "\x8c") + ├── stats: [rows=20] + ├── key: (1) + └── scan t@a_idx + ├── columns: k:1(int!null) a_inverted_key:4(int[]!null) + ├── inverted constraint: /4/1 + │ └── spans: ["\x8a", "\x8c") + ├── stats: [rows=20, distinct(1)=19.6078431, null(1)=0, distinct(4)=2, null(4)=0] + │ histogram(4)= 0 10 0 10 + │ <--- '\x8a' --- '\x8b' + ├── key: (1) + └── fd: (1)-->(4) diff --git a/pkg/sql/opt/memo/testdata/stats/inverted-json b/pkg/sql/opt/memo/testdata/stats/inverted-json new file mode 100644 index 000000000000..514291c8d3d0 --- /dev/null +++ b/pkg/sql/opt/memo/testdata/stats/inverted-json @@ -0,0 +1,362 @@ +exec-ddl +CREATE TABLE t ( + k INT PRIMARY KEY, + j JSON, + INVERTED INDEX j_idx (j) +) +---- + +# Histogram boundaries are for JSON values `[]`, `{}`, `[1]`, `[2]`, `[3]`, +# `{"a": "b"}`, `{"c": "d"}`, and `{"e": "f"}`. The row_count is lower than the +# sum of the histogram buckets num_eq's because some rows can have multiple +# inverted index entries, for example `{"a": "b", "c": "d"}`. There are: +# +# - 2000 rows total +# - 10 empty arrays +# - 990 arrays encoded into 1110 index entries +# - 10 empty object +# - 990 objects encoded into 1110 index entries +# +exec-ddl +ALTER TABLE t INJECT STATISTICS '[ + { + "columns": ["j"], + "created_at": "2018-01-01 1:00:00.00000+00:00", + "row_count": 2000, + "distinct_count": 3, + "null_count": 0, + "histo_col_type": "BYTES", + "histo_buckets": [ + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x37000138" + }, + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x37000139" + }, + { + "distinct_range": 0, + "num_eq": 990, + "num_range": 0, + "upper_bound": "\\x37000300012a0200" + }, + { + "distinct_range": 0, + "num_eq": 100, + "num_range": 0, + "upper_bound": "\\x37000300012a0400" + }, + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x37000300012a0600" + }, + { + "distinct_range": 0, + "num_eq": 990, + "num_range": 0, + "upper_bound": "\\x3761000112620001" + }, + { + "distinct_range": 0, + "num_eq": 100, + "num_range": 0, + "upper_bound": "\\x3763000112640001" + }, + { + "distinct_range": 0, + "num_eq": 10, + "num_range": 0, + "upper_bound": "\\x3765000112660001" + } + ] + } +]' +---- + +# Containment of an empty object requires a scan over all object entries. +opt +SELECT * FROM t@j_idx WHERE j @> '{}' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7\x00\x019", "7\x00\x019"] + │ └── ["7\x00\xff", "8") + ├── stats: [rows=1110] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7\x00\x019", "7\x00\x019"] + │ └── ["7\x00\xff", "8") + ├── flags: force-index=j_idx + ├── stats: [rows=1110, distinct(1)=1000, null(1)=0, distinct(4)=4, null(4)=0] + │ histogram(4)= 0 10 0 990 0 100 0 10 + │ <--- '\x37000139' --- '\x3761000112620001' --- '\x3763000112640001' --- '\x3765000112660001' + ├── key: (1) + └── fd: (1)-->(4) + +# An inverted index scan is preferred for a more selective filter. +opt +SELECT * FROM t WHERE j @> '{"c": "d"}' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── scan t@j_idx + ├── columns: k:1(int!null) + ├── inverted constraint: /4/1 + │ └── spans: ["7c\x00\x01\x12d\x00\x01", "7c\x00\x01\x12d\x00\x01"] + ├── stats: [rows=100, distinct(4)=1, null(4)=0] + │ histogram(4)= 0 100 0 0 + │ <--- '\x3763000112640001' --- '\x3763000112640002' + └── key: (1) + +# A disjunction requires scanning all entries that match either the left or the +# right. +opt +SELECT * FROM t WHERE j @> '{"c": "d"}' OR j @> '{"e": "f"}' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=666.666667, distinct(2)=3, null(2)=0] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7c\x00\x01\x12d\x00\x01", "7c\x00\x01\x12d\x00\x01"] + │ └── ["7e\x00\x01\x12f\x00\x01", "7e\x00\x01\x12f\x00\x01"] + ├── stats: [rows=110] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7c\x00\x01\x12d\x00\x01", "7c\x00\x01\x12d\x00\x01"] + │ └── ["7e\x00\x01\x12f\x00\x01", "7e\x00\x01\x12f\x00\x01"] + ├── stats: [rows=110, distinct(1)=99.0990991, null(1)=0, distinct(4)=2, null(4)=0] + │ histogram(4)= 0 100 0 10 + │ <--- '\x3763000112640001' --- '\x3765000112660001' + ├── key: (1) + └── fd: (1)-->(4) + +# Containment of an empty array requires a scan over all array entries. +opt +SELECT * FROM t@j_idx WHERE j @> '[]' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7\x00\x018", "7\x00\x018"] + │ └── ["7\x00\x03", "7\x00\x03"] + ├── stats: [rows=1110] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7\x00\x018", "7\x00\x018"] + │ └── ["7\x00\x03", "7\x00\x03"] + ├── flags: force-index=j_idx + ├── stats: [rows=1110, distinct(1)=1000, null(1)=0, distinct(4)=4, null(4)=0] + │ histogram(4)= 0 10 0 990 0 100 0 10 0 0 + │ <--- '\x37000138' --- '\x37000300012a0200' --- '\x37000300012a0400' --- '\x37000300012a0600' --- '\x370004' + ├── key: (1) + └── fd: (1)-->(4) + +# An inverted index scan is preferred for a more selective filter. +opt +SELECT * FROM t WHERE j @> '[2]' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── scan t@j_idx + ├── columns: k:1(int!null) + ├── inverted constraint: /4/1 + │ └── spans: ["7\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x01*\x04\x00"] + ├── stats: [rows=100, distinct(4)=1, null(4)=0] + │ histogram(4)= 0 100 0 0 + │ <--- '\x37000300012a0400' --- '\x37000300012a0401' + └── key: (1) + +# A disjunction requires scanning all entries that match either the left or the +# right. +opt +SELECT * FROM t WHERE j @> '[2]' OR j @> '[3]' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=666.666667, distinct(2)=3, null(2)=0] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x01*\x04\x00"] + │ └── ["7\x00\x03\x00\x01*\x06\x00", "7\x00\x03\x00\x01*\x06\x00"] + ├── stats: [rows=110] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x01*\x04\x00"] + │ └── ["7\x00\x03\x00\x01*\x06\x00", "7\x00\x03\x00\x01*\x06\x00"] + ├── stats: [rows=110, distinct(1)=99.0990991, null(1)=0, distinct(4)=2, null(4)=0] + │ histogram(4)= 0 100 0 10 0 0 + │ <--- '\x37000300012a0400' --- '\x37000300012a0600' --- '\x37000300012a0601' + ├── key: (1) + └── fd: (1)-->(4) + +# Histogram boundaries are for JSON values `[]`, `{}`, `true`, `22`, and `"foo"`. +exec-ddl +ALTER TABLE t INJECT STATISTICS '[ + { + "columns": ["k"], + "created_at": "2018-01-01 1:00:00.00000+00:00", + "row_count": 2000, + "distinct_count": 2000, + "null_count": 0 + }, + { + "columns": ["j"], + "created_at": "2018-01-01 1:00:00.00000+00:00", + "row_count": 2000, + "distinct_count": 3, + "null_count": 0, + "histo_col_type": "BYTES", + "histo_buckets": [ + { + "distinct_range": 0, + "num_eq": 100, + "num_range": 0, + "upper_bound": "\\x37000138" + }, + { + "distinct_range": 0, + "num_eq": 100, + "num_range": 0, + "upper_bound": "\\x37000139" + }, + { + "distinct_range": 0, + "num_eq": 1000, + "num_range": 100, + "upper_bound": "\\x3700010a" + }, + { + "distinct_range": 0, + "num_eq": 600, + "num_range": 0, + "upper_bound": "\\x3700012a2c00" + }, + { + "distinct_range": 0, + "num_eq": 100, + "num_range": 0, + "upper_bound": "\\x37000112666f6f0001" + } + ] + } +]' +---- + +# An inverted index scan is preferred for containment of an empty object when +# most inverted index entries are non-objects. +opt +SELECT * FROM t WHERE j @> '{}' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7\x00\x019", "7\x00\x019"] + │ └── ["7\x00\xff", "8") + ├── stats: [rows=2e-07] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7\x00\x019", "7\x00\x019"] + │ └── ["7\x00\xff", "8") + ├── stats: [rows=2e-07, distinct(1)=1.99999931e-07, null(1)=0, distinct(4)=2e-07, null(4)=0] + │ histogram(4)= + ├── key: (1) + └── fd: (1)-->(4) + +# An inverted index scan is preferred for containment of an empty array when +# most inverted index entries are non-arrays. +opt +SELECT * FROM t WHERE j @> '[]' +---- +index-join t + ├── columns: k:1(int!null) j:2(jsonb!null) + ├── immutable + ├── stats: [rows=222.222222] + ├── key: (1) + ├── fd: (1)-->(2) + └── inverted-filter + ├── columns: k:1(int!null) + ├── inverted expression: /4 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7\x00\x018", "7\x00\x018"] + │ └── ["7\x00\x03", "7\x00\x03"] + ├── stats: [rows=2e-07] + ├── key: (1) + └── scan t@j_idx + ├── columns: k:1(int!null) j_inverted_key:4(jsonb!null) + ├── inverted constraint: /4/1 + │ └── spans + │ ├── ["7\x00\x018", "7\x00\x018"] + │ └── ["7\x00\x03", "7\x00\x03"] + ├── stats: [rows=2e-07, distinct(1)=1.99999931e-07, null(1)=0, distinct(4)=2e-07, null(4)=0] + │ histogram(4)= + ├── key: (1) + └── fd: (1)-->(4) diff --git a/pkg/sql/opt/memo/testdata/stats/partial-index-scan b/pkg/sql/opt/memo/testdata/stats/partial-index-scan index a1a4fdc1bd04..6d02f8080304 100644 --- a/pkg/sql/opt/memo/testdata/stats/partial-index-scan +++ b/pkg/sql/opt/memo/testdata/stats/partial-index-scan @@ -828,7 +828,7 @@ project ├── inverted constraint: /6/1 │ └── spans: ["7x\x00\x01\x12y\x00\x01", "7x\x00\x01\x12y\x00\x01"] ├── flags: force-index=partial - ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0] + ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0, distinct(6)=2.20440882, null(6)=0] └── key: (1) opt @@ -845,7 +845,7 @@ index-join inv ├── inverted constraint: /6/1 │ └── spans: ["7x\x00\x01\x12y\x00\x01", "7x\x00\x01\x12y\x00\x01"] ├── flags: force-index=partial - ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0] + ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0, distinct(6)=2.20440882, null(6)=0] └── key: (1) opt @@ -872,7 +872,7 @@ project │ ├── inverted constraint: /6/1 │ │ └── spans: ["7x\x00\x01\x12y\x00\x01", "7x\x00\x01\x12y\x00\x01"] │ ├── flags: force-index=partial - │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0] + │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0, distinct(6)=2.20440882, null(6)=0] │ └── key: (1) └── filters └── s:4 = 'foo' [type=bool, outer=(4), constraints=(/4: [/'foo' - /'foo']; tight), fd=()-->(4)] @@ -896,7 +896,7 @@ select │ ├── inverted constraint: /6/1 │ │ └── spans: ["7x\x00\x01\x12y\x00\x01", "7x\x00\x01\x12y\x00\x01"] │ ├── flags: force-index=partial - │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0] + │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0, distinct(6)=2.20440882, null(6)=0] │ └── key: (1) └── filters └── s:4 = 'foo' [type=bool, outer=(4), constraints=(/4: [/'foo' - /'foo']; tight), fd=()-->(4)] @@ -920,7 +920,7 @@ select │ ├── inverted constraint: /6/1 │ │ └── spans: ["7x\x00\x01\x12y\x00\x01", "7x\x00\x01\x12y\x00\x01"] │ ├── flags: force-index=partial - │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0] + │ ├── stats: [rows=2.20440882, distinct(4)=2, null(4)=0, distinct(6)=2.20440882, null(6)=0] │ └── key: (1) └── filters ├── (i:2 > 0) AND (i:2 < 10) [type=bool, outer=(2), constraints=(/2: [/1 - /9]; tight)] @@ -967,9 +967,9 @@ ALTER TABLE inv_hist INJECT STATISTICS '[ "null_count": 200, "histo_col_type": "bytes", "histo_buckets": [ - {"num_eq": 0, "num_range": 0, "distinct_range": 0, "upper_bound": "\\\\x376100012a0200"}, - {"num_eq": 100, "num_range": 200, "distinct_range": 99, "upper_bound": "\\\\x376700012a0e00"}, - {"num_eq": 200, "num_range": 300, "distinct_range": 99, "upper_bound": "\\\\x376e00012a1c00"} + {"num_eq": 0, "num_range": 0, "distinct_range": 0, "upper_bound": "\\x376100012a0200"}, + {"num_eq": 100, "num_range": 200, "distinct_range": 99, "upper_bound": "\\x376700012a0e00"}, + {"num_eq": 200, "num_range": 300, "distinct_range": 99, "upper_bound": "\\x376e00012a1c00"} ] }, { @@ -1002,9 +1002,11 @@ project ├── inverted constraint: /6/1 │ └── spans: ["7g\x00\x01*\x0e\x00", "7g\x00\x01*\x0e\x00"] ├── flags: force-index=partial - ├── stats: [rows=22.2222222, distinct(4)=2, null(4)=0] - │ histogram(4)= 0 11.111 0 11.111 + ├── stats: [rows=183.217822, distinct(4)=2, null(4)=0, distinct(6)=50.5, null(6)=0, distinct(4,6)=101, null(4,6)=0] + │ histogram(4)= 0 91.609 0 91.609 │ <--- 'banana' --- 'cherry' + │ histogram(6)= 0 73.287 109.93 0 + │ <--- '\x376700012a0e00' -------- '\x376700012a0e01' └── key: (1) opt @@ -1023,9 +1025,11 @@ index-join inv_hist ├── inverted constraint: /6/1 │ └── spans: ["7g\x00\x01*\x0e\x00", "7g\x00\x01*\x0e\x00"] ├── flags: force-index=partial - ├── stats: [rows=22.2222222, distinct(4)=2, null(4)=0] - │ histogram(4)= 0 11.111 0 11.111 + ├── stats: [rows=183.217822, distinct(4)=2, null(4)=0, distinct(6)=50.5, null(6)=0, distinct(4,6)=101, null(4,6)=0] + │ histogram(4)= 0 91.609 0 91.609 │ <--- 'banana' --- 'cherry' + │ histogram(6)= 0 73.287 109.93 0 + │ <--- '\x376700012a0e00' -------- '\x376700012a0e01' └── key: (1) opt @@ -1046,7 +1050,7 @@ project ├── fd: ()-->(4), (1)-->(3) ├── index-join inv_hist │ ├── columns: k:1(int!null) j:3(jsonb) s:4(string) - │ ├── stats: [rows=22.2222222] + │ ├── stats: [rows=183.217822] │ ├── key: (1) │ ├── fd: (1)-->(3,4) │ └── scan inv_hist@partial,partial @@ -1054,9 +1058,11 @@ project │ ├── inverted constraint: /6/1 │ │ └── spans: ["7g\x00\x01*\x0e\x00", "7g\x00\x01*\x0e\x00"] │ ├── flags: force-index=partial - │ ├── stats: [rows=22.2222222, distinct(4)=2, null(4)=0] - │ │ histogram(4)= 0 11.111 0 11.111 + │ ├── stats: [rows=183.217822, distinct(4)=2, null(4)=0, distinct(6)=50.5, null(6)=0, distinct(4,6)=101, null(4,6)=0] + │ │ histogram(4)= 0 91.609 0 91.609 │ │ <--- 'banana' --- 'cherry' + │ │ histogram(6)= 0 73.287 109.93 0 + │ │ <--- '\x376700012a0e00' -------- '\x376700012a0e01' │ └── key: (1) └── filters └── s:4 = 'banana' [type=bool, outer=(4), constraints=(/4: [/'banana' - /'banana']; tight), fd=()-->(4)] @@ -1074,7 +1080,7 @@ select ├── fd: ()-->(4), (1)-->(2,3) ├── index-join inv_hist │ ├── columns: k:1(int!null) i:2(int) j:3(jsonb) s:4(string) - │ ├── stats: [rows=22.2222222] + │ ├── stats: [rows=183.217822] │ ├── key: (1) │ ├── fd: (1)-->(2-4) │ └── scan inv_hist@partial,partial @@ -1082,9 +1088,11 @@ select │ ├── inverted constraint: /6/1 │ │ └── spans: ["7g\x00\x01*\x0e\x00", "7g\x00\x01*\x0e\x00"] │ ├── flags: force-index=partial - │ ├── stats: [rows=22.2222222, distinct(4)=2, null(4)=0] - │ │ histogram(4)= 0 11.111 0 11.111 + │ ├── stats: [rows=183.217822, distinct(4)=2, null(4)=0, distinct(6)=50.5, null(6)=0, distinct(4,6)=101, null(4,6)=0] + │ │ histogram(4)= 0 91.609 0 91.609 │ │ <--- 'banana' --- 'cherry' + │ │ histogram(6)= 0 73.287 109.93 0 + │ │ <--- '\x376700012a0e00' -------- '\x376700012a0e01' │ └── key: (1) └── filters └── s:4 = 'banana' [type=bool, outer=(4), constraints=(/4: [/'banana' - /'banana']; tight), fd=()-->(4)] @@ -1104,7 +1112,7 @@ select ├── fd: (1)-->(2-4) ├── index-join inv_hist │ ├── columns: k:1(int!null) i:2(int) j:3(jsonb) s:4(string) - │ ├── stats: [rows=22.2222222] + │ ├── stats: [rows=183.217822] │ ├── key: (1) │ ├── fd: (1)-->(2-4) │ └── scan inv_hist@partial,partial @@ -1112,9 +1120,11 @@ select │ ├── inverted constraint: /6/1 │ │ └── spans: ["7g\x00\x01*\x0e\x00", "7g\x00\x01*\x0e\x00"] │ ├── flags: force-index=partial - │ ├── stats: [rows=22.2222222, distinct(4)=2, null(4)=0] - │ │ histogram(4)= 0 11.111 0 11.111 + │ ├── stats: [rows=183.217822, distinct(4)=2, null(4)=0, distinct(6)=50.5, null(6)=0, distinct(4,6)=101, null(4,6)=0] + │ │ histogram(4)= 0 91.609 0 91.609 │ │ <--- 'banana' --- 'cherry' + │ │ histogram(6)= 0 73.287 109.93 0 + │ │ <--- '\x376700012a0e00' -------- '\x376700012a0e01' │ └── key: (1) └── filters └── (i:2 > 0) AND (i:2 <= 100) [type=bool, outer=(2), constraints=(/2: [/1 - /100]; tight)] diff --git a/pkg/sql/opt/memo/testdata/stats/select b/pkg/sql/opt/memo/testdata/stats/select index 18e2d52935bd..7a3d3520a116 100644 --- a/pkg/sql/opt/memo/testdata/stats/select +++ b/pkg/sql/opt/memo/testdata/stats/select @@ -862,7 +862,7 @@ index-join t_json_arr ├── columns: a:1(int!null) ├── inverted constraint: /6/1 │ └── spans: ["7a\x00\x01\x12b\x00\x01", "7a\x00\x01\x12b\x00\x01"] - ├── stats: [rows=555.555556] + ├── stats: [rows=555.555556, distinct(6)=500, null(6)=0] └── key: (1) # Should generate a zigzag join on the inverted index. Row count should be diff --git a/pkg/sql/opt/testutils/opttester/testfixtures/tpce_stats_c5000 b/pkg/sql/opt/testutils/opttester/testfixtures/tpce_stats_c5000 index 91acba2f6c64..8529e4faf085 100644 --- a/pkg/sql/opt/testutils/opttester/testfixtures/tpce_stats_c5000 +++ b/pkg/sql/opt/testutils/opttester/testfixtures/tpce_stats_c5000 @@ -47777,13 +47777,13 @@ ALTER TABLE news_item INJECT STATISTICS '[ "distinct_range":0, "num_eq":1, "num_range":0, - "upper_bound":"\\\\x416262697474205269736b6f20436c6179746f6e204c616e636c6f73204c61666f6e64205363687765696e626572672047726f6f6d73204d756c6c656e6178205365686c2042616c6c696e2047617576696e20446573706f7369746f20506c7565732046726f656d6d696e672057617974204d616e686172742056616e736b696b65204c696e6e204b72616b6f77736b792053746f636b746f6e204c656d656c696e20496e6f61204a6f686e73746f6e2044696c6520526f737320426c657373696e67204d61686e6b6520456c6c20506f7474657220486f75636b204b6e6565204368616d626c657920546f6c65667265652048696e636b20427564726561752047696c637265617374205361726169766120486561647269636b20467265656c732043686c6164656b205066756e6474204272616e646f6e2044756b65747465205265616d79205a656c617a6f20436c6966666f7264204b6f72686f6e656e2046616e746f7a7a6920416775696c61722057696e74657266656c64204d6f67616e20576565646d616e204b6f737469" + "upper_bound":"\\x416262697474205269736b6f20436c6179746f6e204c616e636c6f73204c61666f6e64205363687765696e626572672047726f6f6d73204d756c6c656e6178205365686c2042616c6c696e2047617576696e20446573706f7369746f20506c7565732046726f656d6d696e672057617974204d616e686172742056616e736b696b65204c696e6e204b72616b6f77736b792053746f636b746f6e204c656d656c696e20496e6f61204a6f686e73746f6e2044696c6520526f737320426c657373696e67204d61686e6b6520456c6c20506f7474657220486f75636b204b6e6565204368616d626c657920546f6c65667265652048696e636b20427564726561752047696c637265617374205361726169766120486561647269636b20467265656c732043686c6164656b205066756e6474204272616e646f6e2044756b65747465205265616d79205a656c617a6f20436c6966666f7264204b6f72686f6e656e2046616e746f7a7a6920416775696c61722057696e74657266656c64204d6f67616e20576565646d616e204b6f737469" }, { "distinct_range":4998, "num_eq":1, "num_range":4998, - "upper_bound":"\\\\x5a796c73747261204c6166726f6d626f69736520546561666620526179736f6e2052696d626579204a616e732052616d7365792057696e6b6572204d696c6c6572205768656c6368656c204f6c656b7379204261636963682044656c6565204c61706579726f6c65726965204465626c6173692053616e7469676f2042616c20536f65686c2047726f6e6461686c2048656c6c656e204b6f6c6f647a69656a204765686c65722052616d6572657320466163746f7220536f20506564726f7a61204275726b657420496e636520476173696577736b692052616d6972657a204d617272616e6f2048617574204c7570657220456872656e66656c6420536c696665722048616269736368205065747269656c6c6f20486f7567617320506163697474692050726f6d697365204761707061204a616864652041726b696e2044726f626f74204772696666696e672042726f737365617520566572646572616d652054726f6e204d756c6c696e65782048617272697320536b696c6c204461766973204d617a696e205669676e6f6c6120" + "upper_bound":"\\x5a796c73747261204c6166726f6d626f69736520546561666620526179736f6e2052696d626579204a616e732052616d7365792057696e6b6572204d696c6c6572205768656c6368656c204f6c656b7379204261636963682044656c6565204c61706579726f6c65726965204465626c6173692053616e7469676f2042616c20536f65686c2047726f6e6461686c2048656c6c656e204b6f6c6f647a69656a204765686c65722052616d6572657320466163746f7220536f20506564726f7a61204275726b657420496e636520476173696577736b692052616d6972657a204d617272616e6f2048617574204c7570657220456872656e66656c6420536c696665722048616269736368205065747269656c6c6f20486f7567617320506163697474692050726f6d697365204761707061204a616864652041726b696e2044726f626f74204772696666696e672042726f737365617520566572646572616d652054726f6e204d756c6c696e65782048617272697320536b696c6c204461766973204d617a696e205669676e6f6c6120" } ], "histo_col_type":"BYTES", diff --git a/pkg/sql/opt/xform/testdata/external/fittings b/pkg/sql/opt/xform/testdata/external/fittings index 77b3ebeaab3c..a74e9deecdc4 100644 --- a/pkg/sql/opt/xform/testdata/external/fittings +++ b/pkg/sql/opt/xform/testdata/external/fittings @@ -1283,1195 +1283,1195 @@ ALTER TABLE fits INJECT STATISTICS '[ "distinct_range": 0, "num_eq": 14133, "num_range": 0, - "upper_bound": "\\\\x370003000127" + "upper_bound": "\\x370003000127" }, { "distinct_range": 44.00124967430159, "num_eq": 2355, "num_range": 115427, - "upper_bound": "\\\\x37000300012b051a00" + "upper_bound": "\\x37000300012b051a00" }, { "distinct_range": 43.103132732575176, "num_eq": 23556, "num_range": 113071, - "upper_bound": "\\\\x37000300012b079a00" + "upper_bound": "\\x37000300012b079a00" }, { "distinct_range": 17.061553463857816, "num_eq": 75381, "num_range": 44757, - "upper_bound": "\\\\x37000300012b094400" + "upper_bound": "\\x37000300012b094400" }, { "distinct_range": 36.81745775289487, "num_eq": 37690, "num_range": 96582, - "upper_bound": "\\\\x37000300012b095000" + "upper_bound": "\\x37000300012b095000" }, { "distinct_range": 19.755523084902194, "num_eq": 296813, "num_range": 51824, - "upper_bound": "\\\\x37000300012b096000" + "upper_bound": "\\x37000300012b096000" }, { "distinct_range": 39.51142737393925, "num_eq": 14133, "num_range": 103649, - "upper_bound": "\\\\x37000300012b09c600" + "upper_bound": "\\x37000300012b09c600" }, { "distinct_range": 0.8977357375915535, "num_eq": 146051, "num_range": 2355, - "upper_bound": "\\\\x37000300012b0b2600" + "upper_bound": "\\x37000300012b0b2600" }, { "distinct_range": 19.755523084902194, "num_eq": 113071, "num_range": 51824, - "upper_bound": "\\\\x37000300012b0b3600" + "upper_bound": "\\x37000300012b0b3600" }, { "distinct_range": 31.429518510806115, "num_eq": 51824, "num_range": 82448, - "upper_bound": "\\\\x37000300012b0b9c00" + "upper_bound": "\\x37000300012b0b9c00" }, { "distinct_range": 41.30728005325721, "num_eq": 32979, "num_range": 108360, - "upper_bound": "\\\\x37000300012b0bba00" + "upper_bound": "\\x37000300012b0bba00" }, { "distinct_range": 30.5314015690797, "num_eq": 56535, "num_range": 80092, - "upper_bound": "\\\\x37000300012b0d0200" + "upper_bound": "\\x37000300012b0d0200" }, { "distinct_range": 21.551375764220158, "num_eq": 82448, "num_range": 56535, - "upper_bound": "\\\\x37000300012b0d0a00" + "upper_bound": "\\x37000300012b0d0a00" }, { "distinct_range": 34.12348813185049, "num_eq": 28267, "num_range": 89515, - "upper_bound": "\\\\x37000300012b0d1000" + "upper_bound": "\\x37000300012b0d1000" }, { "distinct_range": 35.91934081116846, "num_eq": 21200, "num_range": 94226, - "upper_bound": "\\\\x37000300012b0d3400" + "upper_bound": "\\x37000300012b0d3400" }, { "distinct_range": 43.103132732575176, "num_eq": 35334, "num_range": 113071, - "upper_bound": "\\\\x37000300012b17a400" + "upper_bound": "\\x37000300012b17a400" }, { "distinct_range": 43.103132732575176, "num_eq": 40046, "num_range": 113071, - "upper_bound": "\\\\x37000300012b195800" + "upper_bound": "\\x37000300012b195800" }, { "distinct_range": 17.95967040558423, "num_eq": 82448, "num_range": 47113, - "upper_bound": "\\\\x37000300012b1b0c00" + "upper_bound": "\\x37000300012b1b0c00" }, { "distinct_range": 38.613310432212835, "num_eq": 21200, "num_range": 101293, - "upper_bound": "\\\\x37000300012b1d0600" + "upper_bound": "\\x37000300012b1d0600" }, { "distinct_range": 41.30728005325721, "num_eq": 11778, "num_range": 108360, - "upper_bound": "\\\\x37000300012b1d2c00" + "upper_bound": "\\x37000300012b1d2c00" }, { "distinct_range": 26.939315006308913, "num_eq": 65958, "num_range": 70669, - "upper_bound": "\\\\x37000300012b1f5200" + "upper_bound": "\\x37000300012b1f5200" }, { "distinct_range": 10.77549728004265, "num_eq": 87159, "num_range": 28267, - "upper_bound": "\\\\x37000300012b259a00" + "upper_bound": "\\x37000300012b259a00" }, { "distinct_range": 33.22537119012408, "num_eq": 37690, "num_range": 87159, - "upper_bound": "\\\\x37000300012b279c00" + "upper_bound": "\\x37000300012b279c00" }, { "distinct_range": 41.30728005325721, "num_eq": 28267, "num_range": 108360, - "upper_bound": "\\\\x37000300012b293000" + "upper_bound": "\\x37000300012b293000" }, { "distinct_range": 35.91934081116846, "num_eq": 84803, "num_range": 94226, - "upper_bound": "\\\\x37000300012b295c00" + "upper_bound": "\\x37000300012b295c00" }, { "distinct_range": 0, "num_eq": 685497, "num_range": 0, - "upper_bound": "\\\\x37000300012b296000" + "upper_bound": "\\x37000300012b296000" }, { "distinct_range": 3.591705358635931, "num_eq": 355705, "num_range": 9422, - "upper_bound": "\\\\x37000300012b2da200" + "upper_bound": "\\x37000300012b2da200" }, { "distinct_range": 38.613310432212835, "num_eq": 9422, "num_range": 101293, - "upper_bound": "\\\\x37000300012b2f4200" + "upper_bound": "\\x37000300012b2f4200" }, { "distinct_range": 34.12348813185049, "num_eq": 47113, "num_range": 89515, - "upper_bound": "\\\\x37000300012b310800" + "upper_bound": "\\x37000300012b310800" }, { "distinct_range": 28.735548889761738, "num_eq": 51824, "num_range": 75381, - "upper_bound": "\\\\x37000300012b336a00" + "upper_bound": "\\x37000300012b336a00" }, { "distinct_range": 22.44949270594657, "num_eq": 261478, "num_range": 58891, - "upper_bound": "\\\\x37000300012b350a00" + "upper_bound": "\\x37000300012b350a00" }, { "distinct_range": 35.021223869442046, "num_eq": 18845, "num_range": 91870, - "upper_bound": "\\\\x37000300012b39a200" + "upper_bound": "\\x37000300012b39a200" }, { "distinct_range": 39.51142737393925, "num_eq": 11778, "num_range": 103649, - "upper_bound": "\\\\x37000300012b3b8a00" + "upper_bound": "\\x37000300012b3b8a00" }, { "distinct_range": 32.327254248397665, "num_eq": 25912, "num_range": 84803, - "upper_bound": "\\\\x37000300012b3d9400" + "upper_bound": "\\x37000300012b3d9400" }, { "distinct_range": 36.81745775289487, "num_eq": 23556, "num_range": 96582, - "upper_bound": "\\\\x37000300012b3f8c00" + "upper_bound": "\\x37000300012b3f8c00" }, { "distinct_range": 0, "num_eq": 115427, "num_range": 0, - "upper_bound": "\\\\x37000300012b3f9c00" + "upper_bound": "\\x37000300012b3f9c00" }, { "distinct_range": 11.673614221769062, "num_eq": 256767, "num_range": 30623, - "upper_bound": "\\\\x37000300012b415800" + "upper_bound": "\\x37000300012b415800" }, { "distinct_range": 39.51142737393925, "num_eq": 2355, "num_range": 103649, - "upper_bound": "\\\\x37000300012b474c00" + "upper_bound": "\\x37000300012b474c00" }, { "distinct_range": 35.91934081116846, "num_eq": 21200, "num_range": 94226, - "upper_bound": "\\\\x37000300012b479c00" + "upper_bound": "\\x37000300012b479c00" }, { "distinct_range": 19.755523084902194, "num_eq": 120138, "num_range": 51824, - "upper_bound": "\\\\x37000300012b494c00" + "upper_bound": "\\x37000300012b494c00" }, { "distinct_range": 0, "num_eq": 207298, "num_range": 0, - "upper_bound": "\\\\x37000300012b496600" + "upper_bound": "\\x37000300012b496600" }, { "distinct_range": 36.81745775289487, "num_eq": 134272, "num_range": 96582, - "upper_bound": "\\\\x37000300012b4d3e00" + "upper_bound": "\\x37000300012b4d3e00" }, { "distinct_range": 2.693588416909519, "num_eq": 230854, "num_range": 7066, - "upper_bound": "\\\\x37000300012b4d5200" + "upper_bound": "\\x37000300012b4d5200" }, { "distinct_range": 28.735548889761738, "num_eq": 122494, "num_range": 75381, - "upper_bound": "\\\\x37000300012b513200" + "upper_bound": "\\x37000300012b513200" }, { "distinct_range": 0, "num_eq": 150762, "num_range": 0, - "upper_bound": "\\\\x37000300012b513600" + "upper_bound": "\\x37000300012b513600" }, { "distinct_range": 38.613310432212835, "num_eq": 2355, "num_range": 101293, - "upper_bound": "\\\\x37000300012b575c00" + "upper_bound": "\\x37000300012b575c00" }, { "distinct_range": 36.81745775289487, "num_eq": 9422, "num_range": 96582, - "upper_bound": "\\\\x37000300012b57c200" + "upper_bound": "\\x37000300012b57c200" }, { "distinct_range": 0.8977357375915535, "num_eq": 101293, "num_range": 2355, - "upper_bound": "\\\\x37000300012b590600" + "upper_bound": "\\x37000300012b590600" }, { "distinct_range": 0, "num_eq": 209654, "num_range": 0, - "upper_bound": "\\\\x37000300012b590a00" + "upper_bound": "\\x37000300012b590a00" }, { "distinct_range": 35.021223869442046, "num_eq": 16489, "num_range": 91870, - "upper_bound": "\\\\x37000300012b5b3a00" + "upper_bound": "\\x37000300012b5b3a00" }, { "distinct_range": 37.71519349048642, "num_eq": 32979, "num_range": 98937, - "upper_bound": "\\\\x37000300012b618e00" + "upper_bound": "\\x37000300012b618e00" }, { "distinct_range": 30.5314015690797, "num_eq": 40046, "num_range": 80092, - "upper_bound": "\\\\x37000300012b675200" + "upper_bound": "\\x37000300012b675200" }, { "distinct_range": 36.81745775289487, "num_eq": 35334, "num_range": 96582, - "upper_bound": "\\\\x37000300012b6d0600" + "upper_bound": "\\x37000300012b6d0600" }, { "distinct_range": 18.857406143175783, "num_eq": 63602, "num_range": 49468, - "upper_bound": "\\\\x37000300012b6d4e00" + "upper_bound": "\\x37000300012b6d4e00" }, { "distinct_range": 0, "num_eq": 101293, "num_range": 0, - "upper_bound": "\\\\x37000300012b6d5600" + "upper_bound": "\\x37000300012b6d5600" }, { "distinct_range": 35.021223869442046, "num_eq": 14133, "num_range": 91870, - "upper_bound": "\\\\x37000300012b6f4200" + "upper_bound": "\\x37000300012b6f4200" }, { "distinct_range": 18.857406143175783, "num_eq": 84803, "num_range": 49468, - "upper_bound": "\\\\x37000300012b754e00" + "upper_bound": "\\x37000300012b754e00" }, { "distinct_range": 36.81745775289487, "num_eq": 162540, "num_range": 96582, - "upper_bound": "\\\\x37000300012b778e00" + "upper_bound": "\\x37000300012b778e00" }, { "distinct_range": 0, "num_eq": 275612, "num_range": 0, - "upper_bound": "\\\\x37000300012b779200" + "upper_bound": "\\x37000300012b779200" }, { "distinct_range": 35.91934081116846, "num_eq": 131917, "num_range": 94226, - "upper_bound": "\\\\x37000300012b790200" + "upper_bound": "\\x37000300012b790200" }, { "distinct_range": 35.021223869442046, "num_eq": 23556, "num_range": 91870, - "upper_bound": "\\\\x37000300012b7b3e00" + "upper_bound": "\\x37000300012b7b3e00" }, { "distinct_range": 12.571731163495475, "num_eq": 73025, "num_range": 32979, - "upper_bound": "\\\\x37000300012b7b7800" + "upper_bound": "\\x37000300012b7b7800" }, { "distinct_range": 28.735548889761738, "num_eq": 30623, "num_range": 75381, - "upper_bound": "\\\\x37000300012b838a00" + "upper_bound": "\\x37000300012b838a00" }, { "distinct_range": 35.91934081116846, "num_eq": 2355, "num_range": 94226, - "upper_bound": "\\\\x37000300012b97aa00" + "upper_bound": "\\x37000300012b97aa00" }, { "distinct_range": 35.91934081116846, "num_eq": 28267, "num_range": 94226, - "upper_bound": "\\\\x37000300012ba32200" + "upper_bound": "\\x37000300012ba32200" }, { "distinct_range": 26.04157926871736, "num_eq": 42401, "num_range": 68314, - "upper_bound": "\\\\x37000300012ba94200" + "upper_bound": "\\x37000300012ba94200" }, { "distinct_range": 26.939315006308913, "num_eq": 32979, "num_range": 70669, - "upper_bound": "\\\\x37000300012bab3a00" + "upper_bound": "\\x37000300012bab3a00" }, { "distinct_range": 35.91934081116846, "num_eq": 2355, "num_range": 94226, - "upper_bound": "\\\\x37000300012bbb3600" + "upper_bound": "\\x37000300012bbb3600" }, { "distinct_range": 25.14346232699095, "num_eq": 70669, "num_range": 65958, - "upper_bound": "\\\\x37000300012bc14000" + "upper_bound": "\\x37000300012bc14000" }, { "distinct_range": 35.91934081116846, "num_eq": 216721, "num_range": 94226, - "upper_bound": "\\\\x37000300012c0303b400" + "upper_bound": "\\x37000300012c0303b400" }, { "distinct_range": 34.12348813185049, "num_eq": 11778, "num_range": 89515, - "upper_bound": "\\\\x37000300012c030da000" + "upper_bound": "\\x37000300012c030da000" }, { "distinct_range": 35.021223869442046, "num_eq": 25912, "num_range": 91870, - "upper_bound": "\\\\x37000300012c03170a00" + "upper_bound": "\\x37000300012c03170a00" }, { "distinct_range": 35.021223869442046, "num_eq": 7066, "num_range": 91870, - "upper_bound": "\\\\x37000300012c03193a00" + "upper_bound": "\\x37000300012c03193a00" }, { "distinct_range": 8.081527658998272, "num_eq": 183741, "num_range": 21200, - "upper_bound": "\\\\x37000300012c03198a00" + "upper_bound": "\\x37000300012c03198a00" }, { "distinct_range": 29.63328462735329, "num_eq": 18845, "num_range": 77736, - "upper_bound": "\\\\x37000300012c031b3200" + "upper_bound": "\\x37000300012c031b3200" }, { "distinct_range": 9.877761542451097, "num_eq": 87159, "num_range": 25912, - "upper_bound": "\\\\x37000300012c031b8c00" + "upper_bound": "\\x37000300012c031b8c00" }, { "distinct_range": 29.63328462735329, "num_eq": 68314, "num_range": 77736, - "upper_bound": "\\\\x37000300012c031f7e00" + "upper_bound": "\\x37000300012c031f7e00" }, { "distinct_range": 17.061553463857816, "num_eq": 148406, "num_range": 44757, - "upper_bound": "\\\\x37000300012c031f9c00" + "upper_bound": "\\x37000300012c031f9c00" }, { "distinct_range": 28.735548889761738, "num_eq": 18845, "num_range": 75381, - "upper_bound": "\\\\x37000300012c03290a00" + "upper_bound": "\\x37000300012c03290a00" }, { "distinct_range": 32.327254248397665, "num_eq": 11778, "num_range": 84803, - "upper_bound": "\\\\x37000300012c03297000" + "upper_bound": "\\x37000300012c03297000" }, { "distinct_range": 31.429518510806115, "num_eq": 9422, "num_range": 82448, - "upper_bound": "\\\\x37000300012c032b0400" + "upper_bound": "\\x37000300012c032b0400" }, { "distinct_range": 32.327254248397665, "num_eq": 7066, "num_range": 84803, - "upper_bound": "\\\\x37000300012c03337e00" + "upper_bound": "\\x37000300012c03337e00" }, { "distinct_range": 13.469466901087028, "num_eq": 89515, "num_range": 35334, - "upper_bound": "\\\\x37000300012c03351800" + "upper_bound": "\\x37000300012c03351800" }, { "distinct_range": 34.12348813185049, "num_eq": 4711, "num_range": 89515, - "upper_bound": "\\\\x37000300012c03379200" + "upper_bound": "\\x37000300012c03379200" }, { "distinct_range": 33.22537119012408, "num_eq": 11778, "num_range": 87159, - "upper_bound": "\\\\x37000300012c03391c00" + "upper_bound": "\\x37000300012c03391c00" }, { "distinct_range": 23.347609647672982, "num_eq": 40046, "num_range": 61247, - "upper_bound": "\\\\x37000300012c033d0600" + "upper_bound": "\\x37000300012c033d0600" }, { "distinct_range": 34.12348813185049, "num_eq": 2355, "num_range": 89515, - "upper_bound": "\\\\x37000300012c03554400" + "upper_bound": "\\x37000300012c03554400" }, { "distinct_range": 34.12348813185049, "num_eq": 4711, "num_range": 89515, - "upper_bound": "\\\\x37000300012c03751400" + "upper_bound": "\\x37000300012c03751400" }, { "distinct_range": 32.327254248397665, "num_eq": 16489, "num_range": 84803, - "upper_bound": "\\\\x37000300012c037d4800" + "upper_bound": "\\x37000300012c037d4800" }, { "distinct_range": 9.877761542451097, "num_eq": 65958, "num_range": 25912, - "upper_bound": "\\\\x37000300012c037d5000" + "upper_bound": "\\x37000300012c037d5000" }, { "distinct_range": 34.12348813185049, "num_eq": 4711, "num_range": 89515, - "upper_bound": "\\\\x37000300012c037f7200" + "upper_bound": "\\x37000300012c037f7200" }, { "distinct_range": 32.327254248397665, "num_eq": 16489, "num_range": 84803, - "upper_bound": "\\\\x37000300012c03819600" + "upper_bound": "\\x37000300012c03819600" }, { "distinct_range": 32.327254248397665, "num_eq": 11778, "num_range": 84803, - "upper_bound": "\\\\x37000300012c03833600" + "upper_bound": "\\x37000300012c03833600" }, { "distinct_range": 25.14346232699095, "num_eq": 42401, "num_range": 65958, - "upper_bound": "\\\\x37000300012c0395a400" + "upper_bound": "\\x37000300012c0395a400" }, { "distinct_range": 17.95967040558423, "num_eq": 56535, "num_range": 47113, - "upper_bound": "\\\\x37000300012c039b1e00" + "upper_bound": "\\x37000300012c039b1e00" }, { "distinct_range": 31.429518510806115, "num_eq": 9422, "num_range": 82448, - "upper_bound": "\\\\x37000300012c039f3c00" + "upper_bound": "\\x37000300012c039f3c00" }, { "distinct_range": 1.7958526793179654, "num_eq": 174319, "num_range": 4711, - "upper_bound": "\\\\x37000300012c039f4c00" + "upper_bound": "\\x37000300012c039f4c00" }, { "distinct_range": 34.12348813185049, "num_eq": 2355, "num_range": 89515, - "upper_bound": "\\\\x37000300012c03b15a00" + "upper_bound": "\\x37000300012c03b15a00" }, { "distinct_range": 33.22537119012408, "num_eq": 4711, "num_range": 87159, - "upper_bound": "\\\\x37000300012c03b91600" + "upper_bound": "\\x37000300012c03b91600" }, { "distinct_range": 29.63328462735329, "num_eq": 14133, "num_range": 77736, - "upper_bound": "\\\\x37000300012c03c50c00" + "upper_bound": "\\x37000300012c03c50c00" }, { "distinct_range": 34.12348813185049, "num_eq": 40046, "num_range": 89515, - "upper_bound": "\\\\x37000300012c05076a00" + "upper_bound": "\\x37000300012c05076a00" }, { "distinct_range": 24.245345385264535, "num_eq": 259122, "num_range": 63602, - "upper_bound": "\\\\x37000300012c05257200" + "upper_bound": "\\x37000300012c05257200" }, { "distinct_range": 10.77549728004265, "num_eq": 75381, "num_range": 28267, - "upper_bound": "\\\\x37000300012c0525c400" + "upper_bound": "\\x37000300012c0525c400" }, { "distinct_range": 27.837431948035327, "num_eq": 162540, "num_range": 73025, - "upper_bound": "\\\\x37000300012c052b9600" + "upper_bound": "\\x37000300012c052b9600" }, { "distinct_range": 0, "num_eq": 136628, "num_range": 0, - "upper_bound": "\\\\x37000300012c052b9a00" + "upper_bound": "\\x37000300012c052b9a00" }, { "distinct_range": 1.7958526793179654, "num_eq": 244988, "num_range": 4711, - "upper_bound": "\\\\x37000300012c052db600" + "upper_bound": "\\x37000300012c052db600" }, { "distinct_range": 26.939315006308913, "num_eq": 28267, "num_range": 70669, - "upper_bound": "\\\\x37000300012c05335400" + "upper_bound": "\\x37000300012c05335400" }, { "distinct_range": 16.163436522131406, "num_eq": 44757, "num_range": 42401, - "upper_bound": "\\\\x37000300012c0537a400" + "upper_bound": "\\x37000300012c0537a400" }, { "distinct_range": 30.5314015690797, "num_eq": 42401, "num_range": 80092, - "upper_bound": "\\\\x37000300012c053d3200" + "upper_bound": "\\x37000300012c053d3200" }, { "distinct_range": 31.429518510806115, "num_eq": 101293, "num_range": 82448, - "upper_bound": "\\\\x37000300012c05473600" + "upper_bound": "\\x37000300012c05473600" }, { "distinct_range": 23.347609647672982, "num_eq": 32979, "num_range": 61247, - "upper_bound": "\\\\x37000300012c05593600" + "upper_bound": "\\x37000300012c05593600" }, { "distinct_range": 28.735548889761738, "num_eq": 32979, "num_range": 75381, - "upper_bound": "\\\\x37000300012c0559be00" + "upper_bound": "\\x37000300012c0559be00" }, { "distinct_range": 29.63328462735329, "num_eq": 16489, "num_range": 77736, - "upper_bound": "\\\\x37000300012c055e00" + "upper_bound": "\\x37000300012c055e00" }, { "distinct_range": 26.939315006308913, "num_eq": 89515, "num_range": 70669, - "upper_bound": "\\\\x37000300012c05757a00" + "upper_bound": "\\x37000300012c05757a00" }, { "distinct_range": 24.245345385264535, "num_eq": 23556, "num_range": 63602, - "upper_bound": "\\\\x37000300012c05776000" + "upper_bound": "\\x37000300012c05776000" }, { "distinct_range": 26.04157926871736, "num_eq": 21200, "num_range": 68314, - "upper_bound": "\\\\x37000300012c057f9400" + "upper_bound": "\\x37000300012c057f9400" }, { "distinct_range": 16.163436522131406, "num_eq": 96582, "num_range": 42401, - "upper_bound": "\\\\x37000300012c058b3a00" + "upper_bound": "\\x37000300012c058b3a00" }, { "distinct_range": 26.939315006308913, "num_eq": 11778, "num_range": 70669, - "upper_bound": "\\\\x37000300012c05933600" + "upper_bound": "\\x37000300012c05933600" }, { "distinct_range": 18.857406143175783, "num_eq": 42401, "num_range": 49468, - "upper_bound": "\\\\x37000300012c05937a00" + "upper_bound": "\\x37000300012c05937a00" }, { "distinct_range": 22.44949270594657, "num_eq": 37690, "num_range": 58891, - "upper_bound": "\\\\x37000300012c0593ae00" + "upper_bound": "\\x37000300012c0593ae00" }, { "distinct_range": 29.63328462735329, "num_eq": 2355, "num_range": 77736, - "upper_bound": "\\\\x37000300012c05a74000" + "upper_bound": "\\x37000300012c05a74000" }, { "distinct_range": 27.837431948035327, "num_eq": 181386, "num_range": 73025, - "upper_bound": "\\\\x37000300012c05ad8800" + "upper_bound": "\\x37000300012c05ad8800" }, { "distinct_range": 27.837431948035327, "num_eq": 30623, "num_range": 73025, - "upper_bound": "\\\\x37000300012c05b3c600" + "upper_bound": "\\x37000300012c05b3c600" }, { "distinct_range": 28.735548889761738, "num_eq": 7066, "num_range": 75381, - "upper_bound": "\\\\x37000300012c05b50e00" + "upper_bound": "\\x37000300012c05b50e00" }, { "distinct_range": 17.061553463857816, "num_eq": 89515, "num_range": 44757, - "upper_bound": "\\\\x37000300012c05b51600" + "upper_bound": "\\x37000300012c05b51600" }, { "distinct_range": 26.939315006308913, "num_eq": 7066, "num_range": 70669, - "upper_bound": "\\\\x37000300012c05c7b400" + "upper_bound": "\\x37000300012c05c7b400" }, { "distinct_range": 0, "num_eq": 106004, "num_range": 0, - "upper_bound": "\\\\x37000300012c07011a00" + "upper_bound": "\\x37000300012c07011a00" }, { "distinct_range": 15.26570078453985, "num_eq": 127205, "num_range": 40046, - "upper_bound": "\\\\x37000300012c0709b000" + "upper_bound": "\\x37000300012c0709b000" }, { "distinct_range": 25.14346232699095, "num_eq": 47113, "num_range": 65958, - "upper_bound": "\\\\x37000300012c0713ae00" + "upper_bound": "\\x37000300012c0713ae00" }, { "distinct_range": 26.04157926871736, "num_eq": 7066, "num_range": 68314, - "upper_bound": "\\\\x37000300012c07151e00" + "upper_bound": "\\x37000300012c07151e00" }, { "distinct_range": 23.347609647672982, "num_eq": 30623, "num_range": 61247, - "upper_bound": "\\\\x37000300012c07155a00" + "upper_bound": "\\x37000300012c07155a00" }, { "distinct_range": 25.14346232699095, "num_eq": 37690, "num_range": 65958, - "upper_bound": "\\\\x37000300012c07156e00" + "upper_bound": "\\x37000300012c07156e00" }, { "distinct_range": 27.837431948035327, "num_eq": 2355, "num_range": 73025, - "upper_bound": "\\\\x37000300012c07159e00" + "upper_bound": "\\x37000300012c07159e00" }, { "distinct_range": 26.04157926871736, "num_eq": 28267, "num_range": 68314, - "upper_bound": "\\\\x37000300012c07176a00" + "upper_bound": "\\x37000300012c07176a00" }, { "distinct_range": 19.755523084902194, "num_eq": 63602, "num_range": 51824, - "upper_bound": "\\\\x37000300012c07178200" + "upper_bound": "\\x37000300012c07178200" }, { "distinct_range": 17.95967040558423, "num_eq": 63602, "num_range": 47113, - "upper_bound": "\\\\x37000300012c07179a00" + "upper_bound": "\\x37000300012c07179a00" }, { "distinct_range": 21.551375764220158, "num_eq": 35334, "num_range": 56535, - "upper_bound": "\\\\x37000300012c07190200" + "upper_bound": "\\x37000300012c07190200" }, { "distinct_range": 0.8977357375915535, "num_eq": 70669, "num_range": 2355, - "upper_bound": "\\\\x37000300012c07191a00" + "upper_bound": "\\x37000300012c07191a00" }, { "distinct_range": 21.551375764220158, "num_eq": 16489, "num_range": 56535, - "upper_bound": "\\\\x37000300012c0719a000" + "upper_bound": "\\x37000300012c0719a000" }, { "distinct_range": 14.36758384281344, "num_eq": 98937, "num_range": 37690, - "upper_bound": "\\\\x37000300012c071b7400" + "upper_bound": "\\x37000300012c071b7400" }, { "distinct_range": 0, "num_eq": 73025, "num_range": 0, - "upper_bound": "\\\\x37000300012c071b7800" + "upper_bound": "\\x37000300012c071b7800" }, { "distinct_range": 15.26570078453985, "num_eq": 32979, "num_range": 40046, - "upper_bound": "\\\\x37000300012c071b8c00" + "upper_bound": "\\x37000300012c071b8c00" }, { "distinct_range": 25.14346232699095, "num_eq": 40046, "num_range": 65958, - "upper_bound": "\\\\x37000300012c071b9c00" + "upper_bound": "\\x37000300012c071b9c00" }, { "distinct_range": 26.04157926871736, "num_eq": 2355, "num_range": 68314, - "upper_bound": "\\\\x37000300012c071dc400" + "upper_bound": "\\x37000300012c071dc400" }, { "distinct_range": 24.245345385264535, "num_eq": 35334, "num_range": 63602, - "upper_bound": "\\\\x37000300012c071f4c00" + "upper_bound": "\\x37000300012c071f4c00" }, { "distinct_range": 25.14346232699095, "num_eq": 16489, "num_range": 65958, - "upper_bound": "\\\\x37000300012c071fb800" + "upper_bound": "\\x37000300012c071fb800" }, { "distinct_range": 25.14346232699095, "num_eq": 7066, "num_range": 65958, - "upper_bound": "\\\\x37000300012c07211400" + "upper_bound": "\\x37000300012c07211400" }, { "distinct_range": 25.14346232699095, "num_eq": 4711, "num_range": 65958, - "upper_bound": "\\\\x37000300012c07217400" + "upper_bound": "\\x37000300012c07217400" }, { "distinct_range": 26.04157926871736, "num_eq": 2355, "num_range": 68314, - "upper_bound": "\\\\x37000300012c0721b000" + "upper_bound": "\\x37000300012c0721b000" }, { "distinct_range": 0.8977357375915535, "num_eq": 73025, "num_range": 2355, - "upper_bound": "\\\\x37000300012c07232000" + "upper_bound": "\\x37000300012c07232000" }, { "distinct_range": 0, "num_eq": 94226, "num_range": 0, - "upper_bound": "\\\\x37000300012c07232400" + "upper_bound": "\\x37000300012c07232400" }, { "distinct_range": 13.469466901087028, "num_eq": 73025, "num_range": 35334, - "upper_bound": "\\\\x37000300012c07233000" + "upper_bound": "\\x37000300012c07233000" }, { "distinct_range": 14.36758384281344, "num_eq": 37690, "num_range": 37690, - "upper_bound": "\\\\x37000300012c07236800" + "upper_bound": "\\x37000300012c07236800" }, { "distinct_range": 21.551375764220158, "num_eq": 42401, "num_range": 56535, - "upper_bound": "\\\\x37000300012c07237800" + "upper_bound": "\\x37000300012c07237800" }, { "distinct_range": 3.591705358635931, "num_eq": 101293, "num_range": 9422, - "upper_bound": "\\\\x37000300012c0723b000" + "upper_bound": "\\x37000300012c0723b000" }, { "distinct_range": 0, "num_eq": 162540, "num_range": 0, - "upper_bound": "\\\\x37000300012c0723b400" + "upper_bound": "\\x37000300012c0723b400" }, { "distinct_range": 16.163436522131406, "num_eq": 49468, "num_range": 42401, - "upper_bound": "\\\\x37000300012c0723c000" + "upper_bound": "\\x37000300012c0723c000" }, { "distinct_range": 24.245345385264535, "num_eq": 2355, "num_range": 63602, - "upper_bound": "\\\\x37000300012c07270800" + "upper_bound": "\\x37000300012c07270800" }, { "distinct_range": 10.77549728004265, "num_eq": 40046, "num_range": 28267, - "upper_bound": "\\\\x37000300012c07273800" + "upper_bound": "\\x37000300012c07273800" }, { "distinct_range": 19.755523084902194, "num_eq": 84803, "num_range": 51824, - "upper_bound": "\\\\x37000300012c07290c00" + "upper_bound": "\\x37000300012c07290c00" }, { "distinct_range": 18.857406143175783, "num_eq": 37690, "num_range": 49468, - "upper_bound": "\\\\x37000300012c07379000" + "upper_bound": "\\x37000300012c07379000" }, { "distinct_range": 20.653640026628604, "num_eq": 16489, "num_range": 54180, - "upper_bound": "\\\\x37000300012c07392600" + "upper_bound": "\\x37000300012c07392600" }, { "distinct_range": 17.061553463857816, "num_eq": 63602, "num_range": 44757, - "upper_bound": "\\\\x37000300012c0739a000" + "upper_bound": "\\x37000300012c0739a000" }, { "distinct_range": 0, "num_eq": 183741, "num_range": 0, - "upper_bound": "\\\\x37000300012c073d9800" + "upper_bound": "\\x37000300012c073d9800" }, { "distinct_range": 19.755523084902194, "num_eq": 9422, "num_range": 51824, - "upper_bound": "\\\\x37000300012c073f0600" + "upper_bound": "\\x37000300012c073f0600" }, { "distinct_range": 11.673614221769062, "num_eq": 70669, "num_range": 30623, - "upper_bound": "\\\\x37000300012c073fa000" + "upper_bound": "\\x37000300012c073fa000" }, { "distinct_range": 19.755523084902194, "num_eq": 9422, "num_range": 51824, - "upper_bound": "\\\\x37000300012c07456400" + "upper_bound": "\\x37000300012c07456400" }, { "distinct_range": 20.653640026628604, "num_eq": 4711, "num_range": 54180, - "upper_bound": "\\\\x37000300012c07459000" + "upper_bound": "\\x37000300012c07459000" }, { "distinct_range": 17.061553463857816, "num_eq": 56535, "num_range": 44757, - "upper_bound": "\\\\x37000300012c074db400" + "upper_bound": "\\x37000300012c074db400" }, { "distinct_range": 0, "num_eq": 68314, "num_range": 0, - "upper_bound": "\\\\x37000300012c074db800" + "upper_bound": "\\x37000300012c074db800" }, { "distinct_range": 11.673614221769062, "num_eq": 30623, "num_range": 30623, - "upper_bound": "\\\\x37000300012c074f1e00" + "upper_bound": "\\x37000300012c074f1e00" }, { "distinct_range": 16.163436522131406, "num_eq": 23556, "num_range": 42401, - "upper_bound": "\\\\x37000300012c07613800" + "upper_bound": "\\x37000300012c07613800" }, { "distinct_range": 18.857406143175783, "num_eq": 9422, "num_range": 49468, - "upper_bound": "\\\\x37000300012c07717200" + "upper_bound": "\\x37000300012c07717200" }, { "distinct_range": 0, "num_eq": 124850, "num_range": 0, - "upper_bound": "\\\\x37000300012c07717400" + "upper_bound": "\\x37000300012c07717400" }, { "distinct_range": 0, "num_eq": 143695, "num_range": 0, - "upper_bound": "\\\\x37000300012c07717600" + "upper_bound": "\\x37000300012c07717600" }, { "distinct_range": 0, "num_eq": 87159, "num_range": 0, - "upper_bound": "\\\\x37000300012c07717800" + "upper_bound": "\\x37000300012c07717800" }, { "distinct_range": 14.36758384281344, "num_eq": 32979, "num_range": 37690, - "upper_bound": "\\\\x37000300012c0771a600" + "upper_bound": "\\x37000300012c0771a600" }, { "distinct_range": 15.26570078453985, "num_eq": 25912, "num_range": 40046, - "upper_bound": "\\\\x37000300012c0773b400" + "upper_bound": "\\x37000300012c0773b400" }, { "distinct_range": 16.163436522131406, "num_eq": 14133, "num_range": 42401, - "upper_bound": "\\\\x37000300012c0773be00" + "upper_bound": "\\x37000300012c0773be00" }, { "distinct_range": 15.26570078453985, "num_eq": 11778, "num_range": 40046, - "upper_bound": "\\\\x37000300012c0795a000" + "upper_bound": "\\x37000300012c0795a000" }, { "distinct_range": 15.26570078453985, "num_eq": 21200, "num_range": 40046, - "upper_bound": "\\\\x37000300012c09154400" + "upper_bound": "\\x37000300012c09154400" }, { "distinct_range": 9.877761542451097, "num_eq": 23556, "num_range": 25912, - "upper_bound": "\\\\x37000300012c09176e00" + "upper_bound": "\\x37000300012c09176e00" }, { "distinct_range": 4.489822300362342, "num_eq": 35334, "num_range": 11778, - "upper_bound": "\\\\x37000300012c09192400" + "upper_bound": "\\x37000300012c09192400" }, { "distinct_range": 12.571731163495475, "num_eq": 11778, "num_range": 32979, - "upper_bound": "\\\\x37000300012c091db200" + "upper_bound": "\\x37000300012c091db200" }, { "distinct_range": 14.36758384281344, "num_eq": 2355, "num_range": 37690, - "upper_bound": "\\\\x37000300012c09333800" + "upper_bound": "\\x37000300012c09333800" }, { "distinct_range": 14.36758384281344, "num_eq": 9422, "num_range": 37690, - "upper_bound": "\\\\x37000300012c09394200" + "upper_bound": "\\x37000300012c09394200" }, { "distinct_range": 14.36758384281344, "num_eq": 7066, "num_range": 37690, - "upper_bound": "\\\\x37000300012c09476800" + "upper_bound": "\\x37000300012c09476800" }, { "distinct_range": 9.877761542451097, "num_eq": 21200, "num_range": 25912, - "upper_bound": "\\\\x37000300012c09530400" + "upper_bound": "\\x37000300012c09530400" }, { "distinct_range": 14.36758384281344, "num_eq": 2355, "num_range": 37690, - "upper_bound": "\\\\x37000300012c09710400" + "upper_bound": "\\x37000300012c09710400" }, { "distinct_range": 13.469466901087028, "num_eq": 4711, "num_range": 35334, - "upper_bound": "\\\\x37000300012c09712a00" + "upper_bound": "\\x37000300012c09712a00" }, { "distinct_range": 14.36758384281344, "num_eq": 70669, "num_range": 37690, - "upper_bound": "\\\\x37000300012c09917200" + "upper_bound": "\\x37000300012c09917200" }, { "distinct_range": 7.18379192140672, "num_eq": 14133, "num_range": 18845, - "upper_bound": "\\\\x37000300012c09958400" + "upper_bound": "\\x37000300012c09958400" }, { "distinct_range": 11.673614221769062, "num_eq": 2355, "num_range": 30623, - "upper_bound": "\\\\x37000300012c099bb200" + "upper_bound": "\\x37000300012c099bb200" }, { "distinct_range": 9.877761542451097, "num_eq": 28267, "num_range": 25912, - "upper_bound": "\\\\x37000300012c099f1600" + "upper_bound": "\\x37000300012c099f1600" }, { "distinct_range": 8.979644600724685, "num_eq": 7066, "num_range": 23556, - "upper_bound": "\\\\x37000300012c099f2400" + "upper_bound": "\\x37000300012c099f2400" }, { "distinct_range": 8.979644600724685, "num_eq": 9422, "num_range": 23556, - "upper_bound": "\\\\x37000300012c099f3600" + "upper_bound": "\\x37000300012c099f3600" }, { "distinct_range": 8.979644600724685, "num_eq": 23556, "num_range": 23556, - "upper_bound": "\\\\x37000300012c09c31400" + "upper_bound": "\\x37000300012c09c31400" }, { "distinct_range": 8.081527658998272, "num_eq": 7066, "num_range": 21200, - "upper_bound": "\\\\x37000300012c09c3b600" + "upper_bound": "\\x37000300012c09c3b600" }, { "distinct_range": 7.18379192140672, "num_eq": 28267, "num_range": 18845, - "upper_bound": "\\\\x37000300012c0b35bc00" + "upper_bound": "\\x37000300012c0b35bc00" } ], "histo_col_type": "BYTES", @@ -2590,8 +2590,6 @@ project # Find the 100 most recent Skybreakers. A Skybreaker is a very rare ship, # and thus we expect the inverted index to be used. Scanning the inverted # index on 20.1 takes 42ms. Scanning the PK takes 40s. -# Currently the inverted index is not used. This query is here to -# demonstrate a needed improvement to our JSON stats. opt format=show-stats SELECT killmail, ship, cost, hi AS hiraw, med AS medraw, low AS lowraw @@ -2612,32 +2610,33 @@ project ├── key: (1) ├── fd: (1)-->(2,3,5-7) ├── ordering: -1 - └── limit + └── index-join fits ├── columns: killmail:1!null ship:2!null cost:3 hi:5!null med:6!null low:7!null items:10!null - ├── internal-ordering: -1 ├── cardinality: [0 - 100] ├── immutable ├── stats: [rows=100] ├── key: (1) ├── fd: (1)-->(2,3,5-7,10) ├── ordering: -1 - ├── select - │ ├── columns: killmail:1!null ship:2!null cost:3 hi:5!null med:6!null low:7!null items:10!null - │ ├── immutable - │ ├── stats: [rows=243064.333] - │ ├── key: (1) - │ ├── fd: (1)-->(2,3,5-7,10) - │ ├── ordering: -1 - │ ├── limit hint: 100.00 - │ ├── scan fits - │ │ ├── columns: killmail:1!null ship:2!null cost:3 hi:5!null med:6!null low:7!null items:10!null - │ │ ├── stats: [rows=2187579, distinct(1)=1654380, null(1)=0, distinct(2)=297, null(2)=0, distinct(5)=583305, null(5)=0, distinct(6)=756863, null(6)=0, distinct(7)=425107, null(7)=0, distinct(10)=1689000, null(10)=0] - │ │ │ histogram(1)= 0 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8077 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 8242 164 - │ │ │ <--- 44947701 ------ 79970176 ------ 80139446 ------ 80183467 ------ 80211244 ------ 80244422 ------ 80267329 ------ 80282322 ------ 80303318 ------ 80322316 ------ 80337078 ------ 80357051 ------ 80374419 ------ 80389864 ------ 80406210 ------ 80421192 ------ 80437680 ------ 80455137 ------ 80475082 ------ 80492469 ------ 80508704 ------ 80524553 ------ 80541541 ------ 80561494 ------ 80576792 ------ 80598615 ------ 80617217 ------ 80637091 ------ 80660864 ------ 80675791 ------ 80692925 ------ 80711373 ------ 80727185 ------ 80741590 ------ 80762348 ------ 80780447 ------ 80797269 ------ 80813321 ------ 80836502 ------ 80853030 ------ 80870527 ------ 80889376 ------ 80905462 ------ 80922457 ------ 80941429 ------ 80960003 ------ 80974683 ------ 80991169 ------ 81015223 ------ 81032404 ------ 81052927 ------ 81067456 ------ 81084136 ------ 81107477 ------ 81126479 ------ 81144297 ------ 81161403 ------ 81178302 ------ 81194174 ------ 81213264 ------ 81233805 ------ 81249641 ------ 81264669 ------ 81279436 ------ 81298290 ------ 81316102 ------ 81339078 ------ 81359818 ------ 81378394 ------ 81392567 ------ 81410401 ------ 81429037 ------ 81448596 ------ 81472277 ------ 81489326 ------ 81505353 ------ 81522154 ------ 81540739 ------ 81557795 ------ 81577227 ------ 81591411 ------ 81609727 ------ 81629037 ------ 81646119 ------ 81669351 ------ 81682429 ------ 81704327 ------ 81718955 ------ 81739231 ------ 81756535 ------ 81775102 ------ 81795299 ------ 81812975 ------ 81830145 ------ 81847813 ------ 81865104 ------ 81884595 ------ 81901299 ------ 81917476 ------ 81933386 ------ 81951538 ------ 81967009 ------ 81984716 ------ 82012165 ------ 82033205 ------ 82054733 ------ 82070719 ------ 82089832 ------ 82106548 ------ 82126808 ------ 82148237 ------ 82170029 ------ 82189702 ------ 82214075 ------ 82240025 ------ 82271935 ------ 82293708 ------ 82321404 ------ 82350022 ------ 82380681 ------ 82399844 ------ 82424440 ------ 82451078 ------ 82475312 ------ 82497197 ------ 82517610 ------ 82546925 ------ 82569530 ------ 82592287 ------ 82613297 ------ 82636292 ------ 82663831 ------ 82682326 ------ 82704594 ------ 82727371 ------ 82755741 ------ 82778477 ------ 82805324 ------ 82829098 ------ 82849455 ------ 82880668 ------ 82907795 ------ 82941062 ------ 82961809 ------ 82983640 ------ 83006552 ------ 83028603 ------ 83055177 ------ 83083218 ------ 83115344 ------ 83143429 ------ 83173852 ------ 83205899 ------ 83239605 ------ 83262540 ------ 83286943 ------ 83316240 ------ 83333830 ------ 83354570 ------ 83373754 ------ 83393774 ------ 83416275 ------ 83434845 ------ 83456706 ------ 83474361 ------ 83498982 ------ 83514677 ------ 83534339 ------ 83553985 ------ 83577308 ------ 83597042 ------ 83614770 ------ 83633818 ------ 83653272 ------ 83667888 ------ 83690743 ------ 83707041 ------ 83723307 ------ 83741451 ------ 83760952 ------ 83778444 ------ 83799158 ------ 83816857 ------ 83833273 ------ 83857299 ------ 83873601 ------ 83892634 ------ 83910143 ------ 83929924 ------ 83953568 ------ 83977053 ------ 83994450 ------ 84015480 ------ 84036569 ------ 84057174 ------ 84078720 ------ 84102356 ------ 84130553 ------ 84153518 ------ 84173560 - │ │ ├── key: (1) - │ │ ├── fd: (1)-->(2,3,5-7,10) - │ │ ├── ordering: -1 - │ │ └── limit hint: 900.00 - │ └── filters - │ └── items:10 @> '[54731]' [outer=(10), immutable, constraints=(/10: (/NULL - ])] - └── 100 + └── limit + ├── columns: killmail:1!null + ├── internal-ordering: -1 + ├── cardinality: [0 - 100] + ├── stats: [rows=0.0023556407] + ├── key: (1) + ├── ordering: -1 + ├── sort + │ ├── columns: killmail:1!null + │ ├── stats: [rows=0.0023556407, distinct(12)=0.0023556407, null(12)=0] + │ │ histogram(12)= + │ ├── key: (1) + │ ├── ordering: -1 + │ ├── limit hint: 100.00 + │ └── scan fits@fits_items_idx + │ ├── columns: killmail:1!null + │ ├── inverted constraint: /12/1 + │ │ └── spans: ["7\x00\x03\x00\x01,\v_>\x00", "7\x00\x03\x00\x01,\v_>\x00"] + │ ├── stats: [rows=0.0023556407, distinct(12)=0.0023556407, null(12)=0] + │ │ histogram(12)= + │ └── key: (1) + └── 100 diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index 0db6f19af852..122b44678a3a 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -1750,58 +1750,6 @@ index-join b │ └── spans: ["7a\x00\x01\x12b\x00\x01", "7a\x00\x01\x12b\x00\x01"] └── key: (1) -# TODO(rytaft): ensure that the stats prevent us from using the inverted index. -opt -SELECT * FROM b WHERE j @> '{}' ----- -index-join b - ├── columns: k:1!null u:2 v:3 j:4!null - ├── immutable - ├── key: (1) - ├── fd: (1)-->(2-4), (3)~~>(1,2,4) - └── inverted-filter - ├── columns: k:1!null - ├── inverted expression: /6 - │ ├── tight: true, unique: false - │ └── union spans - │ ├── ["7\x00\x019", "7\x00\x019"] - │ └── ["7\x00\xff", "8") - ├── key: (1) - └── scan b@j_inv_idx - ├── columns: k:1!null j_inverted_key:6!null - ├── inverted constraint: /6/1 - │ └── spans - │ ├── ["7\x00\x019", "7\x00\x019"] - │ └── ["7\x00\xff", "8") - ├── key: (1) - └── fd: (1)-->(6) - -# TODO(rytaft): ensure that the stats prevent us from using the inverted index. -opt -SELECT * FROM b WHERE j @> '[]' ----- -index-join b - ├── columns: k:1!null u:2 v:3 j:4!null - ├── immutable - ├── key: (1) - ├── fd: (1)-->(2-4), (3)~~>(1,2,4) - └── inverted-filter - ├── columns: k:1!null - ├── inverted expression: /6 - │ ├── tight: true, unique: false - │ └── union spans - │ ├── ["7\x00\x018", "7\x00\x018"] - │ └── ["7\x00\x03", "7\x00\x03"] - ├── key: (1) - └── scan b@j_inv_idx - ├── columns: k:1!null j_inverted_key:6!null - ├── inverted constraint: /6/1 - │ └── spans - │ ├── ["7\x00\x018", "7\x00\x018"] - │ └── ["7\x00\x03", "7\x00\x03"] - ├── key: (1) - └── fd: (1)-->(6) - opt SELECT * FROM b WHERE j @> '2' ----