<?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"
	>
<channel>
	<title>Comments on: How fast can you sort data with MySQL ?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/</link>
	<description>Everything about MySQL Performance</description>
	<pubDate>Tue, 14 Oct 2008 07:04:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Project 2061 Techlog &#187; Optimizing MySQL Server Runtime Parameters</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-296421</link>
		<dc:creator>Project 2061 Techlog &#187; Optimizing MySQL Server Runtime Parameters</dc:creator>
		<pubDate>Wed, 07 May 2008 18:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-296421</guid>
		<description>[...] MySQL Performance Blog: How fast can you sort data with MySQL? [...]</description>
		<content:encoded><![CDATA[<p>[...] MySQL Performance Blog: How fast can you sort data with MySQL? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-171970</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Tue, 25 Sep 2007 05:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-171970</guid>
		<description>Further to my last question..

As described in this blog post, a table scan with order by/limit does a very fast sort if you want to get the top-most rows .. but I find it useless if you want to use it to create a full ordered insert (for example) for innodb.
My large table spends hours 'sorting result', even though I can get top 20 results within 15 minutes. I wonder if there are some short-cuts taken by mysql where limit is used. Perhaps a table-scan, with a running best-of list, for example. That would not then be a sort, would it?

In order to do an ordered bulk insert to innodb by PK I am resorting to external sort of a file with unix sort then feeding it with batch inserts, rather than feeding it to myisam then converting, or feeding to myisam then sort .. order by .. insert, or feeding un-ordered PK to innodb directly then doing alter table engine=innodb to "defragment" PK.

Am I on the right track?</description>
		<content:encoded><![CDATA[<p>Further to my last question..</p>
<p>As described in this blog post, a table scan with order by/limit does a very fast sort if you want to get the top-most rows .. but I find it useless if you want to use it to create a full ordered insert (for example) for innodb.<br />
My large table spends hours &#8217;sorting result&#8217;, even though I can get top 20 results within 15 minutes. I wonder if there are some short-cuts taken by mysql where limit is used. Perhaps a table-scan, with a running best-of list, for example. That would not then be a sort, would it?</p>
<p>In order to do an ordered bulk insert to innodb by PK I am resorting to external sort of a file with unix sort then feeding it with batch inserts, rather than feeding it to myisam then converting, or feeding to myisam then sort .. order by .. insert, or feeding un-ordered PK to innodb directly then doing alter table engine=innodb to &#8220;defragment&#8221; PK.</p>
<p>Am I on the right track?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-171897</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Tue, 25 Sep 2007 02:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-171897</guid>
		<description>On this subject.. if you have a huge un-ordered myisam table and wish to get it into sort order before dumping it to INNODB, which is going to be faster?

a) Add an index on column to be sorted and select by that index
b) Dump the data to flat file and sort using unix sort then re-import
c) Select using table-scan and sort as per your example
d) alter to innodb with primary key (which is the objective anyway)

I'm currently doing (a) but I'm wondering if this is a big waste of time.</description>
		<content:encoded><![CDATA[<p>On this subject.. if you have a huge un-ordered myisam table and wish to get it into sort order before dumping it to INNODB, which is going to be faster?</p>
<p>a) Add an index on column to be sorted and select by that index<br />
b) Dump the data to flat file and sort using unix sort then re-import<br />
c) Select using table-scan and sort as per your example<br />
d) alter to innodb with primary key (which is the objective anyway)</p>
<p>I&#8217;m currently doing (a) but I&#8217;m wondering if this is a big waste of time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169796</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 19 Sep 2007 10:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169796</guid>
		<description>Lachlan,

