Subject Re: [firebird-php] ORDER By RAND() executes very slow
Author Kamil Walas
Hello,

You could try do random shuffle in PHP:

$qr = ibase_query( $sql );
$table = array();
while( $row = ibase_fetch_assoc($qr) )
{
$table[] = $row;
}
$table = shuffle( $table );
// Do something with random table

Regards,
Kamil Walas


W dniu 2010-05-04 06:24, bdwankhede pisze:
>
> Hello all,
>
> I have a simple firebird sql query as
>
> SELECT FIRST 1000 a."id", a."what_they_do", a."does", a."improves"
> FROM "inspections" a ORDER BY RAND() ASC;
>
> where "inspections" table having large no of records and containing
> text fields but by using ORDER BY RAND() it executes very slow
>
> please help ... how can i improve this query to get random records?
>
>



[Non-text portions of this message have been removed]