<?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: MySQL 的 ORDER BY RAND() 的替代方案</title>
	<atom:link href="http://blog.gslin.org/archives/2008/07/02/1535/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gslin.org/archives/2008/07/02/1535/</link>
	<description>幹壞事是進步最大的原動力</description>
	<lastBuildDate>Mon, 15 Mar 2010 01:09:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 網站製作學習誌 &#187; [Web] 連結分享</title>
		<link>http://blog.gslin.org/archives/2008/07/02/1535/comment-page-1/#comment-305159</link>
		<dc:creator>網站製作學習誌 &#187; [Web] 連結分享</dc:creator>
		<pubDate>Wed, 25 Nov 2009 02:39:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gslin.org/?p=1535#comment-305159</guid>
		<description>[...] MySQL 的 ORDER BY RAND() 的替代方案 [...]</description>
		<content:encoded><![CDATA[<p>[...] MySQL 的 ORDER BY RAND() 的替代方案 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 幻想的世界</title>
		<link>http://blog.gslin.org/archives/2008/07/02/1535/comment-page-1/#comment-283091</link>
		<dc:creator>幻想的世界</dc:creator>
		<pubDate>Mon, 18 Aug 2008 04:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gslin.org/?p=1535#comment-283091</guid>
		<description>&lt;strong&gt;Order By Rand() 替代方案...&lt;/strong&gt;

先說，我手邊現行的資料庫的資料量都不大，所以無法測出當資料量到達 5萬 或是 10萬筆的時候效率好不好！
至少可以很肯定 ORDER BY RAND() 這樣的寫法在資料量大的時候，或是條件繁複的時候...</description>
		<content:encoded><![CDATA[<p><strong>Order By Rand() 替代方案&#8230;</strong></p>
<p>先說，我手邊現行的資料庫的資料量都不大，所以無法測出當資料量到達 5萬 或是 10萬筆的時候效率好不好！<br />
至少可以很肯定 ORDER BY RAND() 這樣的寫法在資料量大的時候，或是條件繁複的時候&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tka實驗室</title>
		<link>http://blog.gslin.org/archives/2008/07/02/1535/comment-page-1/#comment-280227</link>
		<dc:creator>tka實驗室</dc:creator>
		<pubDate>Wed, 02 Jul 2008 15:39:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gslin.org/?p=1535#comment-280227</guid>
		<description>&lt;strong&gt;MySQL Order by rand() 效能爆走大法...&lt;/strong&gt;

在gslin大神那邊看到一則調整Order by rand() 效能的方法。
話不多說，﻿直接講要做的事情 &amp; 實測結論
隨機﻿從mysql資料image從3XX萬筆中挑出一條
直覺的作法
select * from image$ order by rand();
花 24...</description>
		<content:encoded><![CDATA[<p><strong>MySQL Order by rand() 效能爆走大法&#8230;</strong></p>
<p>在gslin大神那邊看到一則調整Order by rand() 效能的方法。<br />
話不多說，﻿直接講要做的事情 &#38; 實測結論<br />
隨機﻿從mysql資料image從3XX萬筆中挑出一條<br />
直覺的作法<br />
select * from image$ order by rand();<br />
花 24&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.gslin.org/archives/2008/07/02/1535/comment-page-1/#comment-280194</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 02 Jul 2008 07:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gslin.org/?p=1535#comment-280194</guid>
		<description>Great, this is exactly what i want, i&#039;m looking for years to find an alternative for order by rand().
I also want to know if it is possible to return more than 1 random record in one SQL call. If I change the limit 1 to limit 10, only the first record in resultset are random, such as return id from 91 to 100. Or I need to run this SQL 10 times to get 10 random results.</description>
		<content:encoded><![CDATA[<p>Great, this is exactly what i want, i&#8217;m looking for years to find an alternative for order by rand().<br />
I also want to know if it is possible to return more than 1 random record in one SQL call. If I change the limit 1 to limit 10, only the first record in resultset are random, such as return id from 91 to 100. Or I need to run this SQL 10 times to get 10 random results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blog.XDite.net &#187; [Rails] The Better Way To Do Random</title>
		<link>http://blog.gslin.org/archives/2008/07/02/1535/comment-page-1/#comment-280176</link>
		<dc:creator>Blog.XDite.net &#187; [Rails] The Better Way To Do Random</dc:creator>
		<pubDate>Tue, 01 Jul 2008 21:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gslin.org/?p=1535#comment-280176</guid>
		<description>[...] temp table 作 JOIN 而不用 id &gt;= status 可以參照 這篇（大神寫的中文版解釋）。至於 r2 為何要取名叫 gid，而不是 id ，是因為 join 出來的結果會有 2 個 [...]</description>
		<content:encoded><![CDATA[<p>[...] temp table 作 JOIN 而不用 id &gt;= status 可以參照 這篇（大神寫的中文版解釋）。至於 r2 為何要取名叫 gid，而不是 id ，是因為 join 出來的結果會有 2 個 [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->