Re: rand()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The MYI file is the index file. Is there an index on that table?


From: jgoodie@xxxxxxx (Jennifer Goodie)
To: blackwater dev <blackwaterdev@xxxxxxxxx>
CC: php-db@xxxxxxxxxxxxx, Subject: Re:  rand()
Date: Wed, 29 Sep 2004 23:27:43 +0000

-------------- Original message from blackwater dev : --------------
> select * from clients order by RAND()
>
> THe query runs fine on my local server but when I run it on my hosts
> server, it works ok if there is only one record in the db but then
> there is more than one...I get this error:
>
> #1 - Can't create/write to file '/var/tmp/#sqlbe_1d99_0.MYI' (Errcode: 2)
>
> What's going on?


perror 2 returns "Error code   2:  No such file or directory"

Does /var/tmp exist on the server?

If you run explain on your query in both cases (with one record and with more than one record) you will see that when there is more than one record it is probably using temporary tables and file sort, but is not when there's only one record.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux