<?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: Error: 1104 &#8211; SQLSTATE: 42000 ER_TOO_BIG_SELECT</title> <atom:link href="http://iderror.com/errors/mysql/mysql-server/error-1104-sqlstate-42000-er_too_big_select/feed/" rel="self" type="application/rss+xml" /><link>http://iderror.com/errors/mysql/mysql-server/error-1104-sqlstate-42000-er_too_big_select/</link> <description>You have errors, we have solutions!</description> <lastBuildDate>Fri, 10 Jun 2011 15:06:54 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>By: srinivas panguluri</title><link>http://iderror.com/errors/mysql/mysql-server/error-1104-sqlstate-42000-er_too_big_select/comment-page-1/#comment-7744</link> <dc:creator>srinivas panguluri</dc:creator> <pubDate>Wed, 18 Mar 2009 01:49:13 +0000</pubDate> <guid
isPermaLink="false">http://localhost/idError/?p=7551#comment-7744</guid> <description>The actual problem: &quot;Maximum Join Size&quot; is not the same as &quot;Number of Records Returned.&quot; If you have to join two 1000-row tables, you&#039;ll have a maximum join size of around 1000x1000 = 1000000, since 1000000 different row combinations have to be compared, even if only one row matches! MySQL will optimize away many of these rows if you&#039;ve got a WHERE clause, but still, the join size in queries often ends up being enormous.The reason MySQLCC sets the max join size is to avoid user error -- the logic is, if you&#039;ve got a join size of 1000000 you&#039;re probably doing something wrong. Sometimes optimization solves this, sometimes the query is completely the opposite of what you intended, but often, you actually *do* want a join size of a million. The selection in server settings only goes up to 2^24 = 16 million (as far as I can tell, this number was selected arbitrarily), and even that is not always enough (the MySQL variable MAX_JOIN_SIZE is optional and has a limit of 2^32 = 4 billion, so any value from 1 to 4 billion should be available).When using the command-line client, MAX_JOIN_SIZE is ignored by default, since SQL_BIG_SELECTS=1. But MySQLCC enforces a MAX_JOIN_SIZE, even when you don&#039;t want one. The solution: Apply the patch I posted earlier. Then set the &quot;Maximum join size&quot; to 0; it will set SQL_BIG_SELECTS=1 and therefore not return an error on big queries.That said, in most cases you shouldn&#039;t go above a join size of a million if only 1 record is returned (except for GROUP BY queries, I suppose). If you&#039;re getting this error, chances are your query could be optimized considerably.</description> <content:encoded><![CDATA[<p>The actual problem: &#8220;Maximum Join Size&#8221; is not the same as &#8220;Number of Records Returned.&#8221; If you have to join two 1000-row tables, you&#8217;ll have a maximum join size of around 1000&#215;1000 = 1000000, since 1000000 different row combinations have to be compared, even if only one row matches! MySQL will optimize away many of these rows if you&#8217;ve got a WHERE clause, but still, the join size in queries often ends up being enormous.</p><p>The reason MySQLCC sets the max join size is to avoid user error &#8212; the logic is, if you&#8217;ve got a join size of 1000000 you&#8217;re probably doing something wrong. Sometimes optimization solves this, sometimes the query is completely the opposite of what you intended, but often, you actually *do* want a join size of a million. The selection in server settings only goes up to 2^24 = 16 million (as far as I can tell, this number was selected arbitrarily), and even that is not always enough (the MySQL variable MAX_JOIN_SIZE is optional and has a limit of 2^32 = 4 billion, so any value from 1 to 4 billion should be available).</p><p>When using the command-line client, MAX_JOIN_SIZE is ignored by default, since SQL_BIG_SELECTS=1. But MySQLCC enforces a MAX_JOIN_SIZE, even when you don&#8217;t want one. The solution: Apply the patch I posted earlier. Then set the &#8220;Maximum join size&#8221; to 0; it will set SQL_BIG_SELECTS=1 and therefore not return an error on big queries.</p><p>That said, in most cases you shouldn&#8217;t go above a join size of a million if only 1 record is returned (except for GROUP BY queries, I suppose). If you&#8217;re getting this error, chances are your query could be optimized considerably.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: iderror.com @ 2012-02-10 02:26:03 -->
