QUERY PLAN
GroupAggregate (cost=51.22..51.26 rows=1 width=76)
Group Key: u.id
-> Sort (cost=51.22..51.22 rows=1 width=22)
Sort Key: u.id
-> Nested Loop (cost=13.88..51.21 rows=1 width=22)
-> Hash Join (cost=13.60..43.74 rows=10 width=12)
Hash Cond: (pa.engineer_id = u.id)
-> Seq Scan on tbl_project_architects pa (cost=0.00..26.28 rows=1428 width=12)
-> Hash (cost=13.59..13.59 rows=1 width=4)
-> Index Only Scan using tbl_users_pkey on tbl_users u (cost=0.14..13.59 rows=1 width=4)
Index Cond: ((id = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[])) AND (id = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[])))
-> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..0.74 rows=1 width=14)
Index Cond: (id = pa.project_id)
Filter: ((bargain_date >= '2026-01-01'::date) AND (bargain_date < '2027-01-01 00:00:00'::timestamp without time zone) AND (project_status = 3))