QUERY PLAN
Aggregate (cost=133.69..133.70 rows=1 width=8)
-> Sort (cost=130.18..130.77 rows=234 width=358)
Sort Key: r.open_from DESC, r.created_at DESC
-> Hash Right Join (cost=48.80..120.98 rows=234 width=358)
Hash Cond: (rvr.rating_id = r.id)
-> Seq Scan on tbl_rating_voters rvr (cost=0.00..72.03 rows=11 width=4)
Filter: (user_id = 1000)
-> Hash (cost=45.87..45.87 rows=234 width=20)
-> Hash Right Join (cost=9.27..45.87 rows=234 width=20)
Hash Cond: (rc.rating_id = r.id)
-> Seq Scan on tbl_rating_candidates rc (cost=0.00..36.56 rows=18 width=4)
Filter: (user_id = 1000)
-> Hash (cost=6.34..6.34 rows=234 width=20)
-> Seq Scan on tbl_ratings r (cost=0.00..6.34 rows=234 width=20)