News for hackers. Stuff that matters.
Re:Digg: 40x Performance Increase by Sorting in PHP Rather t... by karipatila on Wednesday March 24, 2010 @04:50AM (#1215278)
You'd have to have something like SELECT id FROM table WHERE id in () ORDER BY FIND_IN_SET(id,""); to get them in a predefined order.
Re:Digg: 40x Performance Increase by Sorting in PHP Rather t... by learnalist on Wednesday March 24, 2010 @05:03AM (#1215294)
I have never used FIND_IN_SET.

But I use FIELD() http://dev.mysql.com/doc/refman/5.0/en/string-functions.html...

SELECT FROM x WHERE id IN(9,4,22,38,4,..) ORDER BY FIELD(`id`, 9,4,22,38,4,..)

That said, I dont know if sql or php is quicker.