QUERY PLAN
GroupAggregate (cost=197.23..197.49 rows=6 width=214)
Group Key: ct.id
-> Merge Left Join (cost=197.23..197.32 rows=6 width=160)
Merge Cond: (ct.id = c.client_type)
-> Sort (cost=1.14..1.15 rows=6 width=150)
Sort Key: ct.id
-> Seq Scan on tbl_client_types ct (cost=0.00..1.06 rows=6 width=150)
-> Sort (cost=196.09..196.10 rows=4 width=14)
Sort Key: c.client_type
-> Nested Loop (cost=45.72..196.05 rows=4 width=14)
-> Bitmap Heap Scan on tbl_projects p (cost=45.44..162.87 rows=4 width=14)
Recheck Cond: ((created_by = ANY ('{5329,5332,5420,1001,5087,5300,5311,5364,5295,1013,1025,1004,5359,5409,5412,1005,5358}'::integer[])) AND (created_by = 1001))
Filter: ((bargain_date >= '2024-01-01'::date) AND (bargain_date < '2025-01-01 00:00:00'::timestamp without time zone) AND (project_status = 3))
-> Bitmap Index Scan on tbl_projects_created_by_idx (cost=0.00..45.44 rows=67 width=0)
Index Cond: ((created_by = ANY ('{5329,5332,5420,1001,5087,5300,5311,5364,5295,1013,1025,1004,5359,5409,5412,1005,5358}'::integer[])) AND (created_by = 1001))
-> Index Scan using tbl_clients_pkey on tbl_clients c (cost=0.28..8.29 rows=1 width=8)
Index Cond: (id = p.client_id)