QUERY PLAN
Limit (cost=17456.13..17467.80 rows=100 width=158)
-> Gather Merge (cost=17444.47..17506.30 rows=530 width=158)
Workers Planned: 2
-> Sort (cost=16444.44..16445.11 rows=265 width=158)
Sort Key: (CASE WHEN ((c.created_by = 1000) OR uc.is_read) THEN true ELSE false END), c.created_at DESC
-> Merge Left Join (cost=5273.22..16433.78 rows=265 width=158)
Merge Cond: (c.id = uc.comment_id)
Filter: ((uc.remind_user_id = 1000) OR (c.created_by = 1000))
-> Parallel Index Scan using tbl_comments_pkey on tbl_comments c (cost=0.42..10966.03 rows=75177 width=153)
Filter: is_system
-> Sort (cost=5272.80..5274.35 rows=619 width=9)
Sort Key: uc.comment_id
-> Seq Scan on tbl_unread_comments uc (cost=0.00..5244.10 rows=619 width=9)
Filter: (remind_user_id = 1000)