QUERY PLAN
GroupAggregate (cost=112.59..112.65 rows=3 width=12)
Group Key: remain_task.task_group_id
-> Sort (cost=112.59..112.60 rows=3 width=4)
Sort Key: remain_task.task_group_id
-> Hash Anti Join (cost=57.75..112.57 rows=3 width=4)
Hash Cond: (remain_task.id = child_task.parent_id)
-> Seq Scan on tbl_tasks remain_task (cost=0.00..54.78 rows=3 width=8)
Filter: ((status <> 1) AND (task_group_id = ANY ('{205,203,201,189,188,187}'::integer[])))
-> Hash (cost=42.89..42.89 rows=1189 width=4)
-> Seq Scan on tbl_tasks child_task (cost=0.00..42.89 rows=1189 width=4)