explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vhMO

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 3,152.337 ↑ 108.6 55 1

Nested Loop Left Join (cost=4.62..7,511.08 rows=5,974 width=804) (actual time=3,151.069..3,152.337 rows=55 loops=1)

2. 0.008 3,152.155 ↑ 1.0 50 1

Limit (cost=1.14..4,638.95 rows=50 width=660) (actual time=3,151.058..3,152.155 rows=50 loops=1)

3. 0.054 3,152.147 ↑ 974.8 50 1

Nested Loop Left Join (cost=1.14..4,521,132.70 rows=48,742 width=660) (actual time=3,151.056..3,152.147 rows=50 loops=1)

4. 3,151.043 3,151.043 ↑ 974.8 50 1

Index Scan using i_iws_pc_src_lei_flg_newer on dist_inv_workflow_states diws (cost=0.57..4,393,188.12 rows=48,742 width=71) (actual time=3,151.010..3,151.043 rows=50 loops=1)

  • Index Cond: (legal_entity_id = ANY ('{101,102,103,130}'::bigint[]))
  • Filter: ((primary_vendor_code)::text = ANY ('{RANDO,BTDS,DENDO,ANQAB,NEWQ1,1UGLV,MHILL}'::text[]))
  • Rows Removed by Filter: 4585041
5. 1.050 1.050 ↑ 1.0 1 50

Index Scan using uniq_distributor_invoice on distributor_invoices di (cost=0.57..2.61 rows=1 width=613) (actual time=0.015..0.021 rows=1 loops=50)

  • Index Cond: (((diws.vendor_invoice_number)::text = (vendor_invoice_number)::text) AND (diws.legal_entity_id = legal_entity_id))
  • Filter: ((diws.primary_vendor_code)::text = btrim((primary_vendor_code)::text))
  • Rows Removed by Filter: 6
6. 0.010 0.150 ↓ 0.0 0 50

Hash Left Join (cost=3.49..60.30 rows=55 width=160) (actual time=0.003..0.003 rows=0 loops=50)

  • Hash Cond: (attr.attribute_id = attrmetadata.attribute_id)
7. 0.100 0.100 ↓ 0.0 0 50

Index Scan using pk_attribute on invoice_attributes attr (cost=0.57..56.63 rows=55 width=130) (actual time=0.002..0.002 rows=0 loops=50)

  • Index Cond: ((di.invoice_id = invoice_id) AND (diws.legal_entity_id = legal_entity_id))
8. 0.021 0.040 ↓ 1.2 106 1

Hash (cost=1.85..1.85 rows=85 width=38) (actual time=0.040..0.040 rows=106 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
9. 0.019 0.019 ↓ 1.2 106 1

Seq Scan on invoice_attributes_metadata attrmetadata (cost=0.00..1.85 rows=85 width=38) (actual time=0.007..0.019 rows=106 loops=1)

Planning time : 1.041 ms