QUERY PLAN
Aggregate (cost=665.94..665.95 rows=1 width=64)
-> Hash Join (cost=436.81..665.93 rows=1 width=4)
Hash Cond: (cr.case_id = c.id)
-> Seq Scan on tbl_callback_records cr (cost=0.00..227.34 rows=676 width=8)
Filter: ((callback_date >= '2025-01-01'::date) AND (callback_date < '2026-01-01 00:00:00'::timestamp without time zone) AND ((satisfaction_score <> 0) OR (skill_score <> 0)))
-> Hash (cost=436.74..436.74 rows=6 width=4)
-> Subquery Scan on c (cost=436.65..436.74 rows=6 width=4)
-> Group (cost=436.65..436.68 rows=6 width=285)
Group Key: c_1.id
-> Sort (cost=436.65..436.66 rows=6 width=4)
Sort Key: c_1.id
-> Hash Right Join (cost=311.60..436.57 rows=6 width=4)
Hash Cond: (cs.case_id = c_1.id)
-> Seq Scan on tbl_case_services cs (cost=0.00..106.88 rows=6888 width=4)
-> Hash (cost=311.52..311.52 rows=6 width=4)
-> Seq Scan on tbl_cases c_1 (cost=0.00..311.52 rows=6 width=4)
Filter: ((last_engineer = 1001) AND (case_type = 1) AND (case_status = 5))