<?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: COUNT(*) vs COUNT(col)</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/</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: saaj</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-879128</link>
		<dc:creator>saaj</dc:creator>
		<pubDate>Sun, 22 Jan 2012 12:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-879128</guid>
		<description>MySQL 5.5 seems to be optimized in concern of COUNT(*) queries. At the same machine, for the table of ~120K records I&#039;ve ~2.4 seconds for 5.1 and 0.08 seconds for 5.5 for &quot;SELECT COUNT(*) FROM table&quot; query.</description>
		<content:encoded><![CDATA[<p>MySQL 5.5 seems to be optimized in concern of COUNT(*) queries. At the same machine, for the table of ~120K records I&#8217;ve ~2.4 seconds for 5.1 and 0.08 seconds for 5.5 for &#8220;SELECT COUNT(*) FROM table&#8221; query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muhammed sekertekin</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-831638</link>
		<dc:creator>muhammed sekertekin</dc:creator>
		<pubDate>Sun, 16 Oct 2011 00:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-831638</guid>
		<description>very nice article i used to think that you wont notice a a difference if you use count by row i guess to have to recode a lot of my codes.... Thank you from muhammed sekertekin</description>
		<content:encoded><![CDATA[<p>very nice article i used to think that you wont notice a a difference if you use count by row i guess to have to recode a lot of my codes&#8230;. Thank you from muhammed sekertekin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OnLine</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-809762</link>
		<dc:creator>OnLine</dc:creator>
		<pubDate>Sat, 06 Aug 2011 07:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-809762</guid>
		<description>Hy,
I have 2 tables.
Can I make a single Select query to return the total number of rows in the first table and the rows (their data) of the seccond table?
And if this is posible, how does this query look like?</description>
		<content:encoded><![CDATA[<p>Hy,<br />
I have 2 tables.<br />
Can I make a single Select query to return the total number of rows in the first table and the rows (their data) of the seccond table?<br />
And if this is posible, how does this query look like?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Zaitsev</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-802306</link>
		<dc:creator>Peter Zaitsev</dc:creator>
		<pubDate>Tue, 22 Mar 2011 22:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-802306</guid>
		<description>Hi,

You&#039;re looking at full index scan or full table scan in this case. Innodb has some protection from full table scan polluting cache, though it is done differently than using same page</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You&#8217;re looking at full index scan or full table scan in this case. Innodb has some protection from full table scan polluting cache, though it is done differently than using same page</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Foobarista</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-802298</link>
		<dc:creator>Foobarista</dc:creator>
		<pubDate>Tue, 22 Mar 2011 21:21:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-802298</guid>
		<description>In InnoDB, does a simple count(*) do anything evil with the database cache?  I ask because some database engine&#039;s I&#039;ve seen don&#039;t do caching carefully and tablescans (or count(*) that does a tablescan) can end up pulling the whole table into the cache (and pushing more useful pages out).  Smarter db engines will just reuse the same buffer page to do table scans (after making sure it isn&#039;t in-cache already), but many don&#039;t.</description>
		<content:encoded><![CDATA[<p>In InnoDB, does a simple count(*) do anything evil with the database cache?  I ask because some database engine&#8217;s I&#8217;ve seen don&#8217;t do caching carefully and tablescans (or count(*) that does a tablescan) can end up pulling the whole table into the cache (and pushing more useful pages out).  Smarter db engines will just reuse the same buffer page to do table scans (after making sure it isn&#8217;t in-cache already), but many don&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rishabh Jain</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-790288</link>
		<dc:creator>Rishabh Jain</dc:creator>
		<pubDate>Wed, 29 Dec 2010 07:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-790288</guid>
		<description>can I use count(*)&gt;3</description>
		<content:encoded><![CDATA[<p>can I use count(*)&gt;3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: count(*) and count(column_name) in MySQL, whatâ€™s the diff? &#187; Eric Lo</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-765477</link>
		<dc:creator>count(*) and count(column_name) in MySQL, whatâ€™s the diff? &#187; Eric Lo</dc:creator>
		<pubDate>Fri, 21 May 2010 03:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-765477</guid>
		<description>[...] Performance Blog Post:COUNT(*) vs COUNT(col) Reference: [...]</description>
		<content:encoded><![CDATA[<p>[...] Performance Blog Post:COUNT(*) vs COUNT(col) Reference: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilan Hazan</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-764576</link>
		<dc:creator>Ilan Hazan</dc:creator>
		<pubDate>Sun, 16 May 2010 12:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-764576</guid>
		<description>If you need to count num results but up to a specific limit (to improve performance), you can use the Limited-Count solution.
You can read more about it here: http://www.mysqldiary.com/limited-select-count/</description>
		<content:encoded><![CDATA[<p>If you need to count num results but up to a specific limit (to improve performance), you can use the Limited-Count solution.<br />
You can read more about it here: <a href="http://www.mysqldiary.com/limited-select-count/" rel="nofollow">http://www.mysqldiary.com/limited-select-count/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ricky</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-723123</link>
		<dc:creator>ricky</dc:creator>
		<pubDate>Thu, 11 Feb 2010 13:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-723123</guid>
		<description>How about select count(1) vs select count(id)

Which one is better?</description>
		<content:encoded><![CDATA[<p>How about select count(1) vs select count(id)</p>
<p>Which one is better?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ibrahim oguz</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/comment-page-1/#comment-716730</link>
		<dc:creator>ibrahim oguz</dc:creator>
		<pubDate>Sun, 31 Jan 2010 09:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/#comment-716730</guid>
		<description>you say count(*) fast because it founds if there are indexes. for auto increment primary keys also is index. then if we use primary keys select count(id) from users; then it has to be fast too.
how about group by statement. nobody asked about it. select count(*) from users where country=&#039;USA&#039; group by CITY;
how can we use it in innodb and myisam.
thanks.</description>
		<content:encoded><![CDATA[<p>you say count(*) fast because it founds if there are indexes. for auto increment primary keys also is index. then if we use primary keys select count(id) from users; then it has to be fast too.<br />
how about group by statement. nobody asked about it. select count(*) from users where country=&#8217;USA&#8217; group by CITY;<br />
how can we use it in innodb and myisam.<br />
thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

