How to optimize PostgreSQL query with multiple joins and subqueries and slow grouping/sorting? Published -- Download video MP4 360p