QUERY PLAN
GroupAggregate (cost=1008.56..4362.80 rows=1 width=12)
Group Key: uc.object_id
-> Nested Loop (cost=1008.56..4362.78 rows=1 width=4)
Join Filter: (r.id = uc.object_id)
-> Merge Join (cost=8.56..9.04 rows=1 width=8)
Merge Cond: (r.id = rccr.punch_leave_id)
-> Sort (cost=6.02..6.26 rows=94 width=4)
Sort Key: r.id
-> Seq Scan on tbl_punch_leaves r (cost=0.00..2.94 rows=94 width=4)
-> Sort (cost=2.54..2.54 rows=1 width=4)
Sort Key: rccr.punch_leave_id
-> Seq Scan on tbl_punch_leave_carbon_copy_rels rccr (cost=0.00..2.53 rows=1 width=4)
Filter: (user_id = 1000)
-> Gather (cost=1000.00..4353.73 rows=1 width=4)
Workers Planned: 1
-> Parallel Seq Scan on tbl_unread_comments uc (cost=0.00..3353.63 rows=1 width=4)
Filter: ((NOT is_read) AND ((object_type)::text = '40'::text) AND (remind_user_id = 1000))