explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qGU7

Settings
# exclusive inclusive rows x rows loops node
1. 0.146 12.995 ↑ 1.0 1 1

Aggregate (cost=8,102.86..8,102.87 rows=1 width=4) (actual time=12.995..12.995 rows=1 loops=1)

2. 0.162 12.849 ↑ 7.8 55 1

Nested Loop (cost=0.01..8,101.79 rows=427 width=4) (actual time=1.089..12.849 rows=55 loops=1)

  • Join Filter: (ads.ad_id = ad_actions.ad_id)
3. 0.086 10.398 ↑ 2.3 21 1

Nested Loop (cost=0.01..7,780.35 rows=49 width=8) (actual time=1.024..10.398 rows=21 loops=1)

4. 0.628 0.628 ↑ 4.8 12 1

Index Scan using index_ads_user_id on ads (cost=0.00..240.85 rows=57 width=4) (actual time=0.436..0.628 rows=12 loops=1)

  • Index Cond: (user_id = 881,584)
5. 9.684 9.684 ↑ 4.0 2 12

Index Scan using index_action_states_ad_id_timestamp_state_reg on action_states (cost=0.01..132.19 rows=8 width=4) (actual time=0.793..0.807 rows=2 loops=12)

  • Index Cond: ((ad_id = ads.ad_id) AND ("timestamp" >= (now() - '1 year'::interval)) AND ((state)::text = 'reg'::text))
  • Filter: ((transition)::text = 'initial'::text)
6. 2.289 2.289 ↑ 24.7 3 21

Index Scan using index_ad_actions_ad_id_action_id on ad_actions (cost=0.00..5.63 rows=74 width=4) (actual time=0.074..0.109 rows=3 loops=21)

  • Index Cond: (ad_id = action_states.ad_id)
  • Filter: ((queue)::text <> 'autoaccept'::text)
Total runtime : 13.136 ms