explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GGmY

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

GroupAggregate (cost=317,159.38..317,455.62 rows=14,812 width=12) (actual rows= loops=)

  • Group Key: carts.id
2. 0.000 0.000 ↓ 0.0

Sort (cost=317,159.38..317,196.41 rows=14,812 width=20) (actual rows= loops=)

  • Sort Key: carts.id
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,894.03..316,133.32 rows=14,812 width=20) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash Join (cost=17,893.59..235,867.36 rows=14,812 width=16) (actual rows= loops=)

  • Hash Cond: (cart_locations.cart_id = carts.id)
  • Join Filter: (((carts.user_id = '151517ed6e63f2f2d26b2308e56517c47e57ba1375b819fe4eb1bdc5003db01d'::text) OR (alternatives: SubPlan 1 or hashed SubPlan 2)) AND ((alternatives: SubPlan 3 or hashed SubPlan 4) OR (favorites.user_id = carts.user_id)))
5. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.85..214,636.08 rows=61,542 width=39) (actual rows= loops=)

  • Workers Planned: 1
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..207,481.88 rows=36,201 width=39) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Parallel Index Scan using favorites_not_delete_idx on favorites (cost=0.29..2,344.63 rows=16,857 width=97) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using cart_locations_location_id_idx on cart_locations (cost=0.56..12.15 rows=2 width=73) (actual rows= loops=)

  • Index Cond: (location_id = favorites.location_id)
9. 0.000 0.000 ↓ 0.0

Hash (cost=10,249.20..10,249.20 rows=274,283 width=68) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on carts (cost=0.00..10,249.20 rows=274,283 width=68) (actual rows= loops=)

  • Filter: (NOT soft_delete)
11.          

SubPlan (for Hash Join)

12. 0.000 0.000 ↓ 0.0

Index Only Scan using cart_shared_with_republic_users_idx on cart_shared_with_users (cost=0.28..8.29 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 'dfdanks07@aim.com'::text) AND (cart_id = cart_locations.cart_id))
13. 0.000 0.000 ↓ 0.0

Index Only Scan using cart_shared_with_republic_users_idx on cart_shared_with_users cart_shared_with_users_1 (cost=0.28..8.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 'dfdanks07@aim.com'::text)
14. 0.000 0.000 ↓ 0.0

Index Only Scan using cart_shared_with_republic_users_idx on cart_shared_with_users cart_shared_with_users_2 (cost=0.28..8.29 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = favorites.user_id) AND (cart_id = cart_locations.cart_id))
15. 0.000 0.000 ↓ 0.0

Seq Scan on cart_shared_with_users cart_shared_with_users_3 (cost=0.00..25.73 rows=818 width=27) (actual rows= loops=)

  • Filter: ((NOT soft_delete) AND (user_source = 'republic'::user_source_id))
16. 0.000 0.000 ↓ 0.0

Index Scan using user_per_cart_location_notifications_idx on user_per_cart_location_notifications (cost=0.44..5.41 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (cart_locations.id = cart_location_id)