explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Sc

Settings
# exclusive inclusive rows x rows loops node
1. 0.138 11.408 ↓ 2.2 172 1

Unique (cost=2,318.55..2,320.70 rows=78 width=212) (actual time=11.251..11.408 rows=172 loops=1)

2. 0.412 11.270 ↓ 2.2 172 1

Sort (cost=2,318.55..2,318.75 rows=78 width=212) (actual time=11.250..11.270 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.535 10.858 ↓ 2.2 172 1

Nested Loop (cost=870.12..2,316.10 rows=78 width=212) (actual time=6.906..10.858 rows=172 loops=1)

4. 0.062 0.280 ↑ 1.0 1 1

Hash Right Join (cost=8.46..15.25 rows=1 width=6) (actual time=0.186..0.280 rows=1 loops=1)

  • Hash Cond: (sett.ad_client_id = iv.ad_client_id)
5. 0.160 0.160 ↑ 1.0 87 1

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

  • Filter: ((isactive = 'Y'::bpchar) AND ((description)::text = 'Venta'::text))
  • Rows Removed by Filter: 83
6. 0.011 0.058 ↑ 1.0 1 1

Hash (cost=8.45..8.45 rows=1 width=13) (actual time=0.057..0.058 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.047 0.047 ↑ 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.045..0.047 rows=1 loops=1)

  • Index Cond: (c_invoice_id = '13092661'::numeric)
  • Filter: (ad_org_id = '10001100'::numeric)
8. 0.267 10.043 ↓ 2.3 172 1

Hash Left Join (cost=861.65..2,297.95 rows=76 width=202) (actual time=6.703..10.043 rows=172 loops=1)

  • Hash Cond: (ie.exme_uomcode_id = om.exme_uomcode_id)
9. 0.269 6.852 ↓ 2.3 172 1

Nested Loop Left Join (cost=754.23..2,190.32 rows=76 width=185) (actual time=3.741..6.852 rows=172 loops=1)

10. 0.260 5.035 ↓ 2.3 172 1

Nested Loop Left Join (cost=753.81..1,565.07 rows=76 width=158) (actual time=3.694..5.035 rows=172 loops=1)

11. 1.496 3.743 ↓ 2.3 172 1

Hash Right Join (cost=753.37..922.87 rows=76 width=131) (actual time=3.656..3.743 rows=172 loops=1)

  • Hash Cond: (ch.c_charge_id = il.c_charge_id)
12. 1.587 1.587 ↑ 1.0 4,417 1

Seq Scan on c_charge ch (cost=0.00..152.17 rows=4,417 width=6) (actual time=0.013..1.587 rows=4,417 loops=1)

13. 0.140 0.660 ↓ 2.3 172 1

Hash (cost=752.42..752.42 rows=76 width=132) (actual time=0.660..0.660 rows=172 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
14. 0.030 0.520 ↓ 2.3 172 1

Append (cost=0.43..752.42 rows=76 width=132) (actual time=0.067..0.520 rows=172 loops=1)

15. 0.490 0.490 ↓ 2.3 172 1

Index Scan using c_invoiceline_10001008_c_invoice_id_idx on c_invoiceline_10001008 il (cost=0.43..752.04 rows=76 width=132) (actual time=0.066..0.490 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
16. 1.032 1.032 ↑ 1.0 1 172

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

  • Index Cond: (c_invoiceline_id = il.c_invoiceline_id)
17. 1.548 1.548 ↑ 1.0 1 172

Index Scan using m_product_pkey on m_product pr (cost=0.42..8.23 rows=1 width=39) (actual time=0.009..0.009 rows=1 loops=172)

  • Index Cond: (m_product_id = il.m_product_id)
18. 1.543 2.924 ↑ 1.0 2,419 1

Hash (cost=77.19..77.19 rows=2,419 width=30) (actual time=2.924..2.924 rows=2,419 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 182kB
19. 1.381 1.381 ↑ 1.0 2,419 1

Seq Scan on exme_uomcode om (cost=0.00..77.19 rows=2,419 width=30) (actual time=0.013..1.381 rows=2,419 loops=1)