MySQL 8.4.2
Source Code Documentation
pfs_digest.cc File Reference

Statement Digest data structures (implementation). More...

#include "storage/perfschema/pfs_digest.h"
#include <assert.h>
#include <string.h>
#include "my_compiler.h"
#include "my_murmur3.h"
#include "my_sys.h"
#include "sql/sql_get_diagnostics.h"
#include "sql/sql_lex.h"
#include "sql/sql_signal.h"
#include "sql_string.h"
#include "storage/perfschema/pfs_builtin_memory.h"
#include "storage/perfschema/pfs_global.h"
#include "storage/perfschema/pfs_instr.h"
#include "storage/perfschema/table_helper.h"
#include "sql/current_thd.h"
#include "sql/debug_sync.h"

Functions

int init_digest (const PFS_global_param *param)
 Initialize table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. More...
 
void cleanup_digest ()
 Cleanup table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. More...
 
static const uchardigest_hash_get_key (const uchar *entry, size_t *length)
 
static uint digest_hash_func (const LF_HASH *, const uchar *key, size_t key_len)
 
static int digest_hash_cmp_func (const uchar *key1, size_t key_len1, const uchar *key2, size_t key_len2)
 
int init_digest_hash (const PFS_global_param *param)
 Initialize the digest hash. More...
 
void cleanup_digest_hash ()
 
static LF_PINSget_digest_hash_pins (PFS_thread *thread)
 
PFS_statements_digest_statfind_or_create_digest (PFS_thread *thread, const sql_digest_storage *digest_storage, const char *schema_name, uint schema_name_length)
 
static void purge_digest (PFS_thread *thread, PFS_digest_key *hash_key)
 
void reset_esms_by_digest ()
 
void reset_histogram_by_digest ()
 

Variables

size_t digest_max = 0
 
ulong digest_lost = 0
 
PFS_statements_digest_statstatements_digest_stat_array = nullptr
 EVENTS_STATEMENTS_SUMMARY_BY_DIGEST buffer. More...
 
static unsigned char * statements_digest_token_array = nullptr
 
static char * statements_digest_query_sample_text_array = nullptr
 
bool flag_statements_digest = true
 Consumer flag for table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. More...
 
static PFS_cacheline_atomic_uint32 digest_monotonic_index
 Current index in Stat array where new record is to be inserted. More...
 
bool digest_full = false
 
LF_HASH digest_hash
 
static bool digest_hash_inited = false
 

Detailed Description

Statement Digest data structures (implementation).

Function Documentation

◆ cleanup_digest()

void cleanup_digest ( )

Cleanup table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.

◆ cleanup_digest_hash()

void cleanup_digest_hash ( )

◆ digest_hash_cmp_func()

static int digest_hash_cmp_func ( const uchar key1,
size_t  key_len1,
const uchar key2,
size_t  key_len2 
)
static

◆ digest_hash_func()

static uint digest_hash_func ( const LF_HASH ,
const uchar key,
size_t  key_len 
)
static

◆ digest_hash_get_key()

static const uchar * digest_hash_get_key ( const uchar entry,
size_t *  length 
)
static

◆ find_or_create_digest()

PFS_statements_digest_stat * find_or_create_digest ( PFS_thread thread,
const sql_digest_storage digest_storage,
const char *  schema_name,
uint  schema_name_length 
)

◆ get_digest_hash_pins()

static LF_PINS * get_digest_hash_pins ( PFS_thread thread)
static

◆ init_digest()

int init_digest ( const PFS_global_param param)

Initialize table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.

Parameters
paramperformance schema sizing

◆ init_digest_hash()

int init_digest_hash ( const PFS_global_param param)

Initialize the digest hash.

Returns
0 on success

◆ purge_digest()

static void purge_digest ( PFS_thread thread,
PFS_digest_key hash_key 
)
static

◆ reset_esms_by_digest()

void reset_esms_by_digest ( )

◆ reset_histogram_by_digest()

void reset_histogram_by_digest ( )

Variable Documentation

◆ digest_full

bool digest_full = false

◆ digest_hash

LF_HASH digest_hash

◆ digest_hash_inited

bool digest_hash_inited = false
static

◆ digest_lost

ulong digest_lost = 0

◆ digest_max

size_t digest_max = 0

◆ digest_monotonic_index

PFS_cacheline_atomic_uint32 digest_monotonic_index
static

Current index in Stat array where new record is to be inserted.

index 0 is reserved for "all else" case when entire array is full.

◆ flag_statements_digest

bool flag_statements_digest = true

Consumer flag for table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.

◆ statements_digest_query_sample_text_array

char* statements_digest_query_sample_text_array = nullptr
static

◆ statements_digest_stat_array

PFS_statements_digest_stat* statements_digest_stat_array = nullptr

EVENTS_STATEMENTS_SUMMARY_BY_DIGEST buffer.

◆ statements_digest_token_array

unsigned char* statements_digest_token_array = nullptr
static