| GroupAggregate (cost=232.01..232.46 rows=20 width=42) |
| Group Key: sub.new_status |
| -> Sort (cost=232.01..232.06 rows=20 width=7) |
| Sort Key: sub.new_status |
| -> Subquery Scan on sub (cost=231.18..231.58 rows=20 width=7) |
| -> Unique (cost=231.18..231.38 rows=20 width=11) |
| -> Sort (cost=231.18..231.23 rows=20 width=11) |
| Sort Key: l.project_id, l.new_status, p.budget |
| -> Nested Loop (cost=0.28..230.75 rows=20 width=11) |
| -> Seq Scan on tbl_project_status_logs l (cost=0.00..104.79 rows=20 width=6) |
| Filter: ((created_at >= '2025-02-01 00:00:00+08'::timestamp with time zone) AND (created_at < '2025-03-01 00:00:00+08'::timestamp with time zone) AND (new_status = ANY ('{3,4,5}'::integer[]))) |
| -> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..6.30 rows=1 width=9) |
| Index Cond: (id = l.project_id) |