Whenever I need to return a random record from my tables and performance matters, instead of:
SELECT column FROM table ORDER BY random() LIMIT 1;
I always do:
SELECT column FROM table TABLESAMPLE BERNOULLI(1) LIMIT 1;
This is much faster but it seems like it's not very random? It looks like a lot of the same records get returned when using this method repeatedly. Is it just me or is this method much less random (and less useful because of that)?