explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Abm1

Settings
# exclusive inclusive rows x rows loops node
1. 7.094 587.697 ↓ 23.4 514 1

Nested Loop (cost=86,249.66..86,844.14 rows=22 width=73) (actual time=570.023..587.697 rows=514 loops=1)

2.          

CTE order_invoice_unique_skus

3. 3.531 571.815 ↓ 8.0 560 1

HashAggregate (cost=86,248.53..86,249.23 rows=70 width=8) (actual time=569.973..571.815 rows=560 loops=1)

  • Group Key: vi.unique_sku_id
4. 3.214 568.284 ↓ 8.0 560 1

Append (cost=0.43..86,248.36 rows=70 width=8) (actual time=163.859..568.284 rows=560 loops=1)

5. 0.027 163.748 ↓ 0.0 0 1

Nested Loop (cost=0.43..32,180.26 rows=3 width=8) (actual time=163.748..163.748 rows=0 loops=1)

6. 163.703 163.703 ↑ 1.0 1 1

Seq Scan on purchase_orders po (cost=0.00..31,584.22 rows=1 width=8) (actual time=31.207..163.703 rows=1 loops=1)

  • Filter: (name = 'LAS44263ST'::text)
  • Rows Removed by Filter: 1228988
7. 0.018 0.018 ↓ 0.0 0 1

Index Scan using idx_vendor_items_purchase_order_id on vendor_items vi (cost=0.43..593.56 rows=248 width=16) (actual time=0.018..0.018 rows=0 loops=1)

  • Index Cond: (purchase_order_id = po.id)
8. 3.706 401.322 ↓ 8.4 560 1

Nested Loop (cost=0.43..54,067.39 rows=67 width=8) (actual time=0.101..401.322 rows=560 loops=1)

9. 395.757 395.757 ↑ 1.2 13 1

Seq Scan on distributor_invoices di (cost=0.00..53,849.98 rows=15 width=8) (actual time=0.071..395.757 rows=13 loops=1)

  • Filter: (purchase_order_number = 'LAS44263ST'::text)
  • Rows Removed by Filter: 1548625
10. 1.859 1.859 ↓ 1.6 43 13

Index Scan using fki_dili_distributor_invoice_id on distributor_invoice_line_items dili (cost=0.43..14.22 rows=27 width=16) (actual time=0.008..0.143 rows=43 loops=13)

  • Index Cond: (distributor_invoice_id = di.id)
11. 575.563 575.563 ↓ 8.0 560 1

CTE Scan on order_invoice_unique_skus oius (cost=0.00..1.40 rows=70 width=8) (actual time=569.982..575.563 rows=560 loops=1)

12. 5.040 5.040 ↑ 1.0 1 560

Index Scan using unique_skus_pkey on unique_skus (cost=0.43..8.47 rows=1 width=73) (actual time=0.006..0.009 rows=1 loops=560)

  • Index Cond: (id = oius.unique_sku_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: 0