explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UNQj

Settings
# exclusive inclusive rows x rows loops node
1. 7.747 4,201.206 ↓ 2,143.0 2,143 1

HashAggregate (cost=1,177.69..1,177.70 rows=1 width=16) (actual time=4,199.628..4,201.206 rows=2,143 loops=1)

2. 10.181 4,193.459 ↓ 2,143.0 2,143 1

Nested Loop (cost=0.00..1,177.68 rows=1 width=16) (actual time=9.947..4,193.459 rows=2,143 loops=1)

  • Join Filter: (ads.ad_id = action_states.ad_id)
3. 6.851 2,095.996 ↓ 357.2 2,143 1

Nested Loop (cost=0.00..1,028.14 rows=6 width=24) (actual time=5.443..2,095.996 rows=2,143 loops=1)

4. 2.419 584.111 ↓ 211.5 1,269 1

Nested Loop (cost=0.00..922.71 rows=6 width=12) (actual time=1.984..584.111 rows=1,269 loops=1)

5. 0.461 0.461 ↑ 1.0 1 1

Index Scan using users_email_key on users (cost=0.00..9.14 rows=1 width=4) (actual time=0.457..0.461 rows=1 loops=1)

  • Index Cond: ((email)::text = 'm.tolonen@hotmail.com'::text)
6. 581.231 581.231 ↓ 5.5 1,269 1

Index Scan using index_ads_user_id on ads (cost=0.00..911.28 rows=230 width=16) (actual time=1.523..581.231 rows=1,269 loops=1)

  • Index Cond: (user_id = users.user_id)
7. 1,505.034 1,505.034 ↑ 20.0 2 1,269

Index Scan using ad_actions_pkey on ad_actions (cost=0.00..17.17 rows=40 width=12) (actual time=1.165..1.186 rows=2 loops=1,269)

  • Index Cond: (ad_id = ads.ad_id)
  • Filter: (state = ANY ('{unpaid,unverified}'::enum_action_states_state[]))
  • Rows Removed by Filter: 5
8. 2,087.282 2,087.282 ↑ 1.0 1 2,143

Index Scan using action_states_state_id_key on action_states (cost=0.00..24.91 rows=1 width=12) (actual time=0.972..0.974 rows=1 loops=2,143)

  • Index Cond: (state_id = ad_actions.current_state)
  • Filter: ((state = ANY ('{unpaid,unverified}'::enum_action_states_state[])) AND (ad_actions.ad_id = ad_id) AND (ad_actions.action_id = action_id))
Total runtime : 4,202.528 ms