QUERY PLAN
Aggregate (cost=138.46..138.47 rows=1 width=8)
-> Sort (cost=134.82..135.43 rows=243 width=358)
Sort Key: r.open_from DESC, r.created_at DESC
-> Hash Right Join (cost=50.71..125.19 rows=243 width=358)
Hash Cond: (rvr.rating_id = r.id)
-> Seq Scan on tbl_rating_voters rvr (cost=0.00..74.34 rows=10 width=4)
Filter: (user_id = 1000)
-> Hash (cost=47.68..47.68 rows=243 width=20)
-> Hash Right Join (cost=10.47..47.68 rows=243 width=20)
Hash Cond: (rc.rating_id = r.id)
-> Seq Scan on tbl_rating_candidates rc (cost=0.00..37.16 rows=18 width=4)
Filter: (user_id = 1000)
-> Hash (cost=7.43..7.43 rows=243 width=20)
-> Seq Scan on tbl_ratings r (cost=0.00..7.43 rows=243 width=20)