| Aggregate (cost=15883.92..15883.93 rows=1 width=8) |
| -> Sort (cost=15874.37..15875.96 rows=637 width=248) |
| Sort Key: (CASE WHEN ((c.created_by = 1000) OR uc.is_read) THEN true ELSE false END), c.created_at DESC |
| -> Hash Right Join (cost=11073.70..15844.70 rows=637 width=248) |
| Hash Cond: (uc.comment_id = c.id) |
| Filter: ((uc.remind_user_id = 1000) OR (c.created_by = 1000)) |
| -> Gather (cost=1000.00..4878.78 rows=619 width=9) |
| Workers Planned: 1 |
| -> Parallel Seq Scan on tbl_unread_comments uc (cost=0.00..3816.88 rows=364 width=9) |
| Filter: (remind_user_id = 1000) |
| -> Hash (cost=6937.40..6937.40 rows=180424 width=16) |
| -> Seq Scan on tbl_comments c (cost=0.00..6937.40 rows=180424 width=16) |
| Filter: is_system |