| GroupAggregate (cost=26.04..26.09 rows=2 width=76) |
| Group Key: gb.id |
| -> Sort (cost=26.04..26.04 rows=2 width=21) |
| Sort Key: gb.id |
| -> Nested Loop Left Join (cost=10.37..26.03 rows=2 width=21) |
| -> Nested Loop (cost=10.22..25.68 rows=2 width=13) |
| -> Nested Loop (cost=9.95..23.94 rows=2 width=13) |
| -> Hash Join (cost=9.67..23.19 rows=2 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=1 width=4) |
| -> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..9.66 rows=1 width=4) |
| Filter: ((created_at >= '2025-01-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-05-29 23:59:59+08'::timestamp with time zone) AND (status = 2)) |
| -> Index Scan using tbl_erp_sales_outbound_spent_products_pkey on tbl_erp_sales_outbound_spent_products sp (cost=0.27..0.38 rows=1 width=8) |
| Index Cond: (id = eipss.erp_sales_outbound_spent_product_id) |
| -> 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) |
| -> Index Scan using tbl_product_brands_pkey on tbl_product_brands gb (cost=0.14..0.17 rows=1 width=12) |
| Index Cond: (id = prod.product_brand) |