Weighted Random Sampling with PostgreSQL – Marco Santoni