<?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/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/feed/" rel="self" type="application/rss+xml" /><link>http://blog.gslin.org/archives/2008/07/02/1535/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/</link> <description>幹壞事是進步最大的原動力</description> <lastBuildDate>Sun, 12 Feb 2012 04:26:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: ORDER BY RAND 的 scope 寫法 &#124; Blog.XDite.net</title><link>http://blog.gslin.org/archives/2008/07/02/1535/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/comment-page-1/#comment-309087</link> <dc:creator>ORDER BY RAND 的 scope 寫法 &#124; Blog.XDite.net</dc:creator> <pubDate>Mon, 04 Jul 2011 15:31:34 +0000</pubDate> <guid
isPermaLink="false">http://blog.gslin.org/?p=1535#comment-309087</guid> <description>[...] 三年前 DK 曾經教我一招 ORDER BY RAND 的替代方案改善 RAND 的效率。 [...]</description> <content:encoded><![CDATA[<p>[...] 三年前 DK 曾經教我一招 ORDER BY RAND 的替代方案改善 RAND 的效率。 [...]</p> ]]></content:encoded> </item> <item><title>By: 網站製作學習誌 &#187; [Web] 連結分享</title><link>http://blog.gslin.org/archives/2008/07/02/1535/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/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/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/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/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/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/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/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/mysql-%e7%9a%84-order-by-rand-%e7%9a%84%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88/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>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: blog.gslin.org @ 2012-02-12 20:03:48 -->
