QUERY PLAN
Sort (cost=406.09..406.21 rows=47 width=41)
Sort Key: (COALESCE(sum(p.budget), '0'::numeric)) DESC
-> GroupAggregate (cost=403.84..404.78 rows=47 width=41)
Group Key: c.name
-> Sort (cost=403.84..403.96 rows=47 width=14)
Sort Key: c.name
-> Hash Join (cost=199.73..402.54 rows=47 width=14)
Hash Cond: (p.from_contact = c.id)
-> Seq Scan on tbl_projects p (cost=0.00..202.69 rows=47 width=9)
Filter: ((created_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2026-12-31 23:59:59+08'::timestamp with time zone) AND (project_status = 3))
-> Hash (cost=139.88..139.88 rows=4788 width=13)
-> Seq Scan on tbl_contacts c (cost=0.00..139.88 rows=4788 width=13)