QUERY PLAN
Sort (cost=1495.62..1495.85 rows=95 width=62)
Sort Key: sub2.voted_for, sub2."order"
-> Subquery Scan on sub2 (cost=1488.69..1492.49 rows=95 width=62)
-> GroupAggregate (cost=1488.69..1491.54 rows=95 width=62)
Group Key: rv.voted_for, rv.dimension_id, rd.dimension, rd."order"
-> Sort (cost=1488.69..1488.93 rows=95 width=34)
Sort Key: rv.voted_for, rv.dimension_id, rd.dimension, rd."order"
-> Hash Left Join (cost=69.77..1485.57 rows=95 width=34)
Hash Cond: (rv.dimension_id = rd.id)
-> Hash Join (cost=67.55..1483.09 rows=95 width=12)
Hash Cond: (rv.voter = tbl_rating_voters.user_id)
-> Seq Scan on tbl_rating_votes rv (cost=0.00..1414.05 rows=163 width=16)
Filter: (rating_id = 325)
-> Hash (cost=67.40..67.40 rows=12 width=4)
-> HashAggregate (cost=67.28..67.40 rows=12 width=4)
Group Key: tbl_rating_voters.user_id
-> Seq Scan on tbl_rating_voters (cost=0.00..67.25 rows=13 width=4)
Filter: (completed AND (rating_id = 325))
-> Hash (cost=1.54..1.54 rows=54 width=26)
-> Seq Scan on tbl_rating_dimensions rd (cost=0.00..1.54 rows=54 width=26)