QUERY PLAN
GroupAggregate (cost=156.69..157.24 rows=29 width=12)
Group Key: remain_task.task_group_id
-> Sort (cost=156.69..156.78 rows=34 width=4)
Sort Key: remain_task.task_group_id
-> Hash Anti Join (cost=60.30..155.83 rows=34 width=4)
Hash Cond: (remain_task.id = child_task.parent_id)
-> Seq Scan on tbl_tasks remain_task (cost=0.00..94.90 rows=35 width=8)
Filter: ((status <> 1) AND (task_group_id = ANY ('{207,206,205,203,202,201,200,199,198,197,196,194,193,192,191,190,189,188,187,178,141,140,139,106,105,99,98,97,96,94}'::integer[])))
-> Hash (cost=44.58..44.58 rows=1258 width=4)
-> Seq Scan on tbl_tasks child_task (cost=0.00..44.58 rows=1258 width=4)