| Subquery Scan on sub (cost=226.09..227.59 rows=1 width=164) |
| Filter: (sub.id = 1372) |
| -> WindowAgg (cost=226.09..226.97 rows=50 width=164) |
| -> Sort (cost=226.09..226.22 rows=50 width=156) |
| Sort Key: sub_1.updated_at DESC |
| -> Subquery Scan on sub_1 (cost=223.93..224.68 rows=50 width=156) |
| -> Group (cost=223.93..224.18 rows=50 width=156) |
| Group Key: p.id |
| -> Sort (cost=223.93..224.05 rows=50 width=156) |
| Sort Key: p.id |
| -> Hash Right Join (cost=209.68..222.52 rows=50 width=156) |
| Hash Cond: (esosps.erp_inventory_product_id = eip.id) |
| -> Seq Scan on tbl_erp_sales_outbound_spent_products esosps (cost=0.00..10.34 rows=534 width=8) |
| -> Hash (cost=209.08..209.08 rows=48 width=160) |
| -> Hash Right Join (cost=129.46..209.08 rows=48 width=160) |
| Hash Cond: (sc.from_project = epips.project_id) |
| -> Seq Scan on tbl_sales_contracts sc (cost=0.00..68.32 rows=1732 width=4) |
| -> Hash (cost=128.86..128.86 rows=48 width=164) |
| -> Hash Join (cost=123.65..128.86 rows=48 width=164) |
| Hash Cond: (eip.product_id = p.id) |
| -> Hash Right Join (cost=24.91..29.99 rows=48 width=12) |
| Hash Cond: (epips.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_purchase_inbound_projects epips (cost=0.00..3.93 rows=193 width=8) |
| -> Hash (cost=24.31..24.31 rows=48 width=12) |
| -> Hash Left Join (cost=9.79..24.31 rows=48 width=12) |
| Hash Cond: (eip.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..14.39 rows=48 width=32) |
| Filter: (inventory > '0'::numeric) |
| -> Hash (cost=7.13..7.13 rows=213 width=4) |
| -> Seq Scan on tbl_erp_purchase_inbounds epis (cost=0.00..7.13 rows=213 width=4) |
| -> Hash (cost=72.22..72.22 rows=2122 width=156) |
| -> Seq Scan on tbl_products p (cost=0.00..72.22 rows=2122 width=156) |