| HashAggregate (cost=121.60..122.93 rows=89 width=76) |
| Group Key: gb.id |
| -> Hash Left Join (cost=32.92..120.71 rows=89 width=21) |
| Hash Cond: (prod.product_brand = gb.id) |
| -> Nested Loop (cost=25.02..112.57 rows=89 width=13) |
| -> Hash Join (cost=24.74..34.99 rows=89 width=13) |
| 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.11 rows=411 width=8) |
| -> Hash (cost=23.62..23.62 rows=89 width=13) |
| -> Hash Join (cost=10.11..23.62 rows=89 width=13) |
| Hash Cond: (eipss.erp_sales_outbound_id = t.id) |
| -> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.51 rows=374 width=17) |
| Filter: (erp_sales_outbound_spent_product_id IS NOT NULL) |
| -> Hash (cost=9.66..9.66 rows=36 width=4) |
| -> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..9.66 rows=36 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.87 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) |