Limit (cost=128.84..128.89 rows=20 width=132) |
-> Sort (cost=128.84..129.42 rows=231 width=132) |
Sort Key: (CASE WHEN ((r.open_from <= now()) AND (r.close_at >= now())) THEN 1 WHEN (r.open_from > now()) THEN 2 ELSE 3 END), r.created_at DESC |
-> Hash Left Join (cost=44.65..122.69 rows=231 width=132) |
Hash Cond: (r.id = rc.rating_id) |
-> Hash Right Join (cost=9.20..81.41 rows=231 width=131) |
Hash Cond: (rvr.rating_id = r.id) |
-> Seq Scan on tbl_rating_voters rvr (cost=0.00..71.61 rows=223 width=9) |
Filter: (user_id = 1001) |
-> Hash (cost=6.31..6.31 rows=231 width=126) |
-> Seq Scan on tbl_ratings r (cost=0.00..6.31 rows=231 width=126) |
-> Hash (cost=35.38..35.38 rows=6 width=4) |
-> Seq Scan on tbl_rating_candidates rc (cost=0.00..35.38 rows=6 width=4) |
Filter: (user_id = 1001) |