public class Bucket extends Object implements Comparable<Bucket>
Bucket bound is the smallest and greatest values stored in the bucket. The lower and upper bound are stored in bucket as lowerBound and upperBound.
A bucket count is the number of items stored in all previous buckets and the current bucket. Bucket counts are always in increasing order.
A bucket repeat is the number of repeats of the greatest bucket value, it can be used to find popular values.
Note that lowerBound and upperBound keys should be 'comparable objects', and these bounds are encoded as `binary` type in TiDB. Intuitively, you should also use Keys encoded as binary format to do comparison in row count estimation.
| 限定符和类型 | 字段和说明 |
|---|---|
long |
count |
| 构造器和说明 |
|---|
Bucket(Key upperBound)
used for binary search only
|
Bucket(long count,
long repeats,
Key lowerBound,
Key upperBound) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(Bucket b) |
long |
getCount() |
Key |
getLowerBound() |
long |
getRepeats() |
Key |
getUpperBound() |
void |
setCount(long count) |
void |
setLowerBound(Key lowerBound) |
void |
setRepeats(long repeats) |
void |
setUpperBound(Key upperBound) |
String |
toString() |
public Bucket(Key upperBound)
public int compareTo(Bucket b)
compareTo 在接口中 Comparable<Bucket>public long getCount()
public void setCount(long count)
public long getRepeats()
public void setRepeats(long repeats)
public Key getLowerBound()
public void setLowerBound(Key lowerBound)
public Key getUpperBound()
public void setUpperBound(Key upperBound)
Copyright © 2023 PingCAP. All rights reserved.