owner_name, c.name AS category_name, array_agg(cm.author) AS comment_authors, array_agg(cm.body) AS comment_bodies from products p join owners o on o.id = p.owner_id join categories c on c.id = p.category_id join comments ct on ct.product_id = p.id group by 1, 2, 3 Materialised View