when attempting to customize the welcome page
with Random Media I get an error.
Postgresql v8.1 does not have a RAND() function
instead it has a
Also Jay Pipes (Jay@mysql.com) The north american
rep for mysql
gave a performance session and explains that this
is very bad sql. He gave an example
for mysql instead of
select * from Ads order by rand();
select @row_id := count(*) from ads;
select @row_id := floor(rand() * @row_id) +1;
select * from ads where adid=@row_id;
If I remember correctly, he said the first bad example
has to search the db once for each row.
it doesn't appear that this will work in postgresql
He suggests using the php rand function instead.
probably something like
select count(*) from ....
get the answer, then use the
php rand function.
see his presentation @
Log in to post a comment.