MySQL 8.4.2
Source Code Documentation
|
The Table_histograms class represents a snapshot of the collection of histograms associated with a table. More...
#include <table_histograms.h>
Public Member Functions | |
Table_histograms (Table_histograms &&)=delete | |
Table_histograms & | operator= (Table_histograms &&)=delete |
Table_histograms (const Table_histograms &)=delete | |
Table_histograms & | operator= (const Table_histograms &)=delete |
~Table_histograms ()=delete | |
void | destroy () |
Destroys the object and frees memory. More... | |
const histograms::Histogram * | find_histogram (unsigned int field_index) const |
Perform a lookup in the local collection of histograms for a histogram on a given field. More... | |
bool | insert_histogram (unsigned int field_index, const histograms::Histogram *histogram) |
Copies the given histogram onto the local MEM_ROOT and inserts the copy into the local collection of histograms. More... | |
Static Public Member Functions | |
static Table_histograms * | create (PSI_memory_key psi_key) noexcept |
Factory method to create Table_histogram objects. More... | |
Private Member Functions | |
Table_histograms ()=default | |
int | reference_count () const |
The number of TABLE objects referencing this object. More... | |
void | increment_reference_counter () |
void | decrement_reference_counter () |
int | get_index () const |
The index of this object in the Table_histograms_collection. More... | |
void | set_index (int index) |
Private Attributes | |
MEM_ROOT | m_mem_root |
mem_root_unordered_map< unsigned int, const histograms::Histogram * > * | m_histograms {nullptr} |
int | m_reference_counter {0} |
size_t | m_index {0} |
Friends | |
class | Table_histograms_collection |
The Table_histograms class represents a snapshot of the collection of histograms associated with a table.
Table_histograms contains a reference counter to keep track of the number of TABLE objects that point to it.
Table_histogram objects are created using the static factory method create(). The object itself and everything it points to (including its MEM_ROOT) is allocated on its own MEM_ROOT. Table_histogram objects are destroyed/freed by calling destroy() that clears the MEM_ROOT.
|
privatedefault |
|
delete |
|
delete |
|
delete |
|
staticnoexcept |
Factory method to create Table_histogram objects.
Allocates a Table_histogram object on its own MEM_ROOT and returns a pointer. Should be matched by a call to destroy().
psi_key | performance schema instrumentation memory key to track all memory used by the object. |
|
inlineprivate |
void Table_histograms::destroy | ( | ) |
Destroys the object and frees memory.
const histograms::Histogram * Table_histograms::find_histogram | ( | unsigned int | field_index | ) | const |
Perform a lookup in the local collection of histograms for a histogram on a given field.
field_index | Index of the field to find a histogram for. |
|
inlineprivate |
The index of this object in the Table_histograms_collection.
|
inlineprivate |
bool Table_histograms::insert_histogram | ( | unsigned int | field_index, |
const histograms::Histogram * | histogram | ||
) |
Copies the given histogram onto the local MEM_ROOT and inserts the copy into the local collection of histograms.
field_index | Index of the field to insert a histogram for. |
histogram | Pointer to the histogram to be copied and inserted. |
|
delete |
|
delete |
|
inlineprivate |
The number of TABLE objects referencing this object.
|
inlineprivate |
|
friend |
|
private |
|
private |
|
private |
|
private |