QUERY PLAN
Sort (cost=1497.95..1498.19 rows=95 width=62)
Sort Key: sub2.voted_for, sub2."order"
-> Subquery Scan on sub2 (cost=1491.03..1494.83 rows=95 width=62)
-> GroupAggregate (cost=1491.03..1493.88 rows=95 width=62)
Group Key: rv.voted_for, rv.dimension_id, rd.dimension, rd."order"
-> Sort (cost=1491.03..1491.27 rows=95 width=34)
Sort Key: rv.voted_for, rv.dimension_id, rd.dimension, rd."order"
-> Hash Left Join (cost=69.77..1487.91 rows=95 width=34)
Hash Cond: (rv.dimension_id = rd.id)
-> Hash Join (cost=67.55..1485.42 rows=95 width=12)
Hash Cond: (rv.voter = tbl_rating_voters.user_id)
-> Seq Scan on tbl_rating_votes rv (cost=0.00..1416.39 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)