QUERY PLAN
GroupAggregate (cost=157.21..157.23 rows=1 width=12)
Group Key: task_group_id
-> Sort (cost=157.21..157.22 rows=1 width=4)
Sort Key: task_group_id
-> Seq Scan on tbl_tasks (cost=0.00..157.20 rows=1 width=4)
Filter: ((parent_id IS NULL) AND (status = 0) AND (task_group_id = ANY ('{202,201,199,198,196,98,65}'::integer[])))