explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Zql9

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 14,219.670 ↓ 0.0 0 1

Limit (cost=54,616.76..54,616.77 rows=1 width=200) (actual time=14,219.670..14,219.670 rows=0 loops=1)

2. 0.016 14,219.670 ↓ 0.0 0 1

Sort (cost=54,616.76..54,616.77 rows=1 width=200) (actual time=14,219.670..14,219.670 rows=0 loops=1)

  • Sort Key: il.created DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.001 14,219.654 ↓ 0.0 0 1

Nested Loop Left Join (cost=634.03..54,616.75 rows=1 width=200) (actual time=14,219.654..14,219.654 rows=0 loops=1)

  • Join Filter: (bp.c_bpartner_id = i.c_bpartner_id)
4. 0.000 14,219.653 ↓ 0.0 0 1

Nested Loop (cost=633.75..54,582.77 rows=1 width=184) (actual time=14,219.653..14,219.653 rows=0 loops=1)

  • Join Filter: (il.c_uom_id = u.c_uom_id)
5. 0.001 14,219.653 ↓ 0.0 0 1

Nested Loop (cost=633.75..54,581.32 rows=1 width=146) (actual time=14,219.653..14,219.653 rows=0 loops=1)

6. 2.535 14,219.652 ↓ 0.0 0 1

Nested Loop (cost=633.47..54,573.01 rows=1 width=118) (actual time=14,219.652..14,219.652 rows=0 loops=1)

  • Join Filter: (il.c_invoice_id = i.c_invoice_id)
  • Rows Removed by Join Filter: 19,800
7. 0.284 37.677 ↓ 110.0 110 1

Nested Loop (cost=126.97..10,734.03 rows=1 width=86) (actual time=37.382..37.677 rows=110 loops=1)

  • Join Filter: (i.c_doctype_id = dt.c_doctype_id)
  • Rows Removed by Join Filter: 665
8. 0.038 0.038 ↑ 1.0 5 1

Seq Scan on c_doctype dt (cost=0.00..4.60 rows=5 width=6) (actual time=0.010..0.038 rows=5 loops=1)

  • Filter: (docbasetype = 'API'::bpchar)
  • Rows Removed by Filter: 123
9. 0.154 37.355 ↓ 77.5 155 5

Materialize (cost=126.97..10,729.29 rows=2 width=92) (actual time=0.170..7.471 rows=155 loops=5)

10. 17.159 37.201 ↓ 77.5 155 1

Hash Right Join (cost=126.97..10,729.28 rows=2 width=92) (actual time=0.845..37.201 rows=155 loops=1)

  • Hash Cond: (io.c_invoice_id = i.c_invoice_id)
11. 19.248 19.248 ↑ 1.0 211,913 1

Seq Scan on m_inout io (cost=0.00..9,788.67 rows=216,967 width=21) (actual time=0.004..19.248 rows=211,913 loops=1)

12. 0.794 0.794 ↓ 77.5 155 1

Hash (cost=126.95..126.95 rows=2 width=86) (actual time=0.794..0.794 rows=155 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
  • -> Index Scan using c_invoice_documentno_target on c_invoice i (cost=0.42..126.95 rows=2 width=86) (actual time=0.026..0.744 rows=155 loops=1) Index Cond: (c_bpartner_id = '1000007'::numeric)
  • Filter: ((ad_client_id = '1000000'::numeric) AND (issotrx = 'N'::bpchar) AND (docstatus = ANY ('{CO,CL,IP}'::bpchar[])))
  • Rows Removed by Filter: 15
13. 6,719.365 14,179.440 ↓ 1.4 180 110

Hash Right Join (cost=506.50..43,837.34 rows=131 width=48) (actual time=8.911..128.904 rows=180 loops=110)

  • Hash Cond: (c.c_invoiceline_id = il.c_invoiceline_id)
14. 7,459.760 7,459.760 ↓ 1.0 1,234,332 110

Seq Scan on m_costdetail c (cost=0.00..38,783.67 rows=1,212,567 width=7) (actual time=0.002..67.816 rows=1,234,332 loops=110)

15. 0.049 0.315 ↓ 1.4 180 1

Hash (cost=504.86..504.86 rows=131 width=56) (actual time=0.315..0.315 rows=180 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
16. 0.226 0.266 ↓ 1.4 180 1

Bitmap Heap Scan on c_invoiceline il (cost=5.44..504.86 rows=131 width=56) (actual time=0.059..0.266 rows=180 loops=1)

  • Recheck Cond: (m_product_id = '1004201'::numeric)
  • Heap Blocks: exact=175
17. 0.040 0.040 ↓ 1.4 180 1

Bitmap Index Scan on c_invoiceline_product (cost=0.00..5.41 rows=131 width=0) (actual time=0.040..0.040 rows=180 loops=1)

  • Index Cond: (m_product_id = '1004201'::numeric)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using m_product_pkey on m_product p (cost=0.28..8.30 rows=1 width=34) (never executed)

  • Index Cond: (m_product_id = '1004201'::numeric)
19. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_uom u (cost=0.00..1.20 rows=20 width=54) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp (cost=0.27..8.29 rows=1 width=27) (never executed)

  • Index Cond: (c_bpartner_id = '1000007'::numeric)
21.          

SubPlan (for Nested Loop Left Join)

22. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=24.89..24.90 rows=1 width=32) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.00..24.89 rows=1 width=32) (never executed)

  • Join Filter: (cl.c_invoiceline_id = lc.c_invoiceline_id)
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_landedcostallocation cl (cost=0.00..13.50 rows=1 width=48) (never executed)

  • Filter: (m_product_id = p.m_product_id)
25. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_landedcost lc (cost=0.00..11.38 rows=1 width=16) (never executed)

  • Filter: (m_inout_id = io.m_inout_id)