explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hCjE

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.002 540.058 ↑ 1.0 1 1

Limit (cost=1.28..1,303.94 rows=1 width=360) (actual time=540.057..540.058 rows=1 loops=1)

2. 0.021 540.056 ↑ 881.0 1 1

GroupAggregate (cost=1.28..1,147,643.04 rows=881 width=360) (actual time=540.056..540.056 rows=1 loops=1)

  • Group Key: shipments.id
  • Filter: (count(*) = 1)
3. 0.046 540.035 ↑ 440.5 2 1

Nested Loop (cost=1.28..1,147,627.62 rows=881 width=360) (actual time=526.853..540.035 rows=2 loops=1)

4. 1.052 530.775 ↑ 52.8 17 1

Nested Loop (cost=0.86..1,147,092.04 rows=897 width=4) (actual time=2.561..530.775 rows=17 loops=1)

5. 16.677 16.677 ↑ 300.0 3,613 1

Index Scan Backward using index_shipment_basket_items_on_shipment_id on shipment_basket_items (cost=0.43..37,303.07 rows=1,083,894 width=8) (actual time=0.003..16.677 rows=3,613 loops=1)

6. 513.046 513.046 ↓ 0.0 0 3,613

Index Scan using basket_items_id_pkey on basket_items (cost=0.43..1.01 rows=1 width=4) (actual time=0.142..0.142 rows=0 loops=3,613)

  • Index Cond: (id = shipment_basket_items.basket_item_id)
  • Filter: ((NOT removed) AND (product_sku_id = 17582))
  • Rows Removed by Filter: 1
7. 9.214 9.214 ↓ 0.0 0 17

Index Scan using shipments_id_pkey on shipments (cost=0.42..0.59 rows=1 width=360) (actual time=0.542..0.542 rows=0 loops=17)

  • Index Cond: (id = shipment_basket_items.shipment_id)
  • Filter: (recognize_revenue_at IS NOT NULL)
  • Rows Removed by Filter: 1
Planning time : 34.245 ms
Execution time : 540.171 ms