<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>have_query_cache &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/have_query_cache/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Tue, 21 Nov 2017 06:02:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>MySQL Query Cache Part II/II</title>
		<link>https://www.dbrnd.com/2015/08/mysql-query-cache-configuration/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 08 Aug 2015 16:54:51 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[have_query_cache]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Query Cache]]></category>
		<category><![CDATA[query_cache_size]]></category>
		<category><![CDATA[query_cache_type]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=332</guid>

					<description><![CDATA[In the previous post, I shared a basic note on MySQL Query Cache. In this post, I am sharing the details on Query Cache configuration and monitoring. The first check, Query Cache is available or not. Please execute below SHOW command: [crayon-6aa4ad64c31e2920893976/] To disable the query cache at server startup, set the query_cache_size system variable [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&amp;linkname=MySQL%20Query%20Cache%20Part%20II%2FII" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fmysql-query-cache-configuration%2F&#038;title=MySQL%20Query%20Cache%20Part%20II%2FII" data-a2a-url="https://www.dbrnd.com/2015/08/mysql-query-cache-configuration/" data-a2a-title="MySQL Query Cache Part II/II"></a></p><p>In the previous post, I shared a basic note on MySQL Query Cache.<br />
In this post, I am sharing the details on Query Cache configuration and monitoring. </p>
<p>The first check, Query Cache is available or not.</p>
<p><strong>Please execute below SHOW command:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; SHOW VARIABLES LIKE 'have_query_cache';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| have_query_cache | YES   |
+------------------+-------+</pre>
<blockquote><p>To disable the query cache at server startup, set the <strong>query_cache_size</strong> system variable to 0. By default, the query cache is disabled.</p></blockquote>
<p>Using query_cache_size you can set the size of Query Cache which must be larger when you are planning to hold more data into Cache but again this is a task of analysis of your memory usage. </p>
<pre class="crayon-plain-tag">mysql&gt; SET GLOBAL query_cache_size = 1000000;
Query OK, 0 rows affected (0.04 sec)

mysql&gt; SHOW VARIABLES LIKE 'query_cache_size';
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| query_cache_size | 999424 |
+------------------+--------+
1 row in set (0.00 sec)</pre>
<p><strong>Query Cache with SELECT :</strong></p>
<pre class="crayon-plain-tag">SELECT SQL_CACHE * FROM tbl_users;
SELECT SQL_NO_CACHE * FROM tbl_users;</pre>
<p>In the above two select statements, you can find two identifiers.</p>
<p><strong>SQL_CACHE</strong></p>
<p>The query result is cached if it is cacheable and the value of the query_cache_type system variable is ON or DEMAND.</p>
<p><strong>SQL_NO_CACHE</strong></p>
<p>The server does not use the query cache. It neither checks the query cache to see whether the result is already cached nor does it cache the query result.</p>
<pre class="crayon-plain-tag">SHOW VARIABLES LIKE 'query_cache_type';</pre>
Using query_cache_type you can set the type of query cache. It should be ON, OFF or DEMAND.</p>
<ul>
<li>A value of 0 or OFF prevents caching or retrieval of cached results.</li>
<li>A value of 1 or ON enables caching except of those statements that begin with SELECT SQL_NO_CACHE.</li>
<li>A value of 2 or DEMAND causes caching of only those statements that begin with SELECT SQL_CACHE.</li>
</ul>
<p><strong>To monitor query cache performance, use SHOW STATUS to view the cache status variables:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; SHOW STATUS LIKE 'Qcache%';
+-------------------------+--------+
| Variable_name           | Value  |
+-------------------------+--------+
| Qcache_free_blocks      | 36     |
| Qcache_free_memory      | 138488 |
| Qcache_hits             | 79570  |
| Qcache_inserts          | 27087  |
| Qcache_lowmem_prunes    | 3114   |
| Qcache_not_cached       | 22989  |
| Qcache_queries_in_cache | 415    |
| Qcache_total_blocks     | 912    |
+-------------------------+--------+</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
