Aggregate (cost=470.29..470.30 rows=1 width=32) |
-> Hash Semi Join (cost=382.56..466.49 rows=1521 width=6) |
Hash Cond: (t.sales_contract_id = t_1.id) |
-> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..61.79 rows=1986 width=10) |
Filter: ((created_at < '2025-08-05 17:19:26+08'::timestamp with time zone) AND (status = 2)) |
-> Hash (cost=367.85..367.85 rows=1177 width=4) |
-> Hash Left Join (cost=132.91..367.85 rows=1177 width=4) |
Hash Cond: (t_1.client_id = c.id) |
Filter: ((c.sales_rep = ANY ('{1001,5087,1005,1004,5295,5300,5311,5332,1013,5449}'::integer[])) OR (c.sales_rep IS NULL)) |
-> Seq Scan on tbl_sales_contracts t_1 (cost=0.00..230.80 rows=1569 width=8) |
Filter: (need_analysis AND (created_at < '2025-08-05 17:19:26+08'::timestamp with time zone)) |
-> Hash (cost=107.96..107.96 rows=1996 width=8) |
-> Seq Scan on tbl_clients c (cost=0.00..107.96 rows=1996 width=8) |