explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R98t

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 41,610.558 ↑ 1.0 20 1

Limit (cost=1,142,677.72..1,142,678.52 rows=20 width=911) (actual time=41,610.011..41,610.558 rows=20 loops=1)

2. 0.678 41,610.554 ↑ 12,295.9 40 1

GroupAggregate (cost=1,142,676.92..1,162,350.40 rows=491,837 width=911) (actual time=41,609.471..41,610.554 rows=40 loops=1)

  • Group Key: ads.post_id, ai.publish_time
3. 33,668.908 41,609.876 ↑ 1,983.2 248 1

Sort (cost=1,142,676.92..1,143,906.51 rows=491,837 width=799) (actual time=41,609.397..41,609.876 rows=248 loops=1)

  • Sort Key: ads.post_id, ai.publish_time
  • Sort Method: external merge Disk: 1159456kB
4. 344.579 7,940.968 ↓ 3.1 1,542,470 1

Hash Left Join (cost=65,056.27..749,875.09 rows=491,837 width=799) (actual time=357.638..7,940.968 rows=1,542,470 loops=1)

  • Hash Cond: ((ads.post_id)::text = (adf.post_id)::text)
5. 366.751 7,596.368 ↓ 3.1 1,542,470 1

Hash Left Join (cost=65,046.93..747,406.54 rows=491,837 width=783) (actual time=357.610..7,596.368 rows=1,542,470 loops=1)

  • Hash Cond: ((ads.post_id)::text = (ai.post_id)::text)
6. 4,967.377 7,229.576 ↓ 3.1 1,542,470 1

Hash Join (cost=65,042.19..745,555.34 rows=491,837 width=775) (actual time=357.557..7,229.576 rows=1,542,470 loops=1)

  • Hash Cond: ((adst.post_id)::text = (ads.post_id)::text)
  • Join Filter: ((adst.statistical_time <= ads.statistical_time) AND (adst.statistical_time >= (ads.statistical_time - '6 days'::interval)))
  • Rows Removed by Join Filter: 2887569
7. 1,907.717 1,907.717 ↓ 1.0 4,430,039 1

Seq Scan on wp_pidi_fb_ads_tracking adst (cost=0.00..481,311.33 rows=4,426,533 width=48) (actual time=0.092..1,907.717 rows=4,430,039 loops=1)

8. 294.885 354.482 ↓ 1.0 304,965 1

Hash (cost=34,072.75..34,072.75 rows=291,475 width=743) (actual time=354.482..354.482 rows=304,965 loops=1)

  • Buckets: 8192 Batches: 64 Memory Usage: 3706kB
9. 59.597 59.597 ↓ 1.0 304,965 1

Seq Scan on wp_pidi_fb_ads ads (cost=0.00..34,072.75 rows=291,475 width=743) (actual time=0.086..59.597 rows=304,965 loops=1)

10. 0.024 0.041 ↑ 1.2 102 1

Hash (cost=3.22..3.22 rows=122 width=24) (actual time=0.041..0.041 rows=102 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
11. 0.017 0.017 ↑ 1.2 102 1

Seq Scan on wp_pidi_ai_picked_ads ai (cost=0.00..3.22 rows=122 width=24) (actual time=0.006..0.017 rows=102 loops=1)

12. 0.005 0.021 ↓ 2.0 4 1

Hash (cost=9.32..9.32 rows=2 width=16) (actual time=0.021..0.021 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.006 0.016 ↓ 2.0 4 1

Bitmap Heap Scan on wp_pidi_fb_ads_favorite adf (cost=4.29..9.32 rows=2 width=16) (actual time=0.015..0.016 rows=4 loops=1)

  • Recheck Cond: (user_id = 43)
  • Heap Blocks: exact=1
14. 0.010 0.010 ↓ 2.0 4 1

Bitmap Index Scan on wp_pidi_fb_ads_favorite_pkey (cost=0.00..4.29 rows=2 width=0) (actual time=0.010..0.010 rows=4 loops=1)

  • Index Cond: (user_id = 43)