QUERY PLAN
Aggregate (cost=683.42..683.43 rows=1 width=64)
-> Hash Join (cost=448.16..683.41 rows=1 width=4)
Hash Cond: (cr.case_id = c.id)
-> Seq Scan on tbl_callback_records cr (cost=0.00..232.98 rows=865 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=448.09..448.09 rows=6 width=4)
-> Subquery Scan on c (cost=448.00..448.09 rows=6 width=4)
-> Group (cost=448.00..448.03 rows=6 width=285)
Group Key: c_1.id
-> Sort (cost=448.00..448.01 rows=6 width=4)
Sort Key: c_1.id
-> Hash Right Join (cost=319.12..447.92 rows=6 width=4)
Hash Cond: (cs.case_id = c_1.id)
-> Seq Scan on tbl_case_services cs (cost=0.00..110.12 rows=7112 width=4)
-> Hash (cost=319.04..319.04 rows=6 width=4)
-> Seq Scan on tbl_cases c_1 (cost=0.00..319.04 rows=6 width=4)
Filter: ((last_engineer = 1001) AND (case_type = 1) AND (case_status = 5))