explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DdJT

Settings
# exclusive inclusive rows x rows loops node
1. 0.158 9.358 ↓ 4.2 172 1

Unique (cost=3,285.77..3,286.90 rows=41 width=212) (actual time=9.178..9.358 rows=172 loops=1)

2. 0.543 9.200 ↓ 4.2 172 1

Sort (cost=3,285.77..3,285.87 rows=41 width=212) (actual time=9.177..9.200 rows=172 loops=1)

  • Sort Key: il.c_invoiceline_id, ie.productvalue, om.name, (CASE WHEN (pr.description IS NOT NULL) THEN pr.description WHEN (ch.c_charge_id > '0'::numeric) THEN COALESCE(il.descriptionserv, il.productdescription) WHEN (il.description IS NOT NULL) THEN (il.description)::character varying ELSE 'NA'::character varying END), ie.productcode, il.qtyinvoiced, ie.uomcode, (round(((il.linenetamt + (COALESCE(il.totaldiscount, '0'::numeric) * il.qtyinvoiced)) / il.qtyinvoiced), 2)), (round((il.linenetamt + (COALESCE(il.totaldiscount, '0'::numeric) * il.qtyinvoiced)), 2)), (round((il.cccmddiscount + (COALESCE(il.totaldiscount, '0'::numeric) * il.qtyinvoiced)), 2))
  • Sort Method: quicksort Memory: 62kB
3. 0.943 8.657 ↓ 4.2 172 1

Hash Left Join (cost=10.04..3,284.67 rows=41 width=212) (actual time=0.745..8.657 rows=172 loops=1)

  • Hash Cond: (iv.ad_client_id = sett.ad_client_id)
4. 0.240 7.432 ↓ 4.3 172 1

Nested Loop Left Join (cost=2.41..3,275.24 rows=40 width=209) (actual time=0.401..7.432 rows=172 loops=1)

5. 0.320 6.160 ↓ 4.3 172 1

Nested Loop Left Join (cost=2.13..3,191.56 rows=40 width=192) (actual time=0.334..6.160 rows=172 loops=1)

6. 0.255 5.840 ↓ 4.3 172 1

Nested Loop Left Join (cost=1.84..2,979.56 rows=40 width=193) (actual time=0.310..5.840 rows=172 loops=1)

7. 0.254 2.661 ↓ 4.3 172 1

Nested Loop Left Join (cost=1.42..2,646.06 rows=40 width=167) (actual time=0.249..2.661 rows=172 loops=1)

8. 0.214 1.031 ↓ 4.3 172 1

Nested Loop (cost=0.99..2,308.06 rows=40 width=140) (actual time=0.191..1.031 rows=172 loops=1)

9. 0.084 0.084 ↑ 1.0 1 1

Index Scan using c_invoice_pkey on c_invoice iv (cost=0.43..8.45 rows=1 width=13) (actual time=0.083..0.084 rows=1 loops=1)

  • Index Cond: (c_invoice_id = '13092661'::numeric)
  • Filter: (ad_org_id = '10001100'::numeric)
10. 0.733 0.733 ↓ 4.3 172 1

Index Scan using c_invoiceline_invoice on c_invoiceline il (cost=0.56..2,299.21 rows=40 width=133) (actual time=0.100..0.733 rows=172 loops=1)

  • Index Cond: (c_invoice_id = '13092661'::numeric)
  • Filter: ((ad_client_id = '10001008'::numeric) AND (round(linenetamt, 2) >= '0'::numeric))
  • Rows Removed by Filter: 1
11. 1.376 1.376 ↑ 1.0 1 172

Index Scan using invoicelineelectronic_key on exme_invoicelineelectronic ie (cost=0.43..8.45 rows=1 width=34) (actual time=0.008..0.008 rows=1 loops=172)

  • Index Cond: (c_invoiceline_id = il.c_invoiceline_id)
12. 2.924 2.924 ↑ 1.0 1 172

Index Scan using m_product_pkey on m_product pr (cost=0.42..8.34 rows=1 width=38) (actual time=0.017..0.017 rows=1 loops=172)

  • Index Cond: (m_product_id = il.m_product_id)
13. 0.000 0.000 ↓ 0.0 0 172

Index Only Scan using c_charge_pkey on c_charge ch (cost=0.28..5.30 rows=1 width=6) (actual time=0.000..0.000 rows=0 loops=172)

  • Index Cond: (c_charge_id = il.c_charge_id)
  • Heap Fetches: 0
14. 1.032 1.032 ↑ 1.0 1 172

Index Scan using uomcode_key on exme_uomcode om (cost=0.28..2.09 rows=1 width=30) (actual time=0.006..0.006 rows=1 loops=172)

  • Index Cond: (exme_uomcode_id = ie.exme_uomcode_id)
15. 0.072 0.282 ↑ 1.0 87 1

Hash (cost=6.55..6.55 rows=87 width=6) (actual time=0.281..0.282 rows=87 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
16. 0.210 0.210 ↑ 1.0 87 1

Seq Scan on exme_settingscfdi sett (cost=0.00..6.55 rows=87 width=6) (actual time=0.027..0.210 rows=87 loops=1)

  • Filter: ((isactive = 'Y'::bpchar) AND ((description)::text = 'Venta'::text))
  • Rows Removed by Filter: 83
Planning time : 51.002 ms
Execution time : 9.897 ms