<?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: Obscure MySQL variable explained: max_seeks_for_key</title> <atom:link href="http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/feed/" rel="self" type="application/rss+xml" /><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/</link> <description>Words of wisdom from a server administrator</description> <lastBuildDate>Wed, 17 Mar 2010 10:13:25 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Franck</title><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-15964</link> <dc:creator>Franck</dc:creator> <pubDate>Tue, 09 Mar 2010 15:11:00 +0000</pubDate> <guid isPermaLink="false">http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-15964</guid> <description>r I C h, thanks a bunch ! Just when I was considering giving up, I came across your post which gave me the solution. Stupid me ! I</description> <content:encoded><![CDATA[<p>r I C h, thanks a bunch !<br /> Just when I was considering giving up, I came across your post which gave me the solution. Stupid me !<br /> I</p> ]]></content:encoded> </item> <item><title>By: r I C h</title><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-13947</link> <dc:creator>r I C h</dc:creator> <pubDate>Fri, 13 Mar 2009 04:23:34 +0000</pubDate> <guid isPermaLink="false">http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-13947</guid> <description>This falls in the category of &quot;i&#039;m an idiot&quot;, but when you&#039;re looking up on a varchar column, make sure you put the lookup in quotes. eg (if &#039;reg_id&#039; is a varchar): GOOD: &quot;select name from user where reg_id=&#039;1234567&#039;&quot; BAD: &quot;select name from user where reg_id=1234567&quot;Not doing so will force the MySQL optimizer to do a full table scan, and no amount of &#039;force index&#039; or &#039;max_seeks_for_key&#039; will fix that.</description> <content:encoded><![CDATA[<p>This falls in the category of "i'm an idiot", but when you're looking up on a varchar column, make sure you put the lookup in quotes. eg (if 'reg_id' is a varchar):<br /> GOOD: "select name from user where reg_id='1234567'"<br /> BAD: "select name from user where reg_id=1234567"</p><p>Not doing so will force the MySQL optimizer to do a full table scan, and no amount of 'force index' or 'max_seeks_for_key' will fix that.</p> ]]></content:encoded> </item> <item><title>By: dbnewz &#187; Blog Archive &#187; Cardinalité, sélectivité et distributivité d&#8217;un index MySQL : quel impact sur le plan d&#8217;exécution ?</title><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-2603</link> <dc:creator>dbnewz &#187; Blog Archive &#187; Cardinalité, sélectivité et distributivité d&#8217;un index MySQL : quel impact sur le plan d&#8217;exécution ?</dc:creator> <pubDate>Thu, 04 Sep 2008 22:37:43 +0000</pubDate> <guid isPermaLink="false">http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-2603</guid> <description>[...] Sachez qu&#8217;il existe une variable serveur, max_seeks_for_key (on en parle aussi ici et là) sur laquelle il est possible de jouer pour orienter les choix de [...]</description> <content:encoded><![CDATA[<p>[...] Sachez qu&#8217;il existe une variable serveur, max_seeks_for_key (on en parle aussi ici et là) sur laquelle il est possible de jouer pour orienter les choix de [...]</p> ]]></content:encoded> </item> <item><title>By: Georgi Kodinov</title><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-20</link> <dc:creator>Georgi Kodinov</dc:creator> <pubDate>Fri, 31 Aug 2007 12:06:09 +0000</pubDate> <guid isPermaLink="false">http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-20</guid> <description>hmm : the formula is : max_seeks_for_key = &lt;number of records in the table&gt; / &lt;cardinality=number of unique records&gt;.Stupid HTML :(</description> <content:encoded><![CDATA[<p>hmm : the formula is :<br /> max_seeks_for_key = &lt;number of records in the table&gt; / &lt;cardinality=number of unique records&gt;.</p><p>Stupid HTML <img src='http://cdn.rackerhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Georgi Kodinov</title><link>http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-19</link> <dc:creator>Georgi Kodinov</dc:creator> <pubDate>Fri, 31 Aug 2007 12:04:45 +0000</pubDate> <guid isPermaLink="false">http://rackerhacker.com/2007/08/03/obscure-mysql-variable-explained-max_seeks_for_key/#comment-19</guid> <description>Indeed the documentation is not very clear about what max_seeks_for_key is. Actually it&#039;s not the cardinality. It is the number of rows you&#039;ll find for a unique value of the key. So this makes it : max_seeks_for_key =  / . What limiting max_seeks_for_key means ? This means that it will still consider indexes that have very low cardinality to be considered otherwise. This is why it&#039;s not 1000 by default, but rather is set to the MAX_INT, so it can leave the optimizer to decide based on the statistics that it has.</description> <content:encoded><![CDATA[<p>Indeed the documentation is not very clear about what max_seeks_for_key is.<br /> Actually it's not the cardinality. It is the number of rows you'll find for a unique value of the key.<br /> So this makes it :<br /> max_seeks_for_key =  / .<br /> What limiting max_seeks_for_key means ? This means that it will still consider indexes that have very low cardinality to be considered otherwise.<br /> This is why it's not 1000 by default, but rather is set to the MAX_INT, so it can leave the optimizer to decide based on the statistics that it has.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 3/12 queries in 0.010 seconds using disk
Content Delivery Network via cdn.rackerhacker.com

Served from: dfw.mhtx.net @ 2010-03-17 16:28:49 -->