<?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: Another MySQL Proxy Tutorial</title>
	<atom:link href="http://www.chriscalender.com/?feed=rss2&#038;p=6" rel="self" type="application/rss+xml" />
	<link>http://www.chriscalender.com/?p=6</link>
	<description>Tips and Solutions for MySQL, MySQL Proxy, and other MySQL-related Topics</description>
	<pubDate>Thu, 09 Sep 2010 13:21:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Another MySQL Proxy Tutorial Chris on MySQL &#124; Paid Surveys</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-178</link>
		<dc:creator>Another MySQL Proxy Tutorial Chris on MySQL &#124; Paid Surveys</dc:creator>
		<pubDate>Tue, 02 Jun 2009 06:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-178</guid>
		<description>[...] Another MySQL Proxy Tutorial Chris on MySQL   Posted by root 1 hour 6 minutes ago (http://www.chriscalender.com)        You can see it starts by appending the comment which is of the form comment where comment is chris on mysql is proudly powered by wordpress        Discuss&#160;  &#124;&#160; Bury &#124;&#160;    News &#124; Another MySQL Proxy Tutorial Chris on MySQL [...]</description>
		<content:encoded><![CDATA[<p>[...] Another MySQL Proxy Tutorial Chris on MySQL   Posted by root 1 hour 6 minutes ago (http://www.chriscalender.com)        You can see it starts by appending the comment which is of the form comment where comment is chris on mysql is proudly powered by wordpress        Discuss&nbsp;  |&nbsp; Bury |&nbsp;    News | Another MySQL Proxy Tutorial Chris on MySQL [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-152</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Sun, 17 May 2009 01:46:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-152</guid>
		<description>@Facebook Proxy: You can subscribe to this using the following RSS feed:
http://www.chriscalender.com/?feed=rss2</description>
		<content:encoded><![CDATA[<p>@Facebook Proxy: You can subscribe to this using the following RSS feed:<br />
<a href="http://www.chriscalender.com/?feed=rss2" rel="nofollow">http://www.chriscalender.com/?feed=rss2</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: facebook proxy</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-144</link>
		<dc:creator>facebook proxy</dc:creator>
		<pubDate>Thu, 14 May 2009 05:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-144</guid>
		<description>How do I add this to my RSS reader? Sorry I'm a newbie :(</description>
		<content:encoded><![CDATA[<p>How do I add this to my RSS reader? Sorry I&#8217;m a newbie <img src='http://www.chriscalender.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-93</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Mon, 20 Apr 2009 22:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-93</guid>
		<description>Note that I have updated this solution by creating a new comand SHOW PROXY PROCESSLIST that shows the originating IP address for every connection (not just active queries).  It also does not interfere with the query cache.  I've detailed how to implement this on the following page:

http://www.chriscalender.com/?p=41</description>
		<content:encoded><![CDATA[<p>Note that I have updated this solution by creating a new comand SHOW PROXY PROCESSLIST that shows the originating IP address for every connection (not just active queries).  It also does not interfere with the query cache.  I&#8217;ve detailed how to implement this on the following page:</p>
<p><a href="http://www.chriscalender.com/?p=41" rel="nofollow">http://www.chriscalender.com/?p=41</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SHOW PROXY PROCESSLIST : Another Proxy Tutorial Revisited &#171; Chris on MySQL</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-76</link>
		<dc:creator>SHOW PROXY PROCESSLIST : Another Proxy Tutorial Revisited &#171; Chris on MySQL</dc:creator>
		<pubDate>Wed, 15 Apr 2009 22:24:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-76</guid>
		<description>[...] a previous post, Another Proxy Tutorial, I outlined how you could find and display the originating IP address of a particular query from [...]</description>
		<content:encoded><![CDATA[<p>[...] a previous post, Another Proxy Tutorial, I outlined how you could find and display the originating IP address of a particular query from [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Calender</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-6</link>
		<dc:creator>Chris Calender</dc:creator>
		<pubDate>Wed, 28 Jan 2009 00:44:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-6</guid>
		<description>Renaud, Morgan, Kay, and Baron - Thanks for the comments!

I've worked on this a bit further, and have found one tweak that will help with the query cache.

This is only a change to the 3rd line (the declaration and definition of the variable "query").

Here is the new line of code:

local query = "/* " .. string.gsub(proxy.connection.client["address"],":%d+"," ") .. "*/ " .. string.sub(packet, 2)

The "gsub" call is what's new.  

Basically, this strips off the ":" and the trailing id.  Therefore only returning the IP address.  This will help a lot for the query cache.

Now, at least all queries that originate from the same server can use the query cache.  Note queries that are the same, but originate from different IP addresses will result in 2 entries into the query cache (assuming it is enabled).

So instead of seeing queries like the following:

/* 127.0.0.1:11251 */ show processlist 
/* 10.1.10.1:15091 */ select sleep(30)
/* 10.1.10.2:18166 */ select sleep(30)
/* 10.1.10.3:18934 */ select sleep(30)
/* 10.1.10.4:19446 */ select sleep(30)

They will now appear as:

/* 127.0.0.1 */ show processlist 
/* 10.1.10.1 */ select sleep(30)
/* 10.1.10.2 */ select sleep(30)
/* 10.1.10.3 */ select sleep(30)
/* 10.1.10.4 */ select sleep(30)</description>
		<content:encoded><![CDATA[<p>Renaud, Morgan, Kay, and Baron - Thanks for the comments!</p>
<p>I&#8217;ve worked on this a bit further, and have found one tweak that will help with the query cache.</p>
<p>This is only a change to the 3rd line (the declaration and definition of the variable &#8220;query&#8221;).</p>
<p>Here is the new line of code:</p>
<p>local query = &#8220;/* &#8221; .. string.gsub(proxy.connection.client["address"],&#8221;:%d+&#8221;,&#8221; &#8220;) .. &#8220;*/ &#8221; .. string.sub(packet, 2)</p>
<p>The &#8220;gsub&#8221; call is what&#8217;s new.  </p>
<p>Basically, this strips off the &#8220;:&#8221; and the trailing id.  Therefore only returning the IP address.  This will help a lot for the query cache.</p>
<p>Now, at least all queries that originate from the same server can use the query cache.  Note queries that are the same, but originate from different IP addresses will result in 2 entries into the query cache (assuming it is enabled).</p>
<p>So instead of seeing queries like the following:</p>
<p>/* 127.0.0.1:11251 */ show processlist<br />
/* 10.1.10.1:15091 */ select sleep(30)<br />
/* 10.1.10.2:18166 */ select sleep(30)<br />
/* 10.1.10.3:18934 */ select sleep(30)<br />
/* 10.1.10.4:19446 */ select sleep(30)</p>
<p>They will now appear as:</p>
<p>/* 127.0.0.1 */ show processlist<br />
/* 10.1.10.1 */ select sleep(30)<br />
/* 10.1.10.2 */ select sleep(30)<br />
/* 10.1.10.3 */ select sleep(30)<br />
/* 10.1.10.4 */ select sleep(30)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-5</link>
		<dc:creator>Baron</dc:creator>
		<pubDate>Fri, 23 Jan 2009 11:11:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-5</guid>
		<description>Actually a query that has a comment in front will still use the query cache.  But since there's a DIFFERENT comment for each host, queries coming from each host will NOT be able to share the query cache amongst themselves.  I'll be able to get hits from the cache for my requests, but Morgan won't get them when he runs the "same" query, because it's not the same anymore after Proxy rewrites it.  So Morgan and I will cause cache duplication.</description>
		<content:encoded><![CDATA[<p>Actually a query that has a comment in front will still use the query cache.  But since there&#8217;s a DIFFERENT comment for each host, queries coming from each host will NOT be able to share the query cache amongst themselves.  I&#8217;ll be able to get hits from the cache for my requests, but Morgan won&#8217;t get them when he runs the &#8220;same&#8221; query, because it&#8217;s not the same anymore after Proxy rewrites it.  So Morgan and I will cause cache duplication.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kay Roepke</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-4</link>
		<dc:creator>Kay Roepke</dc:creator>
		<pubDate>Fri, 23 Jan 2009 10:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-4</guid>
		<description>Hey,

please also see my little response to it :)
http://blogs.sun.com/kay/entry/query_cache_and_comments

In a nutshell: It totally depends on the version you are using.
Very nice, btw, and great to see you taking up blogging :)</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>please also see my little response to it <img src='http://www.chriscalender.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://blogs.sun.com/kay/entry/query_cache_and_comments" rel="nofollow">http://blogs.sun.com/kay/entry/query_cache_and_comments</a></p>
<p>In a nutshell: It totally depends on the version you are using.<br />
Very nice, btw, and great to see you taking up blogging <img src='http://www.chriscalender.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Tocker</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-3</link>
		<dc:creator>Morgan Tocker</dc:creator>
		<pubDate>Thu, 22 Jan 2009 22:08:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-3</guid>
		<description>Renaud - nope, you're right, it won't hit query cache.  Stripping comments before checking in the query cache wouldn't work.  i.e.

SELECT * from my_table WHERE value = 'this is /* a comment */ here'

(You really need a parser to determine this)

But the query cache doesn't work for everyone.  I use a similar technique to Chris' tip to write either the function name or request_uri that required the query in a comment.  i.e.

/* mypage.php?arg1=321312 */ SELECT * FROM my_table WHERE ...;

That way this information can make my slow query log as well.</description>
		<content:encoded><![CDATA[<p>Renaud - nope, you&#8217;re right, it won&#8217;t hit query cache.  Stripping comments before checking in the query cache wouldn&#8217;t work.  i.e.</p>
<p>SELECT * from my_table WHERE value = &#8216;this is /* a comment */ here&#8217;</p>
<p>(You really need a parser to determine this)</p>
<p>But the query cache doesn&#8217;t work for everyone.  I use a similar technique to Chris&#8217; tip to write either the function name or request_uri that required the query in a comment.  i.e.</p>
<p>/* mypage.php?arg1=321312 */ SELECT * FROM my_table WHERE &#8230;;</p>
<p>That way this information can make my slow query log as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renaud Drousies</title>
		<link>http://www.chriscalender.com/?p=6&cpage=1#comment-2</link>
		<dc:creator>Renaud Drousies</dc:creator>
		<pubDate>Thu, 22 Jan 2009 21:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscalender.com/?p=6#comment-2</guid>
		<description>This is a really great tip but it should be used with caution as the query cache will rarely be hit, I don't think the comments are stripped before getting in the cache. (but I might be wrong)</description>
		<content:encoded><![CDATA[<p>This is a really great tip but it should be used with caution as the query cache will rarely be hit, I don&#8217;t think the comments are stripped before getting in the cache. (but I might be wrong)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
