QUERY PLAN
GroupAggregate (cost=108.08..108.10 rows=1 width=12)
Group Key: remain_task.task_group_id
-> Sort (cost=108.08..108.09 rows=1 width=4)
Sort Key: remain_task.task_group_id
-> Nested Loop Anti Join (cost=0.00..108.07 rows=1 width=4)
Join Filter: (child_task.parent_id = remain_task.id)
-> Seq Scan on tbl_tasks remain_task (cost=0.00..50.32 rows=1 width=8)
Filter: ((status <> 1) AND (task_group_id = ANY ('{191,93,14}'::integer[])))
-> Seq Scan on tbl_tasks child_task (cost=0.00..42.89 rows=1189 width=4)