Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't remember if there's a way to see how many slots an ets table has, but if you're ok with imperfect distribution, you could maybe pick a slot at random and use ets:slot/2 to get all the items in that slot, then select from those.

You might be able to get the slot count from eta:table_info(Table, stats), although that's not intended for production use, so the format may change without notice.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: