<?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: 32 tips to speed up your queries</title>
	<atom:link href="http://i1t2b3.com/2009/01/19/quick-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://i1t2b3.com/2009/01/19/quick-queries/</link>
	<description>Any fool can make things bigger and more complex</description>
	<lastBuildDate>Fri, 16 Dec 2011 21:33:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Vadim Voituk</title>
		<link>http://i1t2b3.com/2009/01/19/quick-queries/comment-page-1/#comment-323</link>
		<dc:creator>Vadim Voituk</dc:creator>
		<pubDate>Fri, 06 Feb 2009 17:23:22 +0000</pubDate>
		<guid isPermaLink="false">http://i1t2b3.com/?p=160#comment-323</guid>
		<description>1. ... and make sure that you`re always close you connection (or you`ll get &quot;too many connections&quot; error)

7.... 
&gt;&gt; WHERE hash_column = MD5( CONCAT(col1, col2) )
&gt;&gt; AND col1=&#039;aaa&#039; AND col2=&#039;bbb&#039;
This will cause full table scan every time, if no indexes for `col1` and `col2` specified

14. 
&gt;&gt; ... This reduces the query parsing time.
It is cost nothing compared to data insert &amp; index rebuild on insert.


... and there are few tips added by me
0. ALWAYS use EXPLAIN query on each query that doesn`t use PRIMARY KEY (eg. SELECT ... FROM ... WHERE id=...)

33. Don`t use NOW() or CURRENT_TIMESTAMP() - it is flushes query cache

34. Avoid of using ORDER BY .. DESC - it is always create temporary table.
Use default/ascending order in any cases where it is possible.</description>
		<content:encoded><![CDATA[<p>1. &#8230; and make sure that you`re always close you connection (or you`ll get &#8220;too many connections&#8221; error)</p>
<p>7&#8230;.<br />
&gt;&gt; WHERE hash_column = MD5( CONCAT(col1, col2) )<br />
&gt;&gt; AND col1=&#8217;aaa&#8217; AND col2=&#8217;bbb&#8217;<br />
This will cause full table scan every time, if no indexes for `col1` and `col2` specified</p>
<p>14.<br />
&gt;&gt; &#8230; This reduces the query parsing time.<br />
It is cost nothing compared to data insert &amp; index rebuild on insert.</p>
<p>&#8230; and there are few tips added by me<br />
0. ALWAYS use EXPLAIN query on each query that doesn`t use PRIMARY KEY (eg. SELECT &#8230; FROM &#8230; WHERE id=&#8230;)</p>
<p>33. Don`t use NOW() or CURRENT_TIMESTAMP() &#8211; it is flushes query cache</p>
<p>34. Avoid of using ORDER BY .. DESC &#8211; it is always create temporary table.<br />
Use default/ascending order in any cases where it is possible.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

