Aggregate (cost=10583.47..10583.48 rows=1 width=8) |
-> Sort (cost=10581.80..10582.08 rows=111 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=7301.22..10578.03 rows=111 width=248) |
Hash Cond: (uc.comment_id = c.id) |
Filter: ((uc.remind_user_id = 1000) OR (c.created_by = 1000)) |
-> Gather (cost=1000.00..4275.38 rows=438 width=9) |
Workers Planned: 1 |
-> Parallel Seq Scan on tbl_unread_comments uc (cost=0.00..3231.58 rows=258 width=9) |
Filter: (remind_user_id = 1000) |
-> Hash (cost=5891.65..5891.65 rows=32766 width=16) |
-> Seq Scan on tbl_comments c (cost=0.00..5891.65 rows=32766 width=16) |
Filter: (NOT is_system) |