explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aqi6

Settings
# exclusive inclusive rows x rows loops node
1. 0.752 5,584.825 ↑ 1.0 1 1

Aggregate (cost=2,487,518.01..2,487,518.02 rows=1 width=0) (actual time=5,584.825..5,584.825 rows=1 loops=1)

2. 540.491 5,584.073 ↑ 58.0 935 1

Hash Semi Join (cost=148,821.04..2,487,382.36 rows=54,261 width=0) (actual time=647.007..5,584.073 rows=935 loops=1)

  • Hash Cond: (action_states.ad_id = ads.ad_id)
3. 4,607.239 4,937.965 ↑ 2.1 778,102 1

Bitmap Heap Scan on action_states (cost=89,858.23..2,421,765.19 rows=1,606,683 width=4) (actual time=454.651..4,937.965 rows=778,102 loops=1)

  • Recheck Cond: (((state)::text = 'reg'::text) AND ("timestamp" >= (now() - '7 days'::interval)))
4. 330.726 330.726 ↑ 2.1 778,130 1

Bitmap Index Scan on index_action_states_state_timestamp3 (cost=0.00..89,456.56 rows=1,606,683 width=0) (actual time=330.726..330.726 rows=778,130 loops=1)

  • Index Cond: (((state)::text = 'reg'::text) AND ("timestamp" >= (now() - '7 days'::interval)))
5. 4.734 105.617 ↑ 3.0 5,355 1

Hash (cost=58,759.45..58,759.45 rows=16,269 width=4) (actual time=105.617..105.617 rows=5,355 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 189kB
6. 53.721 100.883 ↑ 3.0 5,355 1

Bitmap Heap Scan on ads (cost=942.02..58,759.45 rows=16,269 width=4) (actual time=48.417..100.883 rows=5,355 loops=1)

  • Recheck Cond: (user_id = 2377122)
7. 47.162 47.162 ↑ 2.6 6,377 1

Bitmap Index Scan on index_ads_user_id (cost=0.00..937.95 rows=16,269 width=0) (actual time=47.162..47.162 rows=6,377 loops=1)

  • Index Cond: (user_id = 2377122)
Total runtime : 5,586.220 ms