explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eUeY

Settings
# exclusive inclusive rows x rows loops node
1. 13,862.191 172,279.784 ↓ 514.0 514 1

Nested Loop Left Join (cost=10.87..1,955.32 rows=1 width=73) (actual time=5,746.607..172,279.784 rows=514 loops=1)

  • Filter: ((di.purchase_order_number = ''LAS44263ST''::text) OR (po.name = ''LAS44263ST''::text))
  • Rows Removed by Filter: 1884276
2. 21,823.632 145,224.063 ↓ 6,220.4 1,884,790 1

Nested Loop Left Join (cost=10.45..1,810.17 rows=303 width=90) (actual time=0.288..145,224.063 rows=1,884,790 loops=1)

3. 20,441.824 102,667.741 ↓ 6,220.4 1,884,790 1

Nested Loop Left Join (cost=10.02..1,665.48 rows=303 width=89) (actual time=0.275..102,667.741 rows=1,884,790 loops=1)

4. 22,892.333 67,325.837 ↓ 6,146.9 1,862,510 1

Nested Loop Left Join (cost=9.59..938.47 rows=303 width=81) (actual time=0.201..67,325.837 rows=1,862,510 loops=1)

5. 11,804.944 22,475.820 ↓ 6,039.0 1,829,807 1

Nested Loop (cost=9.16..662.30 rows=303 width=73) (actual time=0.176..22,475.820 rows=1,829,807 loops=1)

6. 766.020 1,231.757 ↓ 3,803.0 129,303 1

Nested Loop (cost=8.72..225.56 rows=34 width=8) (actual time=0.111..1,231.757 rows=129,303 loops=1)

7. 0.590 1.001 ↓ 47.0 47 1

Hash Join (cost=8.30..10.50 rows=1 width=12) (actual time=0.078..1.001 rows=47 loops=1)

  • Hash Cond: (s.managed_facility_id = d.managed_facility_id)
8. 0.367 0.367 ↓ 1.0 90 1

Seq Scan on sectors s (cost=0.00..1.86 rows=86 width=16) (actual time=0.009..0.367 rows=90 loops=1)

9. 0.011 0.044 ↑ 1.0 1 1

Hash (cost=8.29..8.29 rows=1 width=8) (actual time=0.044..0.044 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.033 0.033 ↑ 1.0 1 1

Index Scan using distributors_pkey on distributors d (cost=0.28..8.29 rows=1 width=8) (actual time=0.030..0.033 rows=1 loops=1)

  • Index Cond: (id = 50)
11. 464.736 464.736 ↓ 1.3 2,751 47

Index Scan using inventory_locations_sector_id_index on inventory_locations il (cost=0.42..193.66 rows=2,140 width=12) (actual time=0.023..9.888 rows=2,751 loops=47)

  • Index Cond: (sector_id = s.id)
12. 9,439.119 9,439.119 ↑ 6.1 14 129,303

Index Scan using unique_skus_inventory_location_id_idx on unique_skus (cost=0.43..12.00 rows=85 width=73) (actual time=0.011..0.073 rows=14 loops=129,303)

  • Index Cond: (inventory_location_id = il.id)
  • Filter: ((distributor_id = 50) AND (inventory_status_id = ANY (''{1,2,3,4,5,6,7,8,9,10,11,12,13}''::smallint[])))
  • Rows Removed by Filter: 3
13. 21,957.684 21,957.684 ↑ 8.0 1 1,829,807

Index Scan using idx_dili_unique_sku_id on distributor_invoice_line_items dili (cost=0.43..0.83 rows=8 width=16) (actual time=0.009..0.012 rows=1 loops=1,829,807)

  • Index Cond: (unique_sku_id = unique_skus.id)
14. 14,900.080 14,900.080 ↓ 0.0 0 1,862,510

Index Scan using idx_vendor_items_unique_sku_id on vendor_items vi (cost=0.43..1.78 rows=62 width=16) (actual time=0.007..0.008 rows=0 loops=1,862,510)

  • Index Cond: (unique_sku_id = unique_skus.id)
15. 20,732.690 20,732.690 ↑ 1.0 1 1,884,790

Index Scan using distributor_invoices_pkey on distributor_invoices di (cost=0.43..0.47 rows=1 width=17) (actual time=0.008..0.011 rows=1 loops=1,884,790)

  • Index Cond: (dili.distributor_invoice_id = id)
16. 13,193.530 13,193.530 ↓ 0.0 0 1,884,790

Index Scan using purchase_orders_pkey on purchase_orders po (cost=0.43..0.46 rows=1 width=17) (actual time=0.005..0.007 rows=0 loops=1,884,790)

  • Index Cond: (vi.purchase_order_id = id)