QUERY PLAN
GroupAggregate (cost=1010.14..4689.10 rows=1 width=12)
Group Key: uc.object_id
-> Nested Loop (cost=1010.14..4689.08 rows=1 width=4)
Join Filter: (r.id = uc.object_id)
-> Merge Join (cost=10.14..10.73 rows=1 width=8)
Merge Cond: (r.id = rccr.punch_leave_id)
-> Sort (cost=7.14..7.43 rows=116 width=4)
Sort Key: r.id
-> Seq Scan on tbl_punch_leaves r (cost=0.00..3.16 rows=116 width=4)
-> Sort (cost=3.00..3.00 rows=1 width=4)
Sort Key: rccr.punch_leave_id
-> Seq Scan on tbl_punch_leave_carbon_copy_rels rccr (cost=0.00..2.99 rows=1 width=4)
Filter: (user_id = 1000)
-> Gather (cost=1000.00..4678.34 rows=1 width=4)
Workers Planned: 1
-> Parallel Seq Scan on tbl_unread_comments uc (cost=0.00..3678.24 rows=1 width=4)
Filter: ((NOT is_read) AND ((object_type)::text = '40'::text) AND (remind_user_id = 1000))