explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ty5n : Optimization for: Optimization for: plan #hCjE; plan #eMej

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 5,677.007 ↓ 0.0 0 1

Limit (cost=1.71..7,297.96 rows=1 width=282) (actual time=5,677.007..5,677.007 rows=0 loops=1)

2. 0.097 5,677.006 ↓ 0.0 0 1

GroupAggregate (cost=1.71..1,765,694.12 rows=242 width=282) (actual time=5,677.006..5,677.006 rows=0 loops=1)

  • Group Key: vendor_order_fulfillments.id
  • Filter: (count(*) = 2)
  • Rows Removed by Filter: 66
3. 0.089 5,676.909 ↑ 3.7 66 1

Nested Loop (cost=1.71..1,765,689.88 rows=242 width=282) (actual time=16.347..5,676.909 rows=66 loops=1)

4. 0.000 5,676.180 ↑ 1.9 128 1

Nested Loop (cost=1.29..1,765,544.88 rows=247 width=4) (actual time=0.799..5,676.180 rows=128 loops=1)

5. 0.000 2,628.375 ↓ 1.0 1,083,903 1

Nested Loop (cost=0.85..655,755.91 rows=1,083,894 width=8) (actual time=0.008..2,628.375 rows=1,083,903 loops=1)

6. 777.449 777.449 ↑ 1.0 979,836 1

Index Scan Backward using shipments_vof_id_ship_time_shipping_carrier on shipments (cost=0.42..161,890.34 rows=979,854 width=8) (actual time=0.004..777.449 rows=979,836 loops=1)

7. 1,959.672 1,959.672 ↑ 1.0 1 979,836

Index Scan using index_shipment_basket_items_on_shipment_id on shipment_basket_items (cost=0.43..0.49 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=979,836)

  • Index Cond: (shipment_id = shipments.id)
8. 3,251.709 3,251.709 ↓ 0.0 0 1,083,903

Index Scan using basket_items_id_pkey on basket_items (cost=0.43..1.01 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=1,083,903)

  • Index Cond: (id = shipment_basket_items.basket_item_id)
  • Filter: (product_sku_id = ANY ('{20403,20188}'::integer[]))
  • Rows Removed by Filter: 1
9. 0.640 0.640 ↑ 1.0 1 128

Index Scan using vendor_order_fulfillments_id_pkey on vendor_order_fulfillments (cost=0.42..0.58 rows=1 width=282) (actual time=0.005..0.005 rows=1 loops=128)

  • Index Cond: (id = shipments.vof_id)
  • Filter: (ship_date IS NOT NULL)
  • Rows Removed by Filter: 0
Planning time : 0.679 ms
Execution time : 5,677.114 ms