explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M8Gg

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

Append (cost=374,723.42..2,296,327.06 rows=21,039,287 width=232) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Hash Join (cost=374,723.42..2,052,630.75 rows=20,511,910 width=176) (actual rows= loops=)

  • Hash Cond: (il.m_inout_id = io.m_inout_id)
3.          

Initplan (for Hash Join)

4. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_8 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_InOut'::text)
5. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_9 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_InOutLine'::text)
6. 0.000 0.000 ↓ 0.0

Seq Scan on m_inoutline il (cost=0.00..735,712.76 rows=20,588,776 width=24) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=287,074.02..287,074.02 rows=4,314,225 width=33) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.55..287,074.02 rows=4,314,225 width=33) (actual rows= loops=)

  • Hash Cond: (io.c_doctype_id = dt.c_doctype_id)
9. 0.000 0.000 ↓ 0.0

Seq Scan on m_inout io (cost=0.00..227,738.87 rows=4,314,225 width=32) (actual rows= loops=)

  • Filter: ((isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,RE}'::bpchar[])))
10. 0.000 0.000 ↓ 0.0

Hash (cost=12.58..12.58 rows=158 width=14) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on c_doctype dt (cost=0.00..12.58 rows=158 width=14) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=1,168.58..18,220.29 rows=263,096 width=149) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,168.58..14,931.59 rows=263,096 width=121) (actual rows= loops=)

  • Hash Cond: (ml.m_movement_id = m.m_movement_id)
14.          

Initplan (for Hash Join)

15. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_6 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_Movement'::text)
16. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_7 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_MovementLine'::text)
17. 0.000 0.000 ↓ 0.0

Seq Scan on m_movementline ml (cost=0.00..10,016.31 rows=297,531 width=25) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=958.88..958.88 rows=15,449 width=30) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.55..958.88 rows=15,449 width=30) (actual rows= loops=)

  • Hash Cond: (m.c_doctype_id = dt_1.c_doctype_id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on m_movement m (cost=0.00..731.90 rows=15,449 width=29) (actual rows= loops=)

  • Filter: ((isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,RE}'::bpchar[])))
21. 0.000 0.000 ↓ 0.0

Hash (cost=12.58..12.58 rows=158 width=14) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on c_doctype dt_1 (cost=0.00..12.58 rows=158 width=14) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=1,168.58..18,878.03 rows=263,096 width=176) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,168.58..15,589.33 rows=263,096 width=148) (actual rows= loops=)

  • Hash Cond: (ml_1.m_movement_id = m_1.m_movement_id)
25.          

Initplan (for Hash Join)

26. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_4 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_Movement'::text)
27. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_5 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_MovementLine'::text)
28. 0.000 0.000 ↓ 0.0

Seq Scan on m_movementline ml_1 (cost=0.00..10,016.31 rows=297,531 width=25) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash (cost=958.88..958.88 rows=15,449 width=30) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.55..958.88 rows=15,449 width=30) (actual rows= loops=)

  • Hash Cond: (m_1.c_doctype_id = dt_2.c_doctype_id)
31. 0.000 0.000 ↓ 0.0

Seq Scan on m_movement m_1 (cost=0.00..731.90 rows=15,449 width=29) (actual rows= loops=)

  • Filter: ((isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,RE}'::bpchar[])))
32. 0.000 0.000 ↓ 0.0

Hash (cost=12.58..12.58 rows=158 width=14) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Seq Scan on c_doctype dt_2 (cost=0.00..12.58 rows=158 width=14) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=54.51..1,421.81 rows=1,183 width=214) (actual rows= loops=)

35.          

Initplan (for Nested Loop)

36. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_2 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_Inventory'::text)
37. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_3 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_InventoryLine'::text)
38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..10.92 rows=1 width=40) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on m_inventory i (cost=0.00..2.75 rows=1 width=48) (actual rows= loops=)

  • Filter: ((isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,RE}'::bpchar[])))
40. 0.000 0.000 ↓ 0.0

Index Scan using testdoctype on c_doctype dt_3 (cost=0.14..8.16 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (c_doctype_id = i.c_doctype_id)
41. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on m_inventoryline il_1 (cost=37.78..1,331.94 rows=1,209 width=33) (actual rows= loops=)

  • Recheck Cond: (m_inventory_id = i.m_inventory_id)
42. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on m_inventoryline_productlocattr (cost=0.00..37.48 rows=1,209 width=0) (actual rows= loops=)

  • Index Cond: (m_inventory_id = i.m_inventory_id)
43. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17.02..45.23 rows=2 width=216) (actual rows= loops=)

44.          

Initplan (for Nested Loop)

45. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_Production'::text)
46. 0.000 0.000 ↓ 0.0

Index Scan using ad_table_name on ad_table ad_table_1 (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((tablename)::text = 'M_ProductionLine'::text)
47. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..27.32 rows=2 width=56) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..19.15 rows=1 width=40) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Seq Scan on m_production p (cost=0.00..10.97 rows=1 width=48) (actual rows= loops=)

  • Filter: ((isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,RE}'::bpchar[])))
50. 0.000 0.000 ↓ 0.0

Index Scan using testdoctype on c_doctype dt_4 (cost=0.14..8.16 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (c_doctype_id = p.c_doctype_id)
51. 0.000 0.000 ↓ 0.0

Index Scan using m_productionplan_production on m_productionplan pla (cost=0.14..8.16 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (m_production_id = p.m_production_id)
52. 0.000 0.000 ↓ 0.0

Index Scan using m_productionline_prodplan on m_productionline pl (cost=0.14..0.65 rows=1 width=80) (actual rows= loops=)

  • Index Cond: (m_productionplan_id = pla.m_productionplan_id)