summaryrefslogtreecommitdiff
path: root/sql/sql_cache.h
diff options
context:
space:
mode:
authorPeter Shchuchkin <peters@yandex.ru>2017-08-25 12:43:28 +0300
committerSergey Vojtovich <svoj@mariadb.org>2017-08-31 13:50:25 +0400
commitcf3a74eb60410e092c3098e77d818b7953c41d16 (patch)
treee33daf240ebbe6da027e01eb7ee8118177c9b707 /sql/sql_cache.h
parent5dd8e1bf2d15a68359e37b439a0d5999808b8001 (diff)
downloadmariadb-git-cf3a74eb60410e092c3098e77d818b7953c41d16.tar.gz
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.
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r--sql/sql_cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 3230034cf74..383bff305d9 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -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();