mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Counting hits for queries in query cache.
Added hit_count field to Query_cache_query and methods to get and increment it. The counter is incremented when query results are read from query cache.
This commit is contained in:
committed by
Sergey Vojtovich
parent
5dd8e1bf2d
commit
cf3a74eb60
@ -961,7 +961,7 @@ inline void Query_cache_query::unlock_reading()
|
||||
void Query_cache_query::init_n_lock()
|
||||
{
|
||||
DBUG_ENTER("Query_cache_query::init_n_lock");
|
||||
res=0; wri = 0; len = 0; ready= 0;
|
||||
res=0; wri = 0; len = 0; ready= 0; hit_count = 0;
|
||||
mysql_rwlock_init(key_rwlock_query_cache_query_lock, &lock);
|
||||
lock_writing();
|
||||
DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx",
|
||||
@ -2142,6 +2142,7 @@ lookup:
|
||||
}
|
||||
move_to_query_list_end(query_block);
|
||||
hits++;
|
||||
query->increment_hits();
|
||||
unlock();
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user