<?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: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45: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: Roy N</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-2/#comment-886246</link>
		<dc:creator>Roy N</dc:creator>
		<pubDate>Tue, 07 Feb 2012 13:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-886246</guid>
		<description>PS: the query was fairly complex with a couple of joins (all indexed) despite not being extremely large.  the datasets returned were about 100 - 500 matches on average, and the main table &lt;100k rows.  innodb.</description>
		<content:encoded><![CDATA[<p>PS: the query was fairly complex with a couple of joins (all indexed) despite not being extremely large.  the datasets returned were about 100 &#8211; 500 matches on average, and the main table &lt;100k rows.  innodb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy N</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-886244</link>
		<dc:creator>Roy N</dc:creator>
		<pubDate>Tue, 07 Feb 2012 13:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-886244</guid>
		<description>I just deployed sql_calc_rows on a high traffic large server (16gb ram ssd, yada yada, high availability setup with multiple slaves, etc) and it completely brought the server to its knees... select tables were running for hundreds of seconds &quot;copying data into tmp table&quot; or something like that...

in our pre-production tests, time for access was much better, but under load it could not perform unfortunately...

back to using double queries...</description>
		<content:encoded><![CDATA[<p>I just deployed sql_calc_rows on a high traffic large server (16gb ram ssd, yada yada, high availability setup with multiple slaves, etc) and it completely brought the server to its knees&#8230; select tables were running for hundreds of seconds &#8220;copying data into tmp table&#8221; or something like that&#8230;</p>
<p>in our pre-production tests, time for access was much better, but under load it could not perform unfortunately&#8230;</p>
<p>back to using double queries&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Noyes</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-829505</link>
		<dc:creator>Scott Noyes</dc:creator>
		<pubDate>Fri, 07 Oct 2011 17:00:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-829505</guid>
		<description>I just repeated the test shown here (except that I got bored and killed the initial set of INSERTs at 8M instead of 10M). After warming up the cache, I get 0.06 seconds for the SQL_CALC_FOUND_ROWS approach, and 0.02 seconds for the COUNT(*) approach. The EXPLAIN plans are identical.</description>
		<content:encoded><![CDATA[<p>I just repeated the test shown here (except that I got bored and killed the initial set of INSERTs at 8M instead of 10M). After warming up the cache, I get 0.06 seconds for the SQL_CALC_FOUND_ROWS approach, and 0.02 seconds for the COUNT(*) approach. The EXPLAIN plans are identical.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-801220</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 08 Mar 2011 08:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-801220</guid>
		<description>Hello, 

I tried the SQL_CALC_FOUND_ROWS/FOUND_ROWS query method vs the select/count() query method, both using WHERE ... LIKE &#039;%...%&#039; , ORDER BY, and LIMIT X,Y on a real table with ~72,000 entries (MYISAM).

Result: The SQL_CALC_FOUND_ROWS/FOUND_ROWS method is 90% faster than the select/count() method in this case!</description>
		<content:encoded><![CDATA[<p>Hello, </p>
<p>I tried the SQL_CALC_FOUND_ROWS/FOUND_ROWS query method vs the select/count() query method, both using WHERE &#8230; LIKE &#8216;%&#8230;%&#8217; , ORDER BY, and LIMIT X,Y on a real table with ~72,000 entries (MYISAM).</p>
<p>Result: The SQL_CALC_FOUND_ROWS/FOUND_ROWS method is 90% faster than the select/count() method in this case!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vili</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-770179</link>
		<dc:creator>Vili</dc:creator>
		<pubDate>Wed, 28 Jul 2010 09:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-770179</guid>
		<description>On a table with about 5 million rows (average row length is 71, engine: MyISAM) these are my measurements:

17.000s - SELECT SQL_CALC_FOUND_ROWS * FROM tab WHERE id&gt;600000 LIMIT 10000
00.100s - SELECT * FROM tab WHERE id&gt;600000 LIMIT 10000

02.250s - SELECT SQL_CALC_FOUND_ROWS * FROM tab WHERE id&lt;600000 LIMIT 10000
00.100s - SELECT * FROM tab WHERE id&lt;600000 LIMIT 10000

00.062s - SELECT SQL_CALC_FOUND_ROWS * FROM tab LIMIT 10000
00.062s - SELECT * FROM tab LIMIT 10000

The primary `id` field is INT(10) UNSIGNED NOT NULL AUTO_INCREMENT.

If there is a WHERE the SCFR is slowing down the query. 
But the time difference between id... is also remarkable.</description>
		<content:encoded><![CDATA[<p>On a table with about 5 million rows (average row length is 71, engine: MyISAM) these are my measurements:</p>
<p>17.000s &#8211; SELECT SQL_CALC_FOUND_ROWS * FROM tab WHERE id&gt;600000 LIMIT 10000<br />
00.100s &#8211; SELECT * FROM tab WHERE id&gt;600000 LIMIT 10000</p>
<p>02.250s &#8211; SELECT SQL_CALC_FOUND_ROWS * FROM tab WHERE id&lt;600000 LIMIT 10000<br />
00.100s &#8211; SELECT * FROM tab WHERE id&lt;600000 LIMIT 10000</p>
<p>00.062s &#8211; SELECT SQL_CALC_FOUND_ROWS * FROM tab LIMIT 10000<br />
00.062s &#8211; SELECT * FROM tab LIMIT 10000</p>
<p>The primary `id` field is INT(10) UNSIGNED NOT NULL AUTO_INCREMENT.</p>
<p>If there is a WHERE the SCFR is slowing down the query.<br />
But the time difference between id&#8230; is also remarkable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zeojex</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-768022</link>
		<dc:creator>zeojex</dc:creator>
		<pubDate>Mon, 28 Jun 2010 14:01:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-768022</guid>
		<description>For a current project that i need to optimize, i use SQL_CALC_FOUND_ROWS. 
I did some tests too and this solution was faster than using 2 queries even if i use appropriate indexes.
But my query are complex : 10 table-relations, almost 10 conditions in where clause, with group by and limit...so a very bad query !
You probably right on your test because you use simple query...??
I will do other tests to be sure.

Thx from france !</description>
		<content:encoded><![CDATA[<p>For a current project that i need to optimize, i use SQL_CALC_FOUND_ROWS.<br />
I did some tests too and this solution was faster than using 2 queries even if i use appropriate indexes.<br />
But my query are complex : 10 table-relations, almost 10 conditions in where clause, with group by and limit&#8230;so a very bad query !<br />
You probably right on your test because you use simple query&#8230;??<br />
I will do other tests to be sure.</p>
<p>Thx from france !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Lieverdink</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-765597</link>
		<dc:creator>Peter Lieverdink</dc:creator>
		<pubDate>Wed, 26 May 2010 09:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-765597</guid>
		<description>I&#039;ve noticed for some time that I actually get opposite results to what the blog suggests. Running two queries is pretty much never faster than SQL_CALC_FOUND_ROWS when I use it.

I&#039;ve run a bunch of benchmarks, and on larger datasets it&#039;s pretty much twice as fast as COUNT(*) and then a SELECT.

http://cafuego.net/2010/05/26/fast-paging-real-world</description>
		<content:encoded><![CDATA[<p>I&#8217;ve noticed for some time that I actually get opposite results to what the blog suggests. Running two queries is pretty much never faster than SQL_CALC_FOUND_ROWS when I use it.</p>
<p>I&#8217;ve run a bunch of benchmarks, and on larger datasets it&#8217;s pretty much twice as fast as COUNT(*) and then a SELECT.</p>
<p><a href="http://cafuego.net/2010/05/26/fast-paging-real-world" rel="nofollow">http://cafuego.net/2010/05/26/fast-paging-real-world</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-742541</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 02 Apr 2010 14:29:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-742541</guid>
		<description>Hi.

FYI, in my benchmarks it&#039;s about 50% faster to SELECT &quot;null&quot; instead of &quot;*&quot; if you just want to do a FOUND_ROWS():

SELECT /*! SQL_CALC_FOUND_ROWS */ NULL FROM aaa LIMIT 0 UNION ALL SELECT NULL FROM bbb LIMIT 0
instead of
SELECT /*! SQL_CALC_FOUND_ROWS */ * FROM aaa LIMIT 0 UNION ALL SELECT * FROM bbb LIMIT 0;

and then
SELECT FOUND_ROWS();</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>FYI, in my benchmarks it&#8217;s about 50% faster to SELECT &#8220;null&#8221; instead of &#8220;*&#8221; if you just want to do a FOUND_ROWS():</p>
<p>SELECT /*! SQL_CALC_FOUND_ROWS */ NULL FROM aaa LIMIT 0 UNION ALL SELECT NULL FROM bbb LIMIT 0<br />
instead of<br />
SELECT /*! SQL_CALC_FOUND_ROWS */ * FROM aaa LIMIT 0 UNION ALL SELECT * FROM bbb LIMIT 0;</p>
<p>and then<br />
SELECT FOUND_ROWS();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Heng</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-733409</link>
		<dc:creator>Jim Heng</dc:creator>
		<pubDate>Mon, 08 Mar 2010 09:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-733409</guid>
		<description>Agree with Nadeem

If you are using SELECT SQL_CALC_FOUND_ROWS, MySQL must calculate how many rows are in the full result set. However, this is faster than running the query again without LIMIT, because the result set need not be sent to the client.</description>
		<content:encoded><![CDATA[<p>Agree with Nadeem</p>
<p>If you are using SELECT SQL_CALC_FOUND_ROWS, MySQL must calculate how many rows are in the full result set. However, this is faster than running the query again without LIMIT, because the result set need not be sent to the client.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadeem</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/comment-page-1/#comment-728797</link>
		<dc:creator>Nadeem</dc:creator>
		<pubDate>Tue, 23 Feb 2010 20:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/#comment-728797</guid>
		<description>I&#039;m agree with &quot;Matt&quot; comment, yes actually SQL_COUNT_FOUND_ROWS use when someone required result + paging with single query in associative array so this always make a good sense to use SQL_COUNT_FOUND_ROWS otherwise COUNT(field with Key) use to take the result of  your desire.

Hope this contribute!</description>
		<content:encoded><![CDATA[<p>I&#8217;m agree with &#8220;Matt&#8221; comment, yes actually SQL_COUNT_FOUND_ROWS use when someone required result + paging with single query in associative array so this always make a good sense to use SQL_COUNT_FOUND_ROWS otherwise COUNT(field with Key) use to take the result of  your desire.</p>
<p>Hope this contribute!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

