| GroupAggregate (cost=602.97..603.08 rows=4 width=42) |
| Group Key: sub.new_status |
| -> Sort (cost=602.97..602.98 rows=6 width=7) |
| Sort Key: sub.new_status |
| -> Subquery Scan on sub (cost=493.87..602.89 rows=6 width=7) |
| Filter: ((sub.new_status = ANY ('{1,2}'::integer[])) AND (sub.rn = 1)) |
| -> WindowAgg (cost=493.87..556.17 rows=3115 width=27) |
| -> Sort (cost=493.87..501.65 rows=3115 width=19) |
| Sort Key: l.project_id, l.created_at DESC |
| -> Hash Join (cost=215.70..313.12 rows=3115 width=19) |
| Hash Cond: (l.project_id = p.id) |
| -> Seq Scan on tbl_project_status_logs l (cost=0.00..89.23 rows=3115 width=14) |
| Filter: ((created_at < '2026-02-01 00:00:00+08'::timestamp with time zone) AND (new_status > 0)) |
| -> Hash (cost=176.42..176.42 rows=3142 width=9) |
| -> Seq Scan on tbl_projects p (cost=0.00..176.42 rows=3142 width=9) |