select * from rating_dimensions $extra_query select rating_id, rating from ratings where object_id = :object_id $extra_query select avg(rating::float) from ratings where object_id = :object_id $extra_query