<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MySQL Query Cache  WhiteSpace and comments</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 07 Nov 2009 18:35:44 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: roselynn</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-667317</link>
		<dc:creator>roselynn</dc:creator>
		<pubDate>Wed, 21 Oct 2009 16:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-667317</guid>
		<description>is there a way to include whitespace / space characters in a query?

eg: &#039;%to% go&#039; 

will return: &#039;to stay or go&#039;
but not:     &#039;tobago&#039;</description>
		<content:encoded><![CDATA[<p>is there a way to include whitespace / space characters in a query?</p>
<p>eg: &#8216;%to% go&#8217; </p>
<p>will return: &#8216;to stay or go&#8217;<br />
but not:     &#8216;tobago&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-575573</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 05 Jun 2009 14:50:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-575573</guid>
		<description>Good catch.

Hm.... Your results seems to show the comment upfront is not stripped - just does not block caching.
All second query run queries but timestamp  query were instant.  Timestamp query was also the same query just with different leading comment and it was not cached.

I&#039;d consider it a bug.</description>
		<content:encoded><![CDATA[<p>Good catch.</p>
<p>Hm&#8230;. Your results seems to show the comment upfront is not stripped &#8211; just does not block caching.<br />
All second query run queries but timestamp  query were instant.  Timestamp query was also the same query just with different leading comment and it was not cached.</p>
<p>I&#8217;d consider it a bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devis Lucato</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-575355</link>
		<dc:creator>Devis Lucato</dc:creator>
		<pubDate>Fri, 05 Jun 2009 10:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-575355</guid>
		<description>I&#039;ve run a very simple test using with a PHP script and a table with ~400k rows.
After restarting Mysql, to delete the cache, this is the result.

Mysql : 5.0.51a-24 (Debian)
PHP   : 5.2.6-1+lenny2 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 26 2009 22:41:04)

FIRST RUN

	/* comment 1 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.823220014572
	
	/* comment 2 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.852579116821 seconds
	
	/* comment 3 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.84706401825 seconds
	
	/* comment 4 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.83235502243 seconds
	
	/* comment 5 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.859950065613 seconds
	
	/* timestamp 1244198091 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.470226049423 seconds



SECOND RUN

	/* comment 1 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.00132608413696
	
	/* comment 2 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.00090503692627 seconds
	
	/* comment 3 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.000951051712036 seconds
	
	/* comment 4 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.000913858413696 seconds
	
	/* comment 5 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.000999927520752 seconds
	
	/* timestamp 1244198149 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &quot;%c%&quot;
	0.39192199707 seconds
	
I&#039;d say that injecting dynamic comments clearly affects caching negatively, more memory consumption and slower results.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve run a very simple test using with a PHP script and a table with ~400k rows.<br />
After restarting Mysql, to delete the cache, this is the result.</p>
<p>Mysql : 5.0.51a-24 (Debian)<br />
PHP   : 5.2.6-1+lenny2 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 26 2009 22:41:04)</p>
<p>FIRST RUN</p>
<p>	/* comment 1 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.823220014572</p>
<p>	/* comment 2 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.852579116821 seconds</p>
<p>	/* comment 3 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.84706401825 seconds</p>
<p>	/* comment 4 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.83235502243 seconds</p>
<p>	/* comment 5 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.859950065613 seconds</p>
<p>	/* timestamp 1244198091 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.470226049423 seconds</p>
<p>SECOND RUN</p>
<p>	/* comment 1 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.00132608413696</p>
<p>	/* comment 2 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.00090503692627 seconds</p>
<p>	/* comment 3 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.000951051712036 seconds</p>
<p>	/* comment 4 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.000913858413696 seconds</p>
<p>	/* comment 5 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.000999927520752 seconds</p>
<p>	/* timestamp 1244198149 */ SELECT count(*) FROM `mytable` WHERE `myfield` LIKE &#8220;%c%&#8221;<br />
	0.39192199707 seconds</p>
<p>I&#8217;d say that injecting dynamic comments clearly affects caching negatively, more memory consumption and slower results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL Formatting » Bogatas.Org</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-503273</link>
		<dc:creator>SQL Formatting » Bogatas.Org</dc:creator>
		<pubDate>Thu, 12 Mar 2009 08:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-503273</guid>
		<description>[...] Whitespace is ignored by MySQL&#8217;s parser, but not by MySQL&#8217;s query cache on versions &lt;5 , thanks to foobar for pointing that out. So if you want query cache to pay off.. Pick one format [...]</description>
		<content:encoded><![CDATA[<p>[...] Whitespace is ignored by MySQL&#8217;s parser, but not by MySQL&#8217;s query cache on versions &lt;5 , thanks to foobar for pointing that out. So if you want query cache to pay off.. Pick one format [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-257241</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 25 Mar 2008 18:44:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-257241</guid>
		<description>Thanks indeed there is an option to skip comments now and you should run mysql -c if you want do to this kind of resting with command line client</description>
		<content:encoded><![CDATA[<p>Thanks indeed there is an option to skip comments now and you should run mysql -c if you want do to this kind of resting with command line client</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jenni s</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-257233</link>
		<dc:creator>jenni s</dc:creator>
		<pubDate>Tue, 25 Mar 2008 16:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-257233</guid>
		<description>it&#039;s the same:  the perl DBI doesn&#039;t strip out whitespace or comments, but it will strip out whitespace at the beginning of comments.</description>
		<content:encoded><![CDATA[<p>it&#8217;s the same:  the perl DBI doesn&#8217;t strip out whitespace or comments, but it will strip out whitespace at the beginning of comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jenni s</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-257230</link>
		<dc:creator>jenni s</dc:creator>
		<pubDate>Tue, 25 Mar 2008 16:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-257230</guid>
		<description>My understanding is that the mysql command line client now has an *option* to pass comments to the server, but it&#039;s disabled by default:
http://bugs.mysql.com/bug.php?id=26215

I&#039;m running the 5.0.56 client and server, and from the command line, my comment was stripped out (as seen by the query recorded in the slow query log).  However, when I ran this php script:


I *did* see the comment in the slow log:
# Time: 080325  9:31:43
# User@Host: dbadmin[dbadmin] @ localhost []
# Query_time: 2  Lock_time: 0  Rows_sent: 230400  Rows_examined: 480
select /* my comment */ * from test.WEBSITE a, test.WEBSITE b;</description>
		<content:encoded><![CDATA[<p>My understanding is that the mysql command line client now has an *option* to pass comments to the server, but it&#8217;s disabled by default:<br />
<a href="http://bugs.mysql.com/bug.php?id=26215" rel="nofollow">http://bugs.mysql.com/bug.php?id=26215</a></p>
<p>I&#8217;m running the 5.0.56 client and server, and from the command line, my comment was stripped out (as seen by the query recorded in the slow query log).  However, when I ran this php script:</p>
<p>I *did* see the comment in the slow log:<br />
# Time: 080325  9:31:43<br />
# User@Host: dbadmin[dbadmin] @ localhost []<br />
# Query_time: 2  Lock_time: 0  Rows_sent: 230400  Rows_examined: 480<br />
select /* my comment */ * from test.WEBSITE a, test.WEBSITE b;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-255007</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 21 Mar 2008 03:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-255007</guid>
		<description>As far as I know PHP does not do any conversion to the query passed, so whitespace remains whitespace. Though you&#039;re welcome to check it with DBI and let me know if it is different :)</description>
		<content:encoded><![CDATA[<p>As far as I know PHP does not do any conversion to the query passed, so whitespace remains whitespace. Though you&#8217;re welcome to check it with DBI and let me know if it is different <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Swanhart</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/comment-page-1/#comment-254967</link>
		<dc:creator>Justin Swanhart</dc:creator>
		<pubDate>Thu, 20 Mar 2008 23:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-cache-whitespace-and-comments/#comment-254967</guid>
		<description>Is PHP stripping off the whitespace from the front of the query?  I&#039;m curious if your same test run under Perl::DBI would behave consistently with the PHP test.</description>
		<content:encoded><![CDATA[<p>Is PHP stripping off the whitespace from the front of the query?  I&#8217;m curious if your same test run under Perl::DBI would behave consistently with the PHP test.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
