explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o8ba

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 66,593.662 ↑ 1.0 2 1

Limit (cost=4,743.87..4,743.89 rows=2 width=242) (actual time=66,593.661..66,593.662 rows=2 loops=1)

2. 1,202.185 66,593.661 ↑ 1,517.0 2 1

HashAggregate (cost=4,743.87..4,774.21 rows=3,034 width=242) (actual time=66,593.660..66,593.661 rows=2 loops=1)

3. 2,634.175 65,391.476 ↓ 217.3 659,352 1

Hash Join (cost=847.42..4,660.43 rows=3,034 width=242) (actual time=144.269..65,391.476 rows=659,352 loops=1)

  • Hash Cond: ((invline.c_invoice_id)::text = (disp.c_invoice_id)::text)
4. 60,997.235 62,756.872 ↓ 191.9 14,617,296 1

Merge Join (cost=826.79..4,323.89 rows=76,183 width=157) (actual time=143.814..62,756.872 rows=14,617,296 loops=1)

  • Merge Cond: ((orglegal.ad_org_id)::text = (org.ad_legalentity_org_id)::text)
5. 30.615 48.147 ↑ 1.0 159,361 1

Nested Loop (cost=0.42..2,269.28 rows=162,929 width=58) (actual time=0.026..48.147 rows=159,361 loops=1)

6. 0.198 0.198 ↑ 1.0 81 1

Index Scan using ad_org_key on ad_org orglegal (cost=0.14..31.50 rows=83 width=50) (actual time=0.010..0.198 rows=81 loops=1)

7. 16.627 17.334 ↓ 1.0 1,967 81

Materialize (cost=0.28..206.08 rows=1,963 width=8) (actual time=0.000..0.214 rows=1,967 loops=81)

8. 0.707 0.707 ↓ 1.0 1,992 1

Index Only Scan using c_order_dateordered_id on c_order ord (cost=0.28..196.27 rows=1,963 width=8) (actual time=0.011..0.707 rows=1,992 loops=1)

  • Heap Fetches: 117
9. 1,622.166 1,711.490 ↓ 347,983.5 14,615,305 1

Sort (cost=565.27..565.38 rows=42 width=164) (actual time=134.730..1,711.490 rows=14,615,305 loops=1)

  • Sort Key: org.ad_legalentity_org_id
  • Sort Method: quicksort Memory: 2142kB
10. 7.001 89.324 ↓ 174.7 7,338 1

Nested Loop (cost=36.98..564.14 rows=42 width=164) (actual time=0.563..89.324 rows=7,338 loops=1)

11. 1.365 42.552 ↓ 122.8 1,473 1

Hash Join (cost=32.99..336.97 rows=12 width=126) (actual time=0.502..42.552 rows=1,473 loops=1)

  • Hash Cond: ((inv.c_doctype_id)::text = (doc.c_doctype_id)::text)
12. 2.277 40.868 ↓ 122.8 1,473 1

Nested Loop (cost=8.42..312.23 rows=12 width=158) (actual time=0.175..40.868 rows=1,473 loops=1)

  • Join Filter: ((inv.c_bpartner_id)::text = (bp.c_bpartner_id)::text)
13. 1.275 22.388 ↓ 122.8 1,473 1

Nested Loop (cost=8.14..304.26 rows=12 width=206) (actual time=0.154..22.388 rows=1,473 loops=1)

14. 1.689 3.737 ↓ 120.7 1,448 1

Hash Join (cost=7.87..220.57 rows=12 width=173) (actual time=0.124..3.737 rows=1,448 loops=1)

  • Hash Cond: ((inv.ad_org_id)::text = (org.ad_org_id)::text)
15. 1.937 1.937 ↓ 120.7 1,448 1

Seq Scan on c_invoice inv (cost=0.00..212.54 rows=12 width=154) (actual time=0.006..1.937 rows=1,448 loops=1)

  • Filter: ((c_order_id)::text = (c_order_id)::text)
  • Rows Removed by Filter: 825
16. 0.044 0.111 ↑ 1.0 83 1

Hash (cost=6.83..6.83 rows=83 width=84) (actual time=0.111..0.111 rows=83 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 0.067 0.067 ↑ 1.0 83 1

Seq Scan on ad_org org (cost=0.00..6.83 rows=83 width=84) (actual time=0.003..0.067 rows=83 loops=1)

18. 17.376 17.376 ↑ 1.0 1 1,448

Index Only Scan using c_bplocation_bpartner on c_bpartner_location bpl (cost=0.28..6.96 rows=1 width=33) (actual time=0.011..0.012 rows=1 loops=1,448)

  • Index Cond: (c_bpartner_id = (inv.c_bpartner_id)::text)
  • Heap Fetches: 1473
19. 16.203 16.203 ↑ 1.0 1 1,473

Index Scan using c_bpartner_key on c_bpartner bp (cost=0.28..0.65 rows=1 width=51) (actual time=0.011..0.011 rows=1 loops=1,473)

  • Index Cond: ((c_bpartner_id)::text = (bpl.c_bpartner_id)::text)
20. 0.187 0.319 ↑ 1.0 381 1

Hash (cost=19.81..19.81 rows=381 width=32) (actual time=0.319..0.319 rows=381 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
21. 0.132 0.132 ↑ 1.0 381 1

Seq Scan on c_doctype doc (cost=0.00..19.81 rows=381 width=32) (actual time=0.004..0.132 rows=381 loops=1)

22. 11.784 39.771 ↓ 1.2 5 1,473

Bitmap Heap Scan on c_invoiceline invline (cost=3.98..18.89 rows=4 width=38) (actual time=0.022..0.027 rows=5 loops=1,473)

  • Recheck Cond: ((c_invoice_id)::text = (inv.c_invoice_id)::text)
23. 27.987 27.987 ↓ 1.2 5 1,473

Bitmap Index Scan on c_invoiceline_invoice (cost=0.00..3.98 rows=4 width=0) (actual time=0.019..0.019 rows=5 loops=1,473)

  • Index Cond: ((c_invoice_id)::text = (inv.c_invoice_id)::text)
24. 0.076 0.429 ↓ 1.6 143 1

Hash (cost=19.50..19.50 rows=90 width=184) (actual time=0.429..0.429 rows=143 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
25. 0.142 0.353 ↓ 1.6 143 1

Hash Join (cost=1.11..19.50 rows=90 width=184) (actual time=0.036..0.353 rows=143 loops=1)

  • Hash Cond: ((disp.m_shipper_id)::text = (assignto.m_shipper_id)::text)
26. 0.198 0.198 ↑ 1.0 144 1

Seq Scan on mdsp_dispatch disp (cost=0.00..16.95 rows=144 width=79) (actual time=0.015..0.198 rows=144 loops=1)

  • Filter: (isdispatchconfirm = 'Y'::bpchar)
  • Rows Removed by Filter: 92
27. 0.005 0.013 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=220) (actual time=0.013..0.013 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
28. 0.008 0.008 ↑ 1.0 5 1

Seq Scan on m_shipper assignto (cost=0.00..1.05 rows=5 width=220) (actual time=0.004..0.008 rows=5 loops=1)