optimized fetching random element