MySQL 8.0.40
Source Code Documentation
|
Histogram base class. More...
#include <cstddef>
#include <functional>
#include <map>
#include <set>
#include <string>
#include <utility>
#include "lex_string.h"
#include "my_base.h"
#include "sql/field.h"
#include "sql/histograms/value_map_type.h"
#include "sql/mem_root_allocator.h"
#include "sql/stateless_allocator.h"
Go to the source code of this file.
Classes | |
struct | histograms::Histogram_psi_key_alloc |
class | histograms::Error_context |
Error context to validate given JSON object which represents a histogram. More... | |
class | histograms::Histogram |
Histogram base class. More... | |
Namespaces | |
namespace | dd |
The version of the current data dictionary table definitions. | |
namespace | histograms |
Typedefs | |
template<class T > | |
using | histograms::Histogram_key_allocator = Stateless_allocator< T, Histogram_psi_key_alloc > |
template<class T > | |
using | histograms::value_map_allocator = Mem_root_allocator< std::pair< const T, ha_rows > > |
template<typename T > | |
using | histograms::value_map_type = std::map< T, ha_rows, Histogram_comparator, value_map_allocator< T > > |
using | histograms::columns_set = std::set< std::string, std::less< std::string >, Histogram_key_allocator< std::string > > |
using | histograms::results_map = std::map< std::string, Message, std::less< std::string >, Histogram_key_allocator< std::pair< const std::string, Message > > > |
Functions | |
bool | histograms::empty (const Histogram &histogram) |
Return true if 'histogram' was built on an empty table. More... | |
template<class T > | |
Histogram * | histograms::build_histogram (MEM_ROOT *mem_root, const Value_map< T > &value_map, size_t num_buckets, const std::string &db_name, const std::string &tbl_name, const std::string &col_name) |
Create a histogram from a value map. More... | |
bool | histograms::update_histogram (THD *thd, Table_ref *table, const columns_set &columns, int num_buckets, LEX_STRING data, results_map &results) |
Create or update histograms for a set of columns of a given table. More... | |
bool | histograms::drop_all_histograms (THD *thd, Table_ref &table, const dd::Table &original_table_def, results_map &results) |
Drop histograms for all columns in a given table. More... | |
bool | histograms::drop_histograms (THD *thd, Table_ref &table, const columns_set &columns, bool needs_lock, results_map &results) |
Drop histograms for a set of columns in a given table. More... | |
bool | histograms::rename_histograms (THD *thd, const char *old_schema_name, const char *old_table_name, const char *new_schema_name, const char *new_table_name, results_map &results) |
Rename histograms for all columns in a given table. More... | |
bool | histograms::find_histogram (THD *thd, const std::string &schema_name, const std::string &table_name, const std::string &column_name, const Histogram **histogram) |
Variables | |
static const double | histograms::INVALID_NULL_VALUES_FRACTION = -1.0 |
The default (and invalid) value for "m_null_values_fraction". More... | |
Histogram base class.
This file defines the base class for all histogram types. We keep the base class itself non-templatized in order to more easily send a histogram as an argument, collect multiple histograms in a single collection etc.
A histogram is stored as a JSON object. This gives the flexibility of storing virtually an unlimited number of buckets, data values in its full length and easily expanding with new histogram types in the future. They are stored persistently in the system table mysql.column_stats.
We keep all histogram code in the namespace "histograms" in order to avoid name conflicts etc.