QUERY PLAN
Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..44.96 rows=1 width=438)
Index Cond: (id = 3805)
SubPlan 1
-> Aggregate (cost=36.64..36.65 rows=1 width=32)
-> Seq Scan on tbl_invoices i (cost=0.00..36.64 rows=1 width=6)
Filter: (project_id = p.id)