QUERY PLAN
GroupAggregate (cost=126.22..126.40 rows=10 width=44)
Group Key: s.id
-> Sort (cost=126.22..126.25 rows=10 width=40)
Sort Key: s.id
-> Hash Left Join (cost=17.20..126.06 rows=10 width=40)
Hash Cond: (ps.service_id = s.id)
-> Seq Scan on tbl_pre_sales ps (cost=0.00..108.83 rows=10 width=12)
Filter: ((NOT is_draft) AND (created_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2026-12-31 23:59:59+08'::timestamp with time zone) AND (created_by = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[])))
-> Hash (cost=14.31..14.31 rows=231 width=36)
-> Seq Scan on tbl_services s (cost=0.00..14.31 rows=231 width=36)