MySQL 8.3.0
Source Code Documentation
keycache.h File Reference

Key cache variable structures. More...

#include <stddef.h>
#include <sys/types.h>
#include <string_view>
#include "my_inttypes.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_sys.h"
#include "mysql/psi/mysql_cond.h"
#include "mysql/psi/mysql_mutex.h"

Go to the source code of this file.

Classes

struct  st_keycache_thread_var
 
struct  KEYCACHE_WQUEUE
 
struct  KEY_CACHE
 

Macros

#define KEY_CACHE_SIZE   (uint)(8 * 1024 * 1024)
 
#define KEY_CACHE_BLOCK_SIZE   (uint)1024
 
#define CHANGED_BLOCKS_HASH   128 /* must be power of 2 */
 

Functions

int init_key_cache (KEY_CACHE *keycache, ulonglong key_cache_block_size, size_t use_mem, ulonglong division_limit, ulonglong age_threshold)
 
int resize_key_cache (KEY_CACHE *keycache, st_keycache_thread_var *thread_var, ulonglong key_cache_block_size, size_t use_mem, ulonglong division_limit, ulonglong age_threshold)
 
ucharkey_cache_read (KEY_CACHE *keycache, st_keycache_thread_var *thread_var, File file, my_off_t filepos, int level, uchar *buff, uint length, uint block_length, int return_buffer)
 
int key_cache_insert (KEY_CACHE *keycache, st_keycache_thread_var *thread_var, File file, my_off_t filepos, int level, uchar *buff, uint length)
 
int key_cache_write (KEY_CACHE *keycache, st_keycache_thread_var *thread_var, File file, my_off_t filepos, int level, uchar *buff, uint length, uint block_length, int force_write)
 
int flush_key_blocks (KEY_CACHE *keycache, st_keycache_thread_var *thread_var, int file, enum flush_type type)
 
void end_key_cache (KEY_CACHE *keycache, bool cleanup)
 
bool multi_keycache_init (void)
 
void multi_keycache_free (void)
 
KEY_CACHEmulti_key_cache_search (uchar *key, uint length)
 
bool multi_key_cache_set (const uchar *key, uint length, KEY_CACHE *key_cache)
 
void multi_key_cache_change (KEY_CACHE *old_data, KEY_CACHE *new_data)
 
int reset_key_cache_counters (std::string_view name, KEY_CACHE *key_cache)
 

Variables

KEY_CACHE dflt_key_cache_var
 
KEY_CACHEdflt_key_cache
 

Detailed Description

Key cache variable structures.

Macro Definition Documentation

◆ CHANGED_BLOCKS_HASH

#define CHANGED_BLOCKS_HASH   128 /* must be power of 2 */

◆ KEY_CACHE_BLOCK_SIZE

#define KEY_CACHE_BLOCK_SIZE   (uint)1024

◆ KEY_CACHE_SIZE

#define KEY_CACHE_SIZE   (uint)(8 * 1024 * 1024)

Function Documentation

◆ end_key_cache()

void end_key_cache ( KEY_CACHE keycache,
bool  cleanup 
)

◆ flush_key_blocks()

int flush_key_blocks ( KEY_CACHE keycache,
st_keycache_thread_var thread_var,
int  file,
enum flush_type  type 
)

◆ init_key_cache()

int init_key_cache ( KEY_CACHE keycache,
ulonglong  key_cache_block_size,
size_t  use_mem,
ulonglong  division_limit,
ulonglong  age_threshold 
)

◆ key_cache_insert()

int key_cache_insert ( KEY_CACHE keycache,
st_keycache_thread_var thread_var,
File  file,
my_off_t  filepos,
int  level,
uchar buff,
uint  length 
)

◆ key_cache_read()

uchar * key_cache_read ( KEY_CACHE keycache,
st_keycache_thread_var thread_var,
File  file,
my_off_t  filepos,
int  level,
uchar buff,
uint  length,
uint  block_length,
int  return_buffer 
)

◆ key_cache_write()

int key_cache_write ( KEY_CACHE keycache,
st_keycache_thread_var thread_var,
File  file,
my_off_t  filepos,
int  level,
uchar buff,
uint  length,
uint  block_length,
int  force_write 
)

◆ multi_key_cache_change()

void multi_key_cache_change ( KEY_CACHE old_data,
KEY_CACHE new_data 
)

◆ multi_key_cache_search()

KEY_CACHE * multi_key_cache_search ( uchar key,
uint  length 
)

◆ multi_key_cache_set()

bool multi_key_cache_set ( const uchar key,
uint  length,
KEY_CACHE key_cache 
)

◆ multi_keycache_free()

void multi_keycache_free ( void  )

◆ multi_keycache_init()

bool multi_keycache_init ( void  )

◆ reset_key_cache_counters()

int reset_key_cache_counters ( std::string_view  name,
KEY_CACHE key_cache 
)

◆ resize_key_cache()

int resize_key_cache ( KEY_CACHE keycache,
st_keycache_thread_var thread_var,
ulonglong  key_cache_block_size,
size_t  use_mem,
ulonglong  division_limit,
ulonglong  age_threshold 
)

Variable Documentation

◆ dflt_key_cache

KEY_CACHE * dflt_key_cache

◆ dflt_key_cache_var

KEY_CACHE dflt_key_cache_var
extern