explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gwvy

Settings
# exclusive inclusive rows x rows loops node
1. 0.118 1,610.222 ↑ 16.9 353 1

Nested Loop Left Join (cost=174,657.49..177,526.25 rows=5,974 width=804) (actual time=1,609.489..1,610.222 rows=353 loops=1)

2. 0.004 1,609.404 ↑ 1.0 50 1

Limit (cost=174,654.00..174,654.13 rows=50 width=660) (actual time=1,609.395..1,609.404 rows=50 loops=1)

3. 29.144 1,609.400 ↑ 974.8 50 1

Sort (cost=174,654.00..174,775.86 rows=48,742 width=660) (actual time=1,609.393..1,609.400 rows=50 loops=1)

  • Sort Key: di.tax_id
  • Sort Method: top-N heapsort Memory: 50kB
4. 44.248 1,580.256 ↓ 1.2 58,882 1

Nested Loop Left Join (cost=1.14..173,034.83 rows=48,742 width=660) (actual time=0.172..1,580.256 rows=58,882 loops=1)

5. 63.958 63.958 ↓ 1.2 58,882 1

Index Scan using i_iws_pc_src_lei_flg_newer on dist_inv_workflow_states diws (cost=0.57..45,090.25 rows=48,742 width=71) (actual time=0.097..63.958 rows=58,882 loops=1)

  • Index Cond: ((legal_entity_id = ANY ('{101,102,103,130}'::bigint[])) AND ((primary_vendor_code)::text = ANY ('{RANDO,BTDS,DENDO,ANQAB,NEWQ1,1UGLV,MHILL}'::text[])))
6. 1,472.050 1,472.050 ↑ 1.0 1 58,882

Index Scan using uniq_distributor_invoice on distributor_invoices di (cost=0.57..2.61 rows=1 width=613) (actual time=0.025..0.025 rows=1 loops=58,882)

  • 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: 1
7. 0.156 0.700 ↑ 7.9 7 50

Hash Left Join (cost=3.49..60.30 rows=55 width=160) (actual time=0.008..0.014 rows=7 loops=50)

  • Hash Cond: (attr.attribute_id = attrmetadata.attribute_id)
8. 0.500 0.500 ↑ 7.9 7 50

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

  • Index Cond: ((di.invoice_id = invoice_id) AND (diws.legal_entity_id = legal_entity_id))
9. 0.023 0.044 ↓ 1.2 106 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
10. 0.021 0.021 ↓ 1.2 106 1

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