1
0
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:
Peter Shchuchkin
2017-08-25 12:43:28 +03:00
committed by Sergey Vojtovich
parent 5dd8e1bf2d
commit cf3a74eb60
2 changed files with 5 additions and 1 deletions

View File

@ -159,6 +159,7 @@ struct Query_cache_query
unsigned int last_pkt_nr;
uint8 tbls_type;
uint8 ready;
ulonglong hit_count;
Query_cache_query() {} /* Remove gcc warning */
inline void init_n_lock();
@ -184,6 +185,8 @@ struct Query_cache_query
*/
inline void set_results_ready() { ready= 1; }
inline bool is_results_ready() { return ready; }
inline void increment_hits() { hit_count++; }
inline ulong hits() { return hit_count; }
void lock_writing();
void lock_reading();
bool try_lock_writing();