QUERY PLAN
GroupAggregate (cost=0.00..107.91 rows=1 width=12)
Group Key: remain_task.task_group_id
-> Nested Loop Anti Join (cost=0.00..107.90 rows=1 width=4)
Join Filter: (child_task.parent_id = remain_task.id)
-> Seq Scan on tbl_tasks remain_task (cost=0.00..49.36 rows=1 width=8)
Filter: ((status <> 1) AND (task_group_id = 194))
-> Seq Scan on tbl_tasks child_task (cost=0.00..43.24 rows=1224 width=4)