Am 01.05.2014 15:47, schrieb Wietse Venema:
> Marcus:
>>> You need to use a more efficient implementation. Why do you need a
>>> UNIX-domain server in the first place?
>>
>> Because that's the only way I could think of that would work given that
>> the solution must work with pseudo-random transport.
>>
>> I'm after something that works as follows
>> # sometimes 'example.com' is sent down 'foo' and other times it's
>> # sent down 'bar'
>> example.com    foo:
>> example.com    bar:
> 
> Looks like the proposed randmap that was discussed a week or so ago.
> 
> In that thread, the MySQL RANDOM() function turned out to be a
> usable alternative

please be aware that order by rand() unconditionally leads to a temporary
table which may lead to high load, frankly even if you do "select
primary_key_field from table order by rand()" leads to a temp-table

select primary_key_field from table order by rand() limit 3 -> the same

that's why select all primary keys from a php application, pick
3 random primary keys and fire 3 selects for the records is
magnitudes faster that the mysql random with one query

Reply via email to