explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ie9cd

Settings
# exclusive inclusive rows x rows loops node
1. 8,351.798 11,765.664 ↑ 12,142,857.1 21 1

Subquery Scan on subquery2 (cost=2,441.09..1,372,689.33 rows=255,000,000 width=195) (actual time=937.717..11,765.664 rows=21 loops=1)

2. 3,386.577 3,413.866 ↑ 12,142.9 21 1

HashAggregate (cost=2,441.09..3,976.83 rows=255,000 width=103) (actual time=329.243..3,413.866 rows=21 loops=1)

  • Group Key: res_partner.name, ews_mrp_job_orders.name, sale_order.material_description
  • Filter: ((sum((COALESCE((sum(shipping_outbound_detail.ship_qty)), '0'::bigint))) > '0'::numeric) AND ((sum((COALESCE(ews_mrp_release_orders.release_qty, 0))))::numeric <> sum((COALESCE((sum(shipping_outbound_detail.ship_qty)), '0'::bigint)))))
  • Rows Removed by Filter: 97
3. 0.591 27.289 ↓ 1.2 308 1

Sort (cost=2,430.89..2,431.53 rows=255 width=103) (actual time=27.256..27.289 rows=308 loops=1)

  • Sort Key: res_partner.name, ews_mrp_job_orders.name
  • Sort Method: quicksort Memory: 68kB
4. 0.214 26.698 ↓ 1.2 308 1

Nested Loop (cost=2,156.73..2,420.70 rows=255 width=103) (actual time=24.163..26.698 rows=308 loops=1)

5. 0.600 25.560 ↓ 1.2 308 1

Hash Right Join (cost=2,156.45..2,286.04 rows=257 width=107) (actual time=24.145..25.560 rows=308 loops=1)

  • Hash Cond: (shipping_outbound_detail.detail_id = ews_mrp_release_orders.id)
6. 4.692 21.007 ↑ 1.0 5,314 1

HashAggregate (cost=1,434.88..1,488.66 rows=5,378 width=8) (actual time=20.163..21.007 rows=5,314 loops=1)

  • Group Key: shipping_outbound_detail.detail_id
7. 5.694 16.315 ↓ 1.1 17,109 1

Hash Join (cost=707.55..1,360.34 rows=14,907 width=8) (actual time=8.406..16.315 rows=17,109 loops=1)

  • Hash Cond: (shipping_outbound_detail.outbound_id = shipping_outbound.id)
8. 2.248 2.248 ↑ 1.0 18,016 1

Seq Scan on shipping_outbound_detail (cost=0.00..436.16 rows=18,016 width=12) (actual time=0.004..2.248 rows=18,016 loops=1)

9. 1.657 8.373 ↓ 1.1 10,968 1

Hash (cost=586.12..586.12 rows=9,715 width=4) (actual time=8.373..8.373 rows=10,968 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 514kB
10. 6.716 6.716 ↓ 1.1 10,968 1

Seq Scan on shipping_outbound (cost=0.00..586.12 rows=9,715 width=4) (actual time=0.004..6.716 rows=10,968 loops=1)

  • Filter: (active AND ((state)::text = ANY ('{pos,pod}'::text[])) AND (pos_datetime <= '2020-07-06 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 773
11. 0.122 3.953 ↓ 1.2 308 1

Hash (cost=718.36..718.36 rows=257 width=103) (actual time=3.953..3.953 rows=308 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 44kB
12. 0.035 3.831 ↓ 1.2 308 1

Nested Loop (cost=220.35..718.36 rows=257 width=103) (actual time=2.201..3.831 rows=308 loops=1)

13. 0.147 3.016 ↓ 1.0 130 1

Nested Loop Left Join (cost=220.06..438.15 rows=129 width=87) (actual time=2.190..3.016 rows=130 loops=1)

14. 0.019 2.479 ↓ 1.0 130 1

Nested Loop (cost=219.78..243.84 rows=129 width=62) (actual time=2.182..2.479 rows=130 loops=1)

15. 0.011 0.011 ↑ 1.0 1 1

Index Scan using res_partner_pkey on res_partner (cost=0.29..2.30 rows=1 width=21) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: (id = 5,628)
  • Filter: is_weld
16. 0.091 2.449 ↓ 1.0 130 1

Hash Right Join (cost=219.49..240.24 rows=129 width=49) (actual time=2.170..2.449 rows=130 loops=1)

  • Hash Cond: (shipping_inbound_request.job_id = ews_mrp_job_orders.id)
17. 1.669 2.147 ↓ 1.0 774 1

HashAggregate (cost=137.41..147.08 rows=773 width=10) (actual time=1.943..2.147 rows=774 loops=1)

  • Group Key: shipping_inbound_request.job_id
18. 0.478 0.478 ↑ 1.0 3,161 1

Seq Scan on shipping_inbound_request (cost=0.00..121.61 rows=3,161 width=10) (actual time=0.003..0.478 rows=3,161 loops=1)

19. 0.023 0.211 ↓ 1.0 130 1

Hash (cost=80.47..80.47 rows=129 width=17) (actual time=0.211..0.211 rows=130 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
20. 0.188 0.188 ↓ 1.0 130 1

Index Scan using ews_mrp_job_orders_weld_location_id_index on ews_mrp_job_orders (cost=0.28..80.47 rows=129 width=17) (actual time=0.027..0.188 rows=130 loops=1)

  • Index Cond: (weld_location_id = 5,628)
  • Filter: (((NOT continuous_improvement) OR (continuous_improvement IS NULL)) AND (create_date <= '2020-07-06 00:00:00'::timestamp without time zone))
21. 0.390 0.390 ↑ 1.0 1 130

Index Scan using sale_order_pkey on sale_order (cost=0.29..1.50 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=130)

  • Index Cond: (id = ews_mrp_job_orders.sale_id)
22. 0.780 0.780 ↑ 1.0 2 130

Index Scan using index_ews_mrp_release_orders_release_order_id on ews_mrp_release_orders (cost=0.28..2.15 rows=2 width=28) (actual time=0.004..0.006 rows=2 loops=130)

  • Index Cond: (release_order_id = ews_mrp_job_orders.id)
  • Filter: (active AND (NOT obsolete) AND ((original_detail_code)::text = ANY ('{4,6,8}'::text[])))
  • Rows Removed by Filter: 1
23. 0.924 0.924 ↑ 1.0 1 308

Index Scan using mrp_bom_pkey on mrp_bom (cost=0.29..0.51 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=308)

  • Index Cond: (id = ews_mrp_release_orders.bom_id)
  • Filter: ((bom_type)::text = '1'::text)
Planning time : 2.841 ms
Execution time : 11,766.039 ms