explain.depesz.com

PostgreSQL's explain analyze made readable

Result: icO6

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 74,248.812 ↓ 10.0 10 1

Limit (cost=13,444.20..13,444.21 rows=1 width=107) (actual time=74,248.807..74,248.812 rows=10 loops=1)

2. 7.112 74,248.809 ↓ 10.0 10 1

Sort (cost=13,444.20..13,444.21 rows=1 width=107) (actual time=74,248.806..74,248.809 rows=10 loops=1)

  • Sort Key: e.created DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 7,375.863 74,241.697 ↓ 476.0 476 1

Nested Loop (cost=0.42..13,444.19 rows=1 width=107) (actual time=171.619..74,241.697 rows=476 loops=1)

  • Join Filter: ((r.product_id = e.product_id) AND (r.id = e.round_id))
  • Rows Removed by Join Filter: 33732784
4. 39.065 117.136 ↓ 162.0 486 1

Nested Loop (cost=0.00..10,109.00 rows=3 width=102) (actual time=71.814..117.136 rows=486 loops=1)

  • Join Filter: ((r.product_id = g.product_id) AND (r.game_id = g.id))
  • Rows Removed by Join Filter: 173016
5. 0.245 0.245 ↑ 1.0 357 1

Seq Scan on games g (cost=0.00..28.60 rows=360 width=24) (actual time=0.052..0.245 rows=357 loops=1)

6. 19.145 77.826 ↓ 162.0 486 357

Materialize (cost=0.00..10,061.51 rows=3 width=83) (actual time=0.009..0.218 rows=486 loops=357)

7. 58.681 58.681 ↓ 162.0 486 1

Seq Scan on rounds r (cost=0.00..10,061.49 rows=3 width=83) (actual time=3.191..58.681 rows=486 loops=1)

  • Filter: ((user_id = 'Laura Law'::text) AND ((product_id || campaign_id) = 'NWCU004'::text))
  • Rows Removed by Filter: 234845
8. 66,748.698 66,748.698 ↓ 4.5 69,410 486

Index Scan using round_events_pkey on round_events e (cost=0.42..882.85 rows=15,259 width=27) (actual time=0.031..137.343 rows=69,410 loops=486)

  • Index Cond: (product_id = g.product_id)
  • Filter: (type = 'end'::text)
  • Rows Removed by Filter: 109918
Planning time : 1.678 ms
Execution time : 74,248.915 ms