Limit (cost=17895.16..17906.83 rows=100 width=163) |
-> Gather Merge (cost=17895.16..20892.54 rows=25690 width=163) |
Workers Planned: 2 |
-> Sort (cost=16895.14..16927.25 rows=12845 width=163) |
Sort Key: (CASE WHEN ((c.created_by = 1001) OR uc.is_read) THEN true ELSE false END), c.created_at DESC |
-> Hash Left Join (cost=4569.23..16018.54 rows=12845 width=163) |
Hash Cond: (c.id = uc.comment_id) |
Filter: ((uc.remind_user_id = 1001) OR (c.created_by = 1001)) |
-> Parallel Seq Scan on tbl_comments c (cost=0.00..4448.32 rows=55548 width=158) |
Filter: is_system |
-> Hash (cost=4162.18..4162.18 rows=32564 width=9) |
-> Seq Scan on tbl_unread_comments uc (cost=0.00..4162.18 rows=32564 width=9) |
Filter: (remind_user_id = 1001) |