QUERY PLAN
Aggregate (cost=124.91..124.92 rows=1 width=8)
-> Sort (cost=121.67..122.21 rows=216 width=358)
Sort Key: r.open_from DESC, r.created_at DESC
-> Hash Right Join (cost=45.89..113.30 rows=216 width=358)
Hash Cond: (rvr.rating_id = r.id)
-> Seq Scan on tbl_rating_voters rvr (cost=0.00..67.25 rows=11 width=4)
Filter: (user_id = 1000)
-> Hash (cost=43.19..43.19 rows=216 width=20)
-> Hash Right Join (cost=8.86..43.19 rows=216 width=20)
Hash Cond: (rc.rating_id = r.id)
-> Seq Scan on tbl_rating_candidates rc (cost=0.00..34.29 rows=18 width=4)
Filter: (user_id = 1000)
-> Hash (cost=6.16..6.16 rows=216 width=20)
-> Seq Scan on tbl_ratings r (cost=0.00..6.16 rows=216 width=20)