explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Egv3

Settings
# exclusive inclusive rows x rows loops node
1. 2.296 106.081 ↑ 16.8 19 1

Seq Scan on m_inout (cost=0.00..95,654.00 rows=320 width=35) (actual time=105.451..106.081 rows=19 loops=1)

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

SubPlan (forSeq Scan)

3. 15.725 103.785 ↓ 0.0 0 629

HashAggregate (cost=78.18..78.33 rows=6 width=46) (actual time=0.165..0.165 rows=0 loops=629)

  • Group Key: l.m_inoutline_id, l.movementqty
  • 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(COALE (...)
  • Rows Removed by Filter: 8
4. 6.451 88.060 ↓ 1.3 8 629

Nested Loop Left Join (cost=4.89..78.09 rows=6 width=46) (actual time=0.030..0.140 rows=8 loops=629)

5. 8.654 57.239 ↓ 1.3 8 629

Nested Loop Left Join (cost=4.61..75.77 rows=6 width=76) (actual time=0.023..0.091 rows=8 loops=629)

6. 8.806 14.467 ↓ 1.3 8 629

Bitmap Heap Scan on m_inoutline l (cost=4.33..25.91 rows=6 width=38) (actual time=0.013..0.023 rows=8 loops=629)

  • Recheck Cond: ((m_inout_id)::text = (m_inout.m_inout_id)::text)
  • Heap Blocks: exact=4795
7. 5.661 5.661 ↓ 1.3 8 629

Bitmap Index Scan on m_inoutline_inout (cost=0.00..4.33 rows=6 width=0) (actual time=0.009..0.009 rows=8 loops=629)

  • Index Cond: ((m_inout_id)::text = (m_inout.m_inout_id)::text)
8. 34.118 34.118 ↑ 1.0 1 4,874

Index Scan using c_invoiceline_inoutline on c_invoiceline il (cost=0.28..8.30 rows=1 width=71) (actual time=0.006..0.007 rows=1 loops=4,874)

  • Index Cond: ((l.m_inoutline_id)::text = (m_inoutline_id)::text)
9. 24.370 24.370 ↑ 1.0 1 4,874

Index Scan using c_invoice_key on c_invoice i (cost=0.28..0.38 rows=1 width=36) (actual time=0.005..0.005 rows=1 loops=4,874)

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