Commit 74f229fd authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

Merge abelkin@work.mysql.com:/home/bk/mysql-4.0

into sanja.is.com.ua:/home/bell/mysql/mysql-4.0
parents 0a75fe85 64047ea9
...@@ -320,6 +320,9 @@ insert into t1 select * from t2; ...@@ -320,6 +320,9 @@ insert into t1 select * from t2;
show status like "Qcache_hits"; show status like "Qcache_hits";
Variable_name Value Variable_name Value
Qcache_hits 4 Qcache_hits 4
show status like "Qcache_lowmem_prunes";
Variable_name Value
Qcache_lowmem_prunes 0
select a as a1, a as a2 from t1; select a as a1, a as a2 from t1;
select a as a2, a as a3 from t1; select a as a2, a as a3 from t1;
select a as a3, a as a4 from t1; select a as a3, a as a4 from t1;
...@@ -330,6 +333,9 @@ Qcache_hits 4 ...@@ -330,6 +333,9 @@ Qcache_hits 4
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 2 Qcache_queries_in_cache 2
show status like "Qcache_lowmem_prunes";
Variable_name Value
Qcache_lowmem_prunes 2
reset query cache; reset query cache;
insert into t2 select * from t1; insert into t2 select * from t1;
insert into t1 select * from t2; insert into t1 select * from t2;
......
...@@ -206,6 +206,7 @@ insert into t2 select * from t1; # 2584 ...@@ -206,6 +206,7 @@ insert into t2 select * from t1; # 2584
insert into t1 select * from t2; # 4181 insert into t1 select * from t2; # 4181
show status like "Qcache_hits"; show status like "Qcache_hits";
show status like "Qcache_lowmem_prunes";
disable_result_log; disable_result_log;
select a as a1, a as a2 from t1; select a as a1, a as a2 from t1;
select a as a2, a as a3 from t1; select a as a2, a as a3 from t1;
...@@ -215,6 +216,7 @@ select a as a1, a as a2 from t1; ...@@ -215,6 +216,7 @@ select a as a1, a as a2 from t1;
enable_result_log; enable_result_log;
show status like "Qcache_hits"; show status like "Qcache_hits";
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
show status like "Qcache_lowmem_prunes";
reset query cache; reset query cache;
# #
# Query bigger then query_cache_limit # Query bigger then query_cache_limit
......
...@@ -3793,6 +3793,7 @@ struct show_var_st status_vars[]= { ...@@ -3793,6 +3793,7 @@ struct show_var_st status_vars[]= {
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST}, {"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST},
{"Qcache_inserts", (char*) &query_cache.inserts, SHOW_LONG}, {"Qcache_inserts", (char*) &query_cache.inserts, SHOW_LONG},
{"Qcache_hits", (char*) &query_cache.hits, SHOW_LONG}, {"Qcache_hits", (char*) &query_cache.hits, SHOW_LONG},
{"Qcache_lowmem_prunes", (char*) &query_cache.lowmem_prunes, SHOW_LONG},
{"Qcache_not_cached", (char*) &query_cache.refused, SHOW_LONG}, {"Qcache_not_cached", (char*) &query_cache.refused, SHOW_LONG},
{"Qcache_free_memory", (char*) &query_cache.free_memory, {"Qcache_free_memory", (char*) &query_cache.free_memory,
SHOW_LONG_CONST}, SHOW_LONG_CONST},
......
...@@ -708,7 +708,7 @@ Query_cache::Query_cache(ulong query_cache_limit_arg, ...@@ -708,7 +708,7 @@ Query_cache::Query_cache(ulong query_cache_limit_arg,
:query_cache_size(0), :query_cache_size(0),
query_cache_limit(query_cache_limit_arg), query_cache_limit(query_cache_limit_arg),
queries_in_cache(0), hits(0), inserts(0), refused(0), queries_in_cache(0), hits(0), inserts(0), refused(0),
total_blocks(0), total_blocks(0), lowmem_prunes(0),
min_allocation_unit(ALIGN_SIZE(min_allocation_unit_arg)), min_allocation_unit(ALIGN_SIZE(min_allocation_unit_arg)),
min_result_data_size(ALIGN_SIZE(min_result_data_size_arg)), min_result_data_size(ALIGN_SIZE(min_result_data_size_arg)),
def_query_hash_size(ALIGN_SIZE(def_query_hash_size_arg)), def_query_hash_size(ALIGN_SIZE(def_query_hash_size_arg)),
...@@ -1512,6 +1512,7 @@ my_bool Query_cache::free_old_query() ...@@ -1512,6 +1512,7 @@ my_bool Query_cache::free_old_query()
if (query_block != 0) if (query_block != 0)
{ {
free_query(query_block); free_query(query_block);
lowmem_prunes++;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
} }
......
...@@ -219,7 +219,7 @@ class Query_cache ...@@ -219,7 +219,7 @@ class Query_cache
ulong query_cache_size, query_cache_limit; ulong query_cache_size, query_cache_limit;
/* statistics */ /* statistics */
ulong free_memory, queries_in_cache, hits, inserts, refused, ulong free_memory, queries_in_cache, hits, inserts, refused,
free_memory_blocks, total_blocks; free_memory_blocks, total_blocks, lowmem_prunes;
protected: protected:
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment