| Aggregate (cost=25509.81..25509.82 rows=1 width=8) |
| -> Sort (cost=24881.56..24986.27 rows=41883 width=248) |
| Sort Key: (CASE WHEN ((c.created_by = 1001) OR uc.is_read) THEN true ELSE false END), c.created_at DESC |
| -> Hash Right Join (cost=10071.77..16797.69 rows=41883 width=248) |
| Hash Cond: (uc.comment_id = c.id) |
| Filter: ((uc.remind_user_id = 1001) OR (c.created_by = 1001)) |
| -> Seq Scan on tbl_unread_comments uc (cost=0.00..5238.20 rows=40383 width=9) |
| Filter: (remind_user_id = 1001) |
| -> Hash (cost=6935.95..6935.95 rows=180386 width=16) |
| -> Seq Scan on tbl_comments c (cost=0.00..6935.95 rows=180386 width=16) |
| Filter: is_system |