@@ -47,37 +47,37 @@ func NewStatistic(rowCount, distinctCount, nullCount, avgSize uint64, createdAt
4747}
4848
4949type Statistic struct {
50+ RowCnt uint64 `json:"row_count"`
51+ DistinctCnt uint64 `json:"distinct_count"`
52+ NullCnt uint64 `json:"null_count"`
53+ AvgRowSize uint64 `json:"avg_size"`
5054 Created time.Time `json:"created_at"`
51- Fds * sql.FuncDepSet `json:"-"`
5255 Qual sql.StatQualifier `json:"qualifier"`
53- Colset sql.ColSet `json:"-"`
54- Hist sql.Histogram `json:"buckets"`
55- LowerBnd sql.Row `json:"lower_bound"`
5656 Cols []string `json:"columns"`
5757 Typs []sql.Type `json:"-"`
58- AvgRowSize uint64 `json:"avg_size"`
59- RowCnt uint64 `json:"row_count"`
60- NullCnt uint64 `json:"null_count"`
61- DistinctCnt uint64 `json:"distinct_count"`
58+ Hist sql.Histogram `json:"buckets"`
6259 IdxClass uint8 `json:"index_class"`
60+ LowerBnd sql.Row `json:"lower_bound"`
61+ Fds * sql.FuncDepSet `json:"-"`
62+ Colset sql.ColSet `json:"-"`
6363}
6464
6565// StatisticJSON is used as an intermediary to deserialize the memory stats
6666// object. Otherwise, the histogram would have to be deserialized separately.
6767type StatisticJSON struct {
68+ RowCnt uint64 `json:"row_count"`
69+ DistinctCnt uint64 `json:"distinct_count"`
70+ NullCnt uint64 `json:"null_count"`
71+ AvgRowSize uint64 `json:"avg_size"`
6872 Created time.Time `json:"created_at"`
69- Fds * sql.FuncDepSet `json:"-"`
7073 Qual sql.StatQualifier `json:"qualifier"`
71- Colset sql.ColSet `json:"-"`
72- Hist []* Bucket `json:"buckets"`
73- LowerBnd sql.Row `json:"lower_bound"`
7474 Cols []string `json:"columns"`
7575 Typs []sql.Type `json:"-"`
76- AvgRowSize uint64 `json:"avg_size"`
77- RowCnt uint64 `json:"row_count"`
78- NullCnt uint64 `json:"null_count"`
79- DistinctCnt uint64 `json:"distinct_count"`
76+ Hist []* Bucket `json:"buckets"`
8077 IdxClass uint8 `json:"index_class"`
78+ LowerBnd sql.Row `json:"lower_bound"`
79+ Fds * sql.FuncDepSet `json:"-"`
80+ Colset sql.ColSet `json:"-"`
8181}
8282
8383func (j * StatisticJSON ) ToStatistic () * Statistic {
@@ -291,13 +291,13 @@ func NewHistogramBucket(rowCount, distinctCount, nullCount, boundCount uint64, b
291291}
292292
293293type Bucket struct {
294- McvsCnt []uint64 `json:"mcv_counts"`
295- BoundVal sql.Row `json:"upper_bound"`
296- McvVals []sql.Row `json:"mcvs"`
297294 RowCnt uint64 `json:"row_count"`
298295 DistinctCnt uint64 `json:"distinct_count"`
299296 NullCnt uint64 `json:"null_count"`
297+ McvsCnt []uint64 `json:"mcv_counts"`
300298 BoundCnt uint64 `json:"bound_count"`
299+ BoundVal sql.Row `json:"upper_bound"`
300+ McvVals []sql.Row `json:"mcvs"`
301301}
302302
303303var _ sql.HistogramBucket = (* Bucket )(nil )
0 commit comments