QUERY PLAN
GroupAggregate (cost=117.51..117.77 rows=6 width=57)
Group Key: (to_date(to_char((p.bargain_date)::timestamp with time zone, 'yyyy'::text), 'yyyy'::text)), ppt.product_type_id, ppt.name
-> Sort (cost=117.51..117.53 rows=6 width=30)
Sort Key: (to_date(to_char((p.bargain_date)::timestamp with time zone, 'yyyy'::text), 'yyyy'::text)), ppt.product_type_id, ppt.name
-> Hash Join (cost=39.55..117.44 rows=6 width=30)
Hash Cond: (ppt.project_id = p.id)
-> Seq Scan on tbl_project_product_types ppt (cost=0.00..69.44 rows=3198 width=30)
Filter: (budget IS NOT NULL)
-> Hash (cost=39.47..39.47 rows=6 width=8)
-> Bitmap Heap Scan on tbl_projects p (cost=4.36..39.47 rows=6 width=8)
Recheck Cond: (client_id = 982)
Filter: (project_status = 3)
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..4.36 rows=11 width=0)
Index Cond: (client_id = 982)