<?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: What does Using filesort mean in MySQL?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/</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: Mikhail</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-832233</link>
		<dc:creator>Mikhail</dc:creator>
		<pubDate>Tue, 18 Oct 2011 14:01:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-832233</guid>
		<description>Here&#039;s a trivial but interesting example:

EXPLAIN SELECT 20 AS C UNION SELECT 10 AS C ORDER BY C

id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
2	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
NULL	UNION RESULT		ALL	NULL	NULL	NULL	NULL	NULL	Using filesort

Obviously there&#039;s no merge-sorting here, and no hard drive files are in use.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a trivial but interesting example:</p>
<p>EXPLAIN SELECT 20 AS C UNION SELECT 10 AS C ORDER BY C</p>
<p>id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra<br />
1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used<br />
2	UNION	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used<br />
NULL	UNION RESULT		ALL	NULL	NULL	NULL	NULL	NULL	Using filesort</p>
<p>Obviously there&#8217;s no merge-sorting here, and no hard drive files are in use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-781417</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Thu, 04 Nov 2010 17:05:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-781417</guid>
		<description>The MySQL manual has a full description of what happens during a filesort in http://dev.mysql.com/doc/refman/5.1/en/order-by-optimization.html.</description>
		<content:encoded><![CDATA[<p>The MySQL manual has a full description of what happens during a filesort in <a href="http://dev.mysql.com/doc/refman/5.1/en/order-by-optimization.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/order-by-optimization.html</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Baker</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-772565</link>
		<dc:creator>Michael Baker</dc:creator>
		<pubDate>Fri, 27 Aug 2010 04:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-772565</guid>
		<description>This was very interesting to find, and it lead me to Percona for a consult.  I knew what the filesort meant, but am having a hard time composing the index to reduce the number of rows searched.

I would very much like the chance to interview to become a freelance consultant for Percona.  Although my regular business keeps me very busy, I&#039;m always willing to help other people when I can, and I have a son in college - so I could use the extra income!</description>
		<content:encoded><![CDATA[<p>This was very interesting to find, and it lead me to Percona for a consult.  I knew what the filesort meant, but am having a hard time composing the index to reduce the number of rows searched.</p>
<p>I would very much like the chance to interview to become a freelance consultant for Percona.  Although my regular business keeps me very busy, I&#8217;m always willing to help other people when I can, and I have a son in college &#8211; so I could use the extra income!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claudio Nanni</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-699004</link>
		<dc:creator>Claudio Nanni</dc:creator>
		<pubDate>Sun, 20 Dec 2009 21:33:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-699004</guid>
		<description>@Salle: Your Post #8

I see you insert two records in the table &#039;fs&#039; then EXPLAIN table &#039;t1&#039; which has three records.
In my opinion your example is not very clear. Moreover I get the behaviour as explained by Baron.
Am I missing something?

&gt;&gt;&gt;
(root@localhost) [test] CREATE TABLE t1 (id int unsigned NOT NULL);
Query OK, 0 rows affected (0.13 sec)

(root@localhost) [test] INSERT INTO t1 (id) VALUES (1),(2);
Query OK, 2 rows affected (0.14 sec)
Records: 2  Duplicates: 0  Warnings: 0

(root@localhost) [test] EXPLAIN SELECT * FROM t1 ORDER BY id\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: t1
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 2
        Extra: Using filesort
1 row in set (0.00 sec)

(root@localhost) [test] ALTER TABLE t1 ADD INDEX (id);
Query OK, 2 rows affected (0.33 sec)
Records: 2  Duplicates: 0  Warnings: 0

(root@localhost) [test] EXPLAIN SELECT * FROM t1 ORDER BY id\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: t1
         type: index
possible_keys: NULL
          key: id
      key_len: 4
          ref: NULL
         rows: 2
        Extra: Using index
1 row in set (0.00 sec)

(root@localhost) [test]
&lt;&lt;&lt;</description>
		<content:encoded><![CDATA[<p>@Salle: Your Post #8</p>
<p>I see you insert two records in the table &#8216;fs&#8217; then EXPLAIN table &#8216;t1&#8242; which has three records.<br />
In my opinion your example is not very clear. Moreover I get the behaviour as explained by Baron.<br />
Am I missing something?</p>
<p>&gt;&gt;&gt;<br />
(root@localhost) [test] CREATE TABLE t1 (id int unsigned NOT NULL);<br />
Query OK, 0 rows affected (0.13 sec)</p>
<p>(root@localhost) [test] INSERT INTO t1 (id) VALUES (1),(2);<br />
Query OK, 2 rows affected (0.14 sec)<br />
Records: 2  Duplicates: 0  Warnings: 0</p>
<p>(root@localhost) [test] EXPLAIN SELECT * FROM t1 ORDER BY id\G<br />
*************************** 1. row ***************************<br />
           id: 1<br />
  select_type: SIMPLE<br />
        table: t1<br />
         type: ALL<br />
possible_keys: NULL<br />
          key: NULL<br />
      key_len: NULL<br />
          ref: NULL<br />
         rows: 2<br />
        Extra: Using filesort<br />
1 row in set (0.00 sec)</p>
<p>(root@localhost) [test] ALTER TABLE t1 ADD INDEX (id);<br />
Query OK, 2 rows affected (0.33 sec)<br />
Records: 2  Duplicates: 0  Warnings: 0</p>
<p>(root@localhost) [test] EXPLAIN SELECT * FROM t1 ORDER BY id\G<br />
*************************** 1. row ***************************<br />
           id: 1<br />
  select_type: SIMPLE<br />
        table: t1<br />
         type: index<br />
possible_keys: NULL<br />
          key: id<br />
      key_len: 4<br />
          ref: NULL<br />
         rows: 2<br />
        Extra: Using index<br />
1 row in set (0.00 sec)</p>
<p>(root@localhost) [test]<br />
&lt;&lt;&lt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-635076</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Fri, 21 Aug 2009 13:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-635076</guid>
		<description>@Salle

Reading through this thread what scares me is it appears you also have some misconceptions about MySQL and yet you &quot;show people to the door&quot; who in this case seem to have a good grasp of the answer.  Hope I don&#039;t have to cross paths I wouldn&#039;t want to waste my time.</description>
		<content:encoded><![CDATA[<p>@Salle</p>
<p>Reading through this thread what scares me is it appears you also have some misconceptions about MySQL and yet you &#8220;show people to the door&#8221; who in this case seem to have a good grasp of the answer.  Hope I don&#8217;t have to cross paths I wouldn&#8217;t want to waste my time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joey</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-529981</link>
		<dc:creator>Joey</dc:creator>
		<pubDate>Sat, 04 Apr 2009 21:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-529981</guid>
		<description>Thanks for this helpful article and the even more helpful discussion!</description>
		<content:encoded><![CDATA[<p>Thanks for this helpful article and the even more helpful discussion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomas</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-510027</link>
		<dc:creator>thomas</dc:creator>
		<pubDate>Tue, 17 Mar 2009 19:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-510027</guid>
		<description>Gee, I wonder what it is like to be in an interview and get this question from Baron?

I think I always had the general idea, but reading these posts gave an extra layer.

T</description>
		<content:encoded><![CDATA[<p>Gee, I wonder what it is like to be in an interview and get this question from Baron?</p>
<p>I think I always had the general idea, but reading these posts gave an extra layer.</p>
<p>T</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Salle</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-506057</link>
		<dc:creator>Salle</dc:creator>
		<pubDate>Sat, 14 Mar 2009 13:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-506057</guid>
		<description>Dmitry,

You will be amazed how many MySQL &quot;experts&quot; don&#039;t read the manual. They either &quot;know&quot; or assume.

At the other had digging out such information is difficult. MySQL manual is not easy to navigate and it changes all the time. What&#039;s in there now could be added just couple of hours ago.

So don&#039;t blame people who didn&#039;t know how to find such information.

As for such questions being bad for interviews it depends on what do you want to understand about the candidate and even more what job you are interviewing for.

If it&#039;s about on-site consulting you definitely prefer one being able to answer everything on top of his head.</description>
		<content:encoded><![CDATA[<p>Dmitry,</p>
<p>You will be amazed how many MySQL &#8220;experts&#8221; don&#8217;t read the manual. They either &#8220;know&#8221; or assume.</p>
<p>At the other had digging out such information is difficult. MySQL manual is not easy to navigate and it changes all the time. What&#8217;s in there now could be added just couple of hours ago.</p>
<p>So don&#8217;t blame people who didn&#8217;t know how to find such information.</p>
<p>As for such questions being bad for interviews it depends on what do you want to understand about the candidate and even more what job you are interviewing for.</p>
<p>If it&#8217;s about on-site consulting you definitely prefer one being able to answer everything on top of his head.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry Dulepov</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-500624</link>
		<dc:creator>Dmitry Dulepov</dc:creator>
		<pubDate>Mon, 09 Mar 2009 21:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-500624</guid>
		<description>If people do not answer this question incorrectly, it simply means they do not read. The answer is clean and clear at the MySQL web site:

=========================
Using filesort

MySQL must do an extra pass to find out how to retrieve the rows in sorted order. The sort is done by going through all rows according to the join type and storing the sort key and pointer to the row for all rows that match the WHERE clause. The keys then are sorted and the rows are retrieved in sorted order.
=========================

http://dev.mysql.com/doc/refman/5.0/en/using-explain.html

In fact, such quaestions are VERY bad on the interview. It is ok to test skills during the interview but it is bad to ask for very low details. Much better to test if the person can ~find~ the answer to the question. Someone who knows is not necessarily the best. Someone who does not know but can find the answer is typically better.</description>
		<content:encoded><![CDATA[<p>If people do not answer this question incorrectly, it simply means they do not read. The answer is clean and clear at the MySQL web site:</p>
<p>=========================<br />
Using filesort</p>
<p>MySQL must do an extra pass to find out how to retrieve the rows in sorted order. The sort is done by going through all rows according to the join type and storing the sort key and pointer to the row for all rows that match the WHERE clause. The keys then are sorted and the rows are retrieved in sorted order.<br />
=========================</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/using-explain.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/using-explain.html</a></p>
<p>In fact, such quaestions are VERY bad on the interview. It is ok to test skills during the interview but it is bad to ask for very low details. Much better to test if the person can ~find~ the answer to the question. Someone who knows is not necessarily the best. Someone who does not know but can find the answer is typically better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maurice</title>
		<link>http://www.mysqlperformanceblog.com/2009/03/05/what-does-using-filesort-mean-in-mysql/comment-page-1/#comment-500582</link>
		<dc:creator>Maurice</dc:creator>
		<pubDate>Mon, 09 Mar 2009 17:29:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=635#comment-500582</guid>
		<description>Clears up some confusion indeed.

Thanks for posting! :)</description>
		<content:encoded><![CDATA[<p>Clears up some confusion indeed.</p>
<p>Thanks for posting! <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

