<?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>Data-Diggers.com &#187; Query Log</title>
	<atom:link href="http://www.data-diggers.com/index.php/tag/query-log/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.data-diggers.com</link>
	<description>Zen Cart Optimization, Performance and A/B Split Testing Modules for Zen Cart</description>
	<lastBuildDate>Mon, 24 May 2010 18:56:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Query Log v1.5.1 released</title>
		<link>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/</link>
		<comments>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 10:14:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Query Log]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=51</guid>
		<description><![CDATA[
			
				
			
		
Version v1.5.1 of Query Log is available. You can download it from: www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip .
What&#8217;s new in this version:

You can now close &#8216;calculator&#8217; layer (it&#8217;s the tool that highlights queries that match given regular expression)
You can now disable query logging completely. In previous versions Query Log kept all queries in memory, no matter if You wanted to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fquery-log-v1-5-1-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fquery-log-v1-5-1-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">Version v1.5.1 of<strong> Query Log </strong>is available. You can download it from: <a href="http://www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip">www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip</a> .</p>
<h2 style="text-align: justify;">What&#8217;s new in this version:</h2>
<ul style="text-align: justify;">
<li>You can now close &#8216;calculator&#8217; layer (it&#8217;s the tool that highlights queries that match given regular expression)</li>
<li>You can now disable query logging completely. In previous versions Query Log kept all queries in memory, no matter if You wanted to log them (display them) or not.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query Log Released</title>
		<link>http://www.data-diggers.com/index.php/2008/12/query-log-released/</link>
		<comments>http://www.data-diggers.com/index.php/2008/12/query-log-released/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 12:12:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Query Log]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=21</guid>
		<description><![CDATA[
			
				
			
		
Query Log for Zen Cart is open source, simple tool for monitoring performance of SQL queries. Depending on configuration it will display or save all executed queries sent to database together with information how much time each query took and which page and session executed it. With Query Log and some SQL knowledge You can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2008%2F12%2Fquery-log-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2008%2F12%2Fquery-log-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;"><strong>Query Log for Zen Cart</strong> is open source, simple tool for monitoring performance of SQL queries. Depending on configuration it will display or save all executed queries sent to database together with information how much time each query took and which page and session executed it. With Query Log and some SQL knowledge You can improve performance of Your Zen Cart store.</p>
<p style="text-align: justify;">At this moment there are two components:</p>
<ul style="text-align: justify;">
<li>Basic Logger &#8211; it&#8217;ll display to trusted users all logged queries in Zen Cart shop footer.</li>
<li>Database Logger &#8211; it&#8217;ll save all logged queries to database.</li>
</ul>
<h2 style="text-align: justify;"><strong>Demo Stores</strong></h2>
<p style="text-align: justify;">Because Database Logger does not display anything to users no demo store is available for it.</p>
<p style="text-align: justify;">Here&#8217;s demo store for Basic Logger: <a rel="nofollow" href="http://www.data-diggers.com/contribs/query-log/demo-stores/with-query-log">Basic Logger Demo Store</a></p>
<h2 style="text-align: justify;"><strong>Basic Logger</strong></h2>
<p style="text-align: justify;">Basic Logger for each page request logs all queries sent to database and displays them to trusted users in page footer together with time each query took. It will mark with red color queries that take much more time then average. See <a href="http://www.data-diggers.com/query-log#screencast">screencast</a> to see it in action.</p>
<p style="text-align: justify;"><strong>Note:</strong> Basic Logger is based on contribution made by Chemo for osCommerce, We just added few features to it.</p>
<h2 style="text-align: justify;"><strong>Database Logger</strong></h2>
<p style="text-align: justify;">Database Logger does everything that Basic Logger do. In addition it also saves all queries from all page requests of all visitors in database table. You can then execute various queries to check which queries should be optimized, which pages generates most queries, what is average time spent in database etc.</p>
<p style="text-align: justify;">Database Logger is as fast as possible, it uses MyISAM tables without primary key and indexes to store queries (this means that MySQL server does not spend time updating lookup tables). Also, if MySQL ver. 5.0 or later is available You can use Archive storage engine to compress logs (installation script provides two versions of sql patches, one for MySQL ver. 5.0 or later, and one for earlier versions).</p>
<p style="text-align: justify;"><strong>Warning</strong>: before turning on Database Logger make sure that You know what You&#8217;re doing. Storing all queries in database can take <strong>huge</strong> amounts of disk space.</p>
<p style="text-align: justify;">You can do various things with query_log table, below are few simple use cases.</p>
<p style="text-align: justify;">To list slowest queries execute:</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">SELECT</span> <span class="sy0">*</span><br />
<span class="kw1">FROM</span> query_log<br />
<span class="kw1">ORDER</span> <span class="kw1">BY</span> time <span class="kw1">DESC</span><br />
<span class="kw1">LIMIT</span> <span class="nu0">100</span></div>
</div>
<p style="text-align: justify;">You can check what is average time spent in database for each type of page (product_info, index, advanced_search_results etc.):</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">SELECT</span> page<span class="sy0">,</span> AVG<span class="br0">&#40;</span>time<span class="br0">&#41;</span> <span class="kw1">AS</span> <span class="st0">&#8216;average_time&#8217;</span><br />
<span class="kw1">FROM</span> query_log<br />
<span class="kw1">GROUP</span> <span class="kw1">BY</span> page<br />
<span class="kw1">ORDER</span> <span class="kw1">BY</span> average_time <span class="kw1">DESC</span></div>
</div>
</div>
<p style="text-align: justify;">Listing queries executed on &#8216;product_info&#8217; page that takes more then 0.1 sec to complete:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">SELECT</span> <span class="sy0">*</span><br />
<span class="kw1">FROM</span> query_log<br />
<span class="kw1">WHERE</span> page <span class="sy0">=</span> <span class="st0">&#8216;product_info&#8217;</span><br />
<span class="kw1">AND</span> time <span class="sy0">&gt;=</span> <span class="nu0">0.1</span></div>
</div>
</div>
<h2 style="text-align: justify;"><strong><a name="screencast"></a>Screencast</strong></h2>
<p style="text-align: justify;">Here&#8217;s screencast showing how to install and use Query Log:</p>
<p style="text-align: center;"><a href="http://www.data-diggers.com/contribs/query-log/screencasts/installation/installation.html" target="_blank"><img src="http://www.data-diggers.com/contribs/query-log/screencasts/installation/thumb.jpg" border="0" alt="" /></a></p>
<h2 style="text-align: justify;"><strong>Download</strong></h2>
<p style="text-align: justify;">Here You can download Query Log compatible with all 1.3.x Zen Cart versions.</p>
<p style="text-align: justify;"><a href="http://www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip"><strong><em>Download Query Log</em></strong></a></p>
<h2 style="text-align: justify;"><strong>Installation</strong></h2>
<p style="text-align: justify;">Requirements:</p>
<ul style="text-align: justify;">
<li>You can use Query Log with any version of Zen Cart 1.3.x.</li>
<li>PHP &gt;= 4.x is required.</li>
<li><a href="http://www.data-diggers.com/query-cache">Query Cache</a> is required. If You don&#8217;t want to use Query Cache You have to change <em>includes/classes/db/mysql/query_factory.php</em> to use Query Log</li>
</ul>
<p style="text-align: justify;">Query Log is quite easy to install. First You need to download it. After that extract it with Winzip or something similar and follow instructions below:</p>
<ol style="text-align: justify;">
<li>BACKUP BACKUP BACKUP!</li>
<li>Upload &#8216;includes&#8217; directory (from directory corresponding to Your Zen Cart version) on Your server (via ftp, sftp or any other protocol).</li>
<li>If You use MySQL &gt;=5.0 copy and paste contents of sql_patch_for_mysql_5.x.sql into Store Admin Panel -&gt; Tools -&gt; Install SQL Patches. Execute the script.</li>
<li>If You use MySQL &lt;5.0 copy and paste contents of sql_patch.sql into Store Admin Panel -&gt; Tools -&gt; Install SQL Patches. Execute the script.</li>
<li>Done.</li>
</ol>
<p style="text-align: justify;">If You use custom template add following line to proper tpl_main_page.php somewhere near end of the file:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span> display_query_log<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy1">?&gt;</span></div>
</div>
</div>
<p style="text-align: justify;">After installation You&#8217;ll need to configure Query Log.</p>
<h2 style="text-align: justify;"><strong>Configuration</strong></h2>
<p style="text-align: justify;">Query Log adds three options to Admin Panel -&gt; Configuration -&gt; Logging:</p>
<ul style="text-align: justify;">
<li>Enable Database Query Log</li>
<li>Display queries to trusted users</li>
<li>Display queries to users with following email addresses (list of trusted users</li>
</ul>
<h3 style="text-align: justify;"><em>Enable Database Query Log</em></h3>
<p style="text-align: justify;">When enabled <strong>all </strong>logged queries will be saved in database in <strong>query_log</strong> table.</p>
<h3 style="text-align: justify;"><em>Display queries to trusted users</em></h3>
<p style="text-align: justify;">Enables Basic Logger. It will display queries only to logged in users with email addresses listed in <em>Display queries to users with following email addresses</em></p>
<h3 style="text-align: justify;"><em>Display queries to users with following email addresses</em></h3>
<p style="text-align: justify;">Comma separated list of emails.</p>
<h2 style="text-align: justify;"><strong>Stay in touch</strong></h2>
<p style="text-align: justify;">If You wish to be notified about new versions of Query Log, use cases, new screen casts or anything else related to Query Log type Your email address below hit &#8216;Subscribe&#8217;. You will only receive news regarding this contribution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2008/12/query-log-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