Indeed it can affect things.  And there are more variables like table structure of course - I have not tested these yet.</description>
		<content:encoded><![CDATA[<p>Lachlan,</p>
<p>Indeed it can affect things.  And there are more variables like table structure of course - I have not tested these yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lachlan Mulcahy</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169703</link>
		<dc:creator>Lachlan Mulcahy</dc:creator>
		<pubDate>Wed, 19 Sep 2007 05:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169703</guid>
		<description>Hi Peter,

I wonder how the size of this buffer would affect real loaded systems?

Obviously on many real systems disk IO comes into the equation and then disk seek time can start playing a big factor. 

I would be interested to see if the results change in this kind of situation.

Kind Regards,
Lachlan</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>I wonder how the size of this buffer would affect real loaded systems?</p>
<p>Obviously on many real systems disk IO comes into the equation and then disk seek time can start playing a big factor. </p>
<p>I would be interested to see if the results change in this kind of situation.</p>
<p>Kind Regards,<br />
Lachlan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MySQL Performance Blog &#187; MySQL: what read_buffer_size value is optimal ?</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169054</link>
		<dc:creator>MySQL Performance Blog &#187; MySQL: what read_buffer_size value is optimal ?</dc:creator>
		<pubDate>Mon, 17 Sep 2007 14:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-169054</guid>
		<description>[...] benchmarks and performance research. I just recently wrote about rather surprising results with sort performance and today I've discovered even read_buffer_size selection may be less than [...]</description>
		<content:encoded><![CDATA[<p>[...] benchmarks and performance research. I just recently wrote about rather surprising results with sort performance and today I&#8217;ve discovered even read_buffer_size selection may be less than [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Day</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-165000</link>
		<dc:creator>James Day</dc:creator>
		<pubDate>Sat, 08 Sep 2007 00:27:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-165000</guid>
		<description>Scott, an index that can satisfy both the WHERE and ORDER BY clauses can be expected to eliminate the need to sort.

Whitesites, larger buffers often still do help performance on mixed query loads but what this does show is that if you can have the default low and increase it only in the sessions that benefit from larger sizes you can get the best of both worlds. As you optimise queries and indexes you can also find that the optimal value for a particular workload changes.</description>
		<content:encoded><![CDATA[<p>Scott, an index that can satisfy both the WHERE and ORDER BY clauses can be expected to eliminate the need to sort.</p>
<p>Whitesites, larger buffers often still do help performance on mixed query loads but what this does show is that if you can have the default low and increase it only in the sessions that benefit from larger sizes you can get the best of both worlds. As you optimise queries and indexes you can also find that the optimal value for a particular workload changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: whitesites</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-163909</link>
		<dc:creator>whitesites</dc:creator>
		<pubDate>Wed, 05 Sep 2007 19:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-163909</guid>
		<description>Awesome article.  Its interesting to find that giving mysql more memory does not help performance.  This is totally opposite to what many believe.  I am sure this is a result of the amount of System Cache available to mysql.  Makes alot of sense considering intel has been moving away from high CPU speeds to beefed up 4, 6 and 8 MB cache with multiple cores.  I would be curious to see what the speed improvement is when using one of these beefed up chips.</description>
		<content:encoded><![CDATA[<p>Awesome article.  Its interesting to find that giving mysql more memory does not help performance.  This is totally opposite to what many believe.  I am sure this is a result of the amount of System Cache available to mysql.  Makes alot of sense considering intel has been moving away from high CPU speeds to beefed up 4, 6 and 8 MB cache with multiple cores.  I would be curious to see what the speed improvement is when using one of these beefed up chips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Pipes</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-162853</link>
		<dc:creator>Jay Pipes</dc:creator>
		<pubDate>Mon, 03 Sep 2007 17:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-162853</guid>
		<description>Apachez,

We had a very good meeting in New York and you'll be hearing more about this in the coming weeks on my blog and Giuseppe's.  Stay tuned. :)

-jay</description>
		<content:encoded><![CDATA[<p>Apachez,</p>
<p>We had a very good meeting in New York and you&#8217;ll be hearing more about this in the coming weeks on my blog and Giuseppe&#8217;s.  Stay tuned. <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>-jay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-162197</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sun, 02 Sep 2007 17:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/08/18/how-fast-can-you-sort-data-with-mysql/#comment-162197</guid>
		<description>Yes... We should create commented my.cnf examples sometime.</description>
		<content:encoded><![CDATA[<p>Yes&#8230; We should create commented my.cnf examples sometime.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
