| HashAggregate (cost=121.54..122.97 rows=95 width=76) |
| Group Key: gb.id |
| -> Hash Left Join (cost=30.22..120.59 rows=95 width=22) |
| Hash Cond: (prod.product_brand = gb.id) |
| -> Nested Loop (cost=22.32..112.44 rows=95 width=14) |
| -> Hash Join (cost=22.04..32.56 rows=95 width=14) |
| Hash Cond: (sp.id = eipss.erp_sales_outbound_spent_product_id) |
| -> Seq Scan on tbl_erp_sales_outbound_spent_products sp (cost=0.00..8.27 rows=427 width=8) |
| -> Hash (cost=20.85..20.85 rows=95 width=14) |
| -> Hash Join (cost=7.17..20.85 rows=95 width=14) |
| Hash Cond: (eipss.erp_sales_outbound_id = t.id) |
| -> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.65 rows=384 width=18) |
| Filter: (erp_sales_outbound_spent_product_id IS NOT NULL) |
| -> Hash (cost=6.70..6.70 rows=38 width=4) |
| -> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..6.70 rows=38 width=4) |
| Filter: ((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 (status = 2)) |
| -> Index Scan using tbl_products_pkey on tbl_products prod (cost=0.28..0.84 rows=1 width=8) |
| Index Cond: (id = sp.product_id) |
| -> Hash (cost=5.18..5.18 rows=218 width=12) |
| -> Seq Scan on tbl_product_brands gb (cost=0.00..5.18 rows=218 width=12) |