| Limit (cost=23877.19..23877.24 rows=20 width=157) |
| -> Sort (cost=23877.19..23981.70 rows=41804 width=157) |
| 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=13079.33..22764.80 rows=41804 width=157) |
| 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..5202.40 rows=39830 width=9) |
| Filter: (remind_user_id = 1001) |
| -> Hash (cost=6936.06..6936.06 rows=180742 width=152) |
| -> Seq Scan on tbl_comments c (cost=0.00..6936.06 rows=180742 width=152) |
| Filter: is_system |