MySQL 8.0.40
Source Code Documentation
|
The abstract base class for all Value_map types. More...
#include <value_map.h>
Public Member Functions | |
Value_map_base (const CHARSET_INFO *charset, Value_map_type data_type) | |
virtual | ~Value_map_base ()=default |
virtual size_t | size () const =0 |
Returns the number of [value, count] pairs in the Value_map. More... | |
template<class T > | |
bool | add_values (const T &value, const ha_rows count) |
Add a value with the given count to this Value_map. More... | |
void | add_null_values (const ha_rows count) |
Increase the number of null values with the given count. More... | |
ha_rows | get_num_null_values () const |
virtual Histogram * | build_histogram (MEM_ROOT *mem_root, size_t num_buckets, const std::string &db_name, const std::string &tbl_name, const std::string &col_name) const =0 |
Create a Histogram from this Value_map. More... | |
double | get_sampling_rate () const |
void | set_sampling_rate (double sampling_rate) |
Set the sampling rate that was used to generate this Value_map. More... | |
const CHARSET_INFO * | get_character_set () const |
Value_map_type | get_data_type () const |
virtual size_t | element_overhead () const =0 |
Protected Attributes | |
MEM_ROOT | m_mem_root |
Private Attributes | |
double | m_sampling_rate |
const CHARSET_INFO * | m_charset |
ha_rows | m_num_null_values |
const Value_map_type | m_data_type |
The abstract base class for all Value_map types.
We would ideally like to have only one class for the Value map concept (no inheritance) which would gives us an easier interface. But there are some reasons for why we need to to split the class into a non-templated base class and a templated subclass:
histograms::Value_map_base::Value_map_base | ( | const CHARSET_INFO * | charset, |
Value_map_type | data_type | ||
) |
|
virtualdefault |
|
inline |
Increase the number of null values with the given count.
count | The number of null values. |
template bool histograms::Value_map_base::add_values | ( | const T & | value, |
const ha_rows | count | ||
) |
Add a value with the given count to this Value_map.
If the given value already exists, the count will be added to the existing count.
value | The value to add. |
count | Count of the value to add. |
|
pure virtual |
Create a Histogram from this Value_map.
The resulting histogram will have at most "num_buckets" buckets (might be less), and all of its contents will be allocated on the supplied MEM_ROOT.
mem_root | The MEM_ROOT to allocate the contents on |
num_buckets | Maximum number of buckets to create |
db_name | Database name |
tbl_name | Table name |
col_name | Column name |
Implemented in histograms::Value_map< T >.
|
pure virtual |
Implemented in histograms::Value_map< T >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the sampling rate that was used to generate this Value_map.
sampling_rate | The sampling rate. |
|
pure virtual |
Returns the number of [value, count] pairs in the Value_map.
Implemented in histograms::Value_map< T >.
|
private |
|
private |
|
protected |
|
private |
|
private |