explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iJCw

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=150,565.10..150,565.11 rows=1 width=445) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=150,565.10..150,565.11 rows=1 width=445) (actual rows= loops=)

  • Sort Key: shipping_package.date_created DESC
3. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=134,955.32..150,565.09 rows=1 width=445) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=134,954.89..150,564.26 rows=1 width=445) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=134,954.47..150,563.58 rows=1 width=282) (actual rows= loops=)

  • Join Filter: (shipping_shipment.shipping_option_id = shipping_shippingoption.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=134,954.47..150,562.36 rows=1 width=282) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=134,954.04..150,561.84 rows=1 width=200) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=134,953.62..150,560.98 rows=1 width=58) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

HashAggregate (cost=134,953.19..134,953.20 rows=1 width=8) (actual rows= loops=)

  • Group Key: u0.package_id
10. 0.000 0.000 ↓ 0.0

Gather (cost=15,828.88..134,953.19 rows=1 width=8) (actual rows= loops=)

  • Workers Planned: 2
11. 0.000 0.000 ↓ 0.0

Parallel Hash Left Join (cost=14,828.88..133,953.09 rows=1 width=8) (actual rows= loops=)

  • Hash Cond: (u0.id = u2.purchase_item_id)
  • Filter: (u2.id IS NULL)
12. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on pos_purchaseitem u0 (cost=0.00..109,247.09 rows=684,997 width=16) (actual rows= loops=)

  • Filter: ((date_cancelled IS NULL) AND (package_id IS NOT NULL) AND (date_paid IS NOT NULL) AND (item_type = 1))
13. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=9,884.39..9,884.39 rows=284,439 width=16) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on returns_returnitem u2 (cost=0.00..9,884.39 rows=284,439 width=16) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using shipping_package_pkey on shipping_package (cost=0.42..15,607.71 rows=1 width=58) (actual rows= loops=)

  • Index Cond: (id = u0.package_id)
  • Filter: (NOT (SubPlan 1))
16.          

SubPlan (for Index Scan)

17. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..30,296.85 rows=366,685 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on shipping_packageevent u1 (cost=0.00..27,030.43 rows=366,685 width=8) (actual rows= loops=)

  • Filter: (type = 3)
19. 0.000 0.000 ↓ 0.0

Index Scan using shipping_shipment_pkey on shipping_shipment (cost=0.42..0.86 rows=1 width=142) (actual rows= loops=)

  • Index Cond: (id = shipping_package.shipment_id)
  • Filter: (service_location_id IS NOT NULL)
20. 0.000 0.000 ↓ 0.0

Index Scan using shipping_shipmentservicelocation_pkey on shipping_shipmentservicelocation (cost=0.42..0.52 rows=1 width=82) (actual rows= loops=)

  • Index Cond: (id = shipping_shipment.service_location_id)
  • Filter: ((code)::text = '1503'::text)
21. 0.000 0.000 ↓ 0.0

Seq Scan on shipping_shippingoption (cost=0.00..1.21 rows=1 width=4) (actual rows= loops=)

  • Filter: (method = 4)
22. 0.000 0.000 ↓ 0.0

Index Scan using pos_purchase_shipment_id_key on pos_purchase (cost=0.42..0.68 rows=1 width=163) (actual rows= loops=)

  • Index Cond: (shipment_id = shipping_shipment.id)
23. 0.000 0.000 ↓ 0.0

Index Scan using shipping_packageevent_package_id_cab77620 on shipping_packageevent u0_1 (cost=0.43..0.63 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (package_id = shipping_package.id)
  • Filter: (type = 4)