explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aDEc

Settings
# exclusive inclusive rows x rows loops node
1. 4,816.434 575,126.842 ↑ 58.3 52,011 1

Seq Scan on m_inout (cost=0.00..3,361,210,408.51 rows=3,033,603 width=35) (actual time=536,229.850..575,126.842 rows=52,011 loops=1)

  • Filter: ((issotrx = 'Y'::bpchar) AND (SubPlan 1))
  • Rows Removed by Filter: 6015121
2.          

SubPlan (forSeq Scan)

3. 12,134.264 570,310.408 ↓ 0.0 0 6,067,132

HashAggregate (cost=553.90..554.56 rows=33 width=46) (actual time=0.094..0.094 rows=0 loops=6,067,132)

  • Filter: (((l.movementqty >= 0::numeric) AND (l.movementqty > sum(COALESCE(CASE WHEN ((i.docstatus)::text = 'CO'::text) THEN il.qtyinvoiced ELSE 0::numeric END, 0::numeric)))) OR ((l.movementqty < 0::numeric) AND (l.movementqty < sum(COALESCE(CASE WHEN ((i.docstatus)::text = 'CO'::text) THEN il.qtyinvoiced ELSE 0::numeric END, 0::numeric)))))
  • Rows Removed by Filter: 2
4. 15,904.400 558,176.144 ↑ 16.5 2 6,067,132

Nested Loop Left Join (cost=1.55..553.40 rows=33 width=46) (actual time=0.065..0.092 rows=2 loops=6,067,132)

5. 8,758.896 448,967.768 ↑ 16.5 2 6,067,132

Nested Loop Left Join (cost=1.12..420.52 rows=33 width=76) (actual time=0.055..0.074 rows=2 loops=6,067,132)

6. 115,275.508 115,275.508 ↑ 16.5 2 6,067,132

Index Scan using m_inoutline_inout on m_inoutline l (cost=0.56..137.13 rows=33 width=38) (actual time=0.018..0.019 rows=2 loops=6,067,132)

  • Index Cond: ((m_inout_id)::text = (m_inout.m_inout_id)::text)
7. 324,933.364 324,933.364 ↑ 1.0 1 11,604,763

Index Scan using c_invoiceline_inoutline on c_invoiceline il (cost=0.56..8.58 rows=1 width=71) (actual time=0.027..0.028 rows=1 loops=11,604,763)

  • Index Cond: ((l.m_inoutline_id)::text = (m_inoutline_id)::text)
8. 93,303.976 93,303.976 ↑ 1.0 1 11,662,997

Index Scan using c_invoice_key on c_invoice i (cost=0.42..4.02 rows=1 width=36) (actual time=0.008..0.008 rows=1 loops=11,662,997)

  • Index Cond: ((il.c_invoice_id)::text = (c_invoice_id)::text)