explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dZL7

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

GroupAggregate (cost=37,202,650.65..37,203,478.97 rows=22,859 width=49) (actual rows= loops=)

  • Group Key: o.customer_id, o.is_renewal, ((som.subscription_id IS NOT NULL)), ((g.id IS NOT NULL)), ((g2.id IS NOT NULL))
2. 0.000 0.000 ↓ 0.0

Sort (cost=37,202,650.65..37,202,710.62 rows=23,989 width=49) (actual rows= loops=)

  • Sort Key: o.customer_id, o.is_renewal, ((som.subscription_id IS NOT NULL)), ((g.id IS NOT NULL)), ((g2.id IS NOT NULL))
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=5,787.38..37,200,905.44 rows=23,989 width=49) (actual rows= loops=)

  • Join Filter: (g.receiving_order_id = o.id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,787.38..262,259.50 rows=23,989 width=49) (actual rows= loops=)

  • Hash Cond: (o.id = g.sending_order_id)
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=658.91..256,890.10 rows=23,989 width=33) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on "order" o (cost=658.48..79,175.22 rows=23,989 width=25) (actual rows= loops=)

  • Recheck Cond: (store_id = 63474248)
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_order_store_id (cost=0.00..652.48 rows=23,989 width=0) (actual rows= loops=)

  • Index Cond: (store_id = 63474248)
8. 0.000 0.000 ↓ 0.0

Index Scan using subscription_order_order_idx on subscription_order_map som (cost=0.44..7.40 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (order_id = o.id)
9. 0.000 0.000 ↓ 0.0

Hash (cost=3,845.43..3,845.43 rows=102,643 width=24) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on gift g (cost=0.00..3,845.43 rows=102,643 width=24) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4,358.65 rows=102,643 width=8) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on gift g2 (cost=0.00..3,845.43 rows=102,643 width=8) (actual rows= loops=)