QUERY PLAN
GroupAggregate (cost=177.06..177.15 rows=5 width=12)
Group Key: task_group_id
-> Sort (cost=177.06..177.07 rows=5 width=4)
Sort Key: task_group_id
-> Seq Scan on tbl_tasks (cost=0.00..177.00 rows=5 width=4)
Filter: ((parent_id IS NULL) AND (status = 0) AND (task_group_id = ANY ('{190,189,188,187,178,141,140,139,106,105,99,98,97,96,94,93,90,89,88,87}'::integer[])))