Better HN
topnewbestaskshowjobs
Log inSign up

puthre

1 karma · joined Mar 7, 2015 (11y ago) · 3 submissions

Submissions

comment 5y ago · link · parent

Can I install redis on it?

comment 6y ago · link · parent

Can you swap on it?

comment 11y ago · link · parent

1. Count N

2. compute p = n/N

3. select * from table where random()<p*(some lambda >1) order by random() limit n

4. Repeat 3 until you got n rows