QUERY PLAN
GroupAggregate (cost=60.87..60.93 rows=3 width=12)
Group Key: task_group_id
-> Sort (cost=60.87..60.88 rows=3 width=4)
Sort Key: task_group_id
-> Seq Scan on tbl_tasks (cost=0.00..60.85 rows=3 width=4)
Filter: ((parent_id IS NULL) AND (status = 0) AND (task_group_id = ANY ('{139,106,96,94,90,89,88,87,85,84}'::integer[])))