decrypto-org/spider

Introduce randomizing in DB sorting

Closed this issue · 0 comments

In order to get an even request distribution across all available hosts, we introduce a new entry in the Path table: RANDOM. This field contains a random number between 0 and 100. When we need new DbResults, we sort by this random column and then select the next N elements from this sorted view. In order to prevent starving, one could randomize a Where clause: select a random number, select randomly whether it has to be larger or smaller than this and select those elements to be returned.