QUERY PLAN
Result (cost=38.27..38.28 rows=1 width=1)
InitPlan 2 (returns $2)
-> Nested Loop Left Join (cost=10.31..38.27 rows=1 width=0)
Filter: ((c.sales_rep IS NULL) OR (c.sales_rep = ANY ('{5295,5311}'::integer[])) OR (prr.user_id = 5295) OR (hashed SubPlan 1))
-> Nested Loop Left Join (cost=0.28..20.21 rows=1 width=8)
Join Filter: (prr.project_id = p.id)
-> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..8.30 rows=1 width=8)
Index Cond: (id = 3932)
-> Seq Scan on tbl_project_remind_receivers prr (cost=0.00..11.89 rows=2 width=8)
Filter: (project_id = 3932)
-> Index Scan using tbl_clients_pkey on tbl_clients c (cost=0.28..8.29 rows=1 width=8)
Index Cond: (p.client_id = id)
SubPlan 1
-> Seq Scan on tbl_user_visit_clients (cost=0.00..9.75 rows=1 width=4)
Filter: (user_id = 5295)