| Sort (cost=298.01..298.05 rows=13 width=41) |
| Sort Key: (COALESCE(sum(p.budget), '0'::numeric)) DESC |
| -> GroupAggregate (cost=297.51..297.77 rows=13 width=41) |
| Group Key: c.name |
| -> Sort (cost=297.51..297.55 rows=13 width=14) |
| Sort Key: c.name |
| -> Nested Loop (cost=0.28..297.27 rows=13 width=14) |
| -> Seq Scan on tbl_projects p (cost=0.00..201.37 rows=13 width=9) |
| Filter: ((created_at >= '2022-06-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2022-06-30 23:59:59+08'::timestamp with time zone) AND (project_status = 3)) |
| -> Index Scan using tbl_contacts_pkey on tbl_contacts c (cost=0.28..7.38 rows=1 width=13) |
| Index Cond: (id = p.from_contact) |