explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8pQD

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,438.42..23,118,445.43 rows=18,761,869 width=14,553) (actual rows= loops=)

  • Hash Cond: (il.c_uom_id = uom.c_uom_id)
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,408.44..22,860,439.75 rows=18,761,869 width=14,467) (actual rows= loops=)

  • Hash Cond: (il.c_charge_id = ch.c_charge_id)
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,241.41..22,788,302.19 rows=18,761,869 width=14,223) (actual rows= loops=)

  • Hash Cond: ((pr.m_product_category_id = prca.m_product_category_id) AND (i.ad_client_id = prca.ad_client_id))
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,099.03..19,009,837.47 rows=18,761,869 width=13,766) (actual rows= loops=)

  • Hash Cond: (i.c_doctype_id = dt.c_doctype_id)
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,518.33..18,751,281.08 rows=18,761,869 width=13,516) (actual rows= loops=)

  • Hash Cond: (i.ad_client_id = sch.ad_client_id)
6. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=2,511.42..18,492,372.78 rows=19,008,731 width=13,330) (actual rows= loops=)

  • Merge Cond: (pd.m_product_id = il.m_product_id)
7. 0.000 0.000 ↓ 0.0

Index Scan using m_product_pkey on m_product pd (cost=0.42..35,978.92 rows=207,665 width=2,810) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Materialize (cost=1,744.89..18,220,001.69 rows=19,008,731 width=10,520) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1,744.89..18,172,479.86 rows=19,008,731 width=10,520) (actual rows= loops=)

  • Merge Cond: (il.m_product_id = pr.m_product_id)
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.87..17,806,452.34 rows=19,008,731 width=7,710) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using c_invoiceline_product on c_invoiceline il (cost=0.44..4,949,619.30 rows=24,611,832 width=741) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using c_invoice_pkey on c_invoice i (cost=0.43..0.51 rows=1 width=6,969) (actual rows= loops=)

  • Index Cond: (c_invoice_id = il.c_invoice_id)
  • Filter: ((c_doctype_id > '0'::numeric) AND (issotrx = 'Y'::bpchar) AND (isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,VO,RE}'::bpchar[])))
13. 0.000 0.000 ↓ 0.0

Materialize (cost=0.42..36,498.08 rows=207,665 width=2,810) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using m_product_pkey on m_product pr (cost=0.42..35,978.92 rows=207,665 width=2,810) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=5.96..5.96 rows=76 width=186) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on c_acctschema sch (cost=0.00..5.96 rows=76 width=186) (actual rows= loops=)

  • Filter: (isactive = 'Y'::bpchar)
17. 0.000 0.000 ↓ 0.0

Hash (cost=459.20..459.20 rows=9,720 width=250) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on c_doctype dt (cost=0.00..459.20 rows=9,720 width=250) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=105.55..105.55 rows=2,455 width=457) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on m_product_category_acct prca (cost=0.00..105.55 rows=2,455 width=457) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=123.68..123.68 rows=3,468 width=244) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on c_charge ch (cost=0.00..123.68 rows=3,468 width=244) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash (cost=20.55..20.55 rows=755 width=86) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on c_uom uom (cost=0.00..20.55 rows=755 width=86) (actual rows= loops=)