![]() |
MySQL 9.2.0
Source Code Documentation
|
Histogram comparator. More...
#include <value_map.h>
Public Member Functions | |
template<class T > | |
bool | operator() (const T &lhs, const T &rhs) const |
Overload operator(), so that we can use this struct as a custom comparator in std classes/functions. More... | |
template<class T > | |
bool | operator() (const equi_height::Bucket< T > &a, const T &b) const |
Used by std::lower_bound when computing equal-to and less-than selectivity to find the first bucket with an upper bound that is not less than b. More... | |
template<class T > | |
bool | operator() (const SingletonBucket< T > &a, const T &b) const |
Same as above, but for singleton histogram buckets. More... | |
template<class T > | |
bool | operator() (const T &a, const equi_height::Bucket< T > &b) const |
Used by std::upper_bound when computing greater-than selectivity in order to find the first bucket with an upper bound that is greater than a. More... | |
template<class T > | |
bool | operator() (const T &a, const SingletonBucket< T > &b) const |
Same as above, but for singleton histogram buckets. More... | |
template<class T > | |
bool | operator() (const equi_height::Bucket< T > &a, const equi_height::Bucket< T > &b) const |
Used by std::is_sorted to verify that equi-height histogram buckets are stored in sorted order. More... | |
template<class T > | |
bool | operator() (const SingletonBucket< T > &a, const SingletonBucket< T > &b) const |
Same as above, but for singleton histogram buckets. More... | |
template<> | |
bool | operator() (const String &lhs, const String &rhs) const |
template<> | |
bool | operator() (const MYSQL_TIME &lhs, const MYSQL_TIME &rhs) const |
template<> | |
bool | operator() (const my_decimal &lhs, const my_decimal &rhs) const |
Histogram comparator.
Typical usage is in a "value map", where we for instance need to sort based on string collation and similar.
|
inline |
Used by std::is_sorted to verify that equi-height histogram buckets are stored in sorted order.
We consider bucket a = [a1, a2] to be less than bucket b = [b1, b2] if a2 < b1.
|
inline |
Used by std::lower_bound when computing equal-to and less-than selectivity to find the first bucket with an upper bound that is not less than b.
bool histograms::Histogram_comparator::operator() | ( | const my_decimal & | lhs, |
const my_decimal & | rhs | ||
) | const |
bool histograms::Histogram_comparator::operator() | ( | const MYSQL_TIME & | lhs, |
const MYSQL_TIME & | rhs | ||
) | const |
|
inline |
Same as above, but for singleton histogram buckets.
|
inline |
Same as above, but for singleton histogram buckets.
bool histograms::Histogram_comparator::operator() | ( | const String & | lhs, |
const String & | rhs | ||
) | const |
|
inline |
Used by std::upper_bound when computing greater-than selectivity in order to find the first bucket with an upper bound that is greater than a.
Notice that the comparison function used by std::lower_bound and std::upper_bound have the collection element as the first and second argument, respectively.
|
inline |
Same as above, but for singleton histogram buckets.
|
inline |
Overload operator(), so that we can use this struct as a custom comparator in std classes/functions.
lhs | first value to compare |
rhs | second value to compare |