QUERY PLAN
Limit (cost=118.70..118.73 rows=10 width=128)
-> Sort (cost=118.70..119.24 rows=216 width=128)
Sort Key: r.open_from DESC, r.created_at DESC
-> Hash Right Join (cost=45.92..114.04 rows=216 width=128)
Hash Cond: (rvr.rating_id = r.id)
Filter: ((rvr.id IS NOT NULL) OR (rc.id IS NOT NULL))
-> Seq Scan on tbl_rating_voters rvr (cost=0.00..67.25 rows=63 width=9)
Filter: (user_id = 5295)
-> Hash (cost=43.22..43.22 rows=216 width=130)
-> Hash Right Join (cost=8.86..43.22 rows=216 width=130)
Hash Cond: (rc.rating_id = r.id)
-> Seq Scan on tbl_rating_candidates rc (cost=0.00..34.29 rows=28 width=8)
Filter: (user_id = 5295)
-> Hash (cost=6.16..6.16 rows=216 width=126)
-> Seq Scan on tbl_ratings r (cost=0.00..6.16 rows=216 width=126)