explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jvWr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=334,435.03..334,435.08 rows=20 width=911) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=334,434.98..334,513.48 rows=31,399 width=911) (actual rows= loops=)

  • Sort Key: ads.post_date DESC
3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=332,186.51..333,442.47 rows=31,399 width=911) (actual rows= loops=)

  • Group Key: ads.post_id, ai.publish_time
4. 0.000 0.000 ↓ 0.0

Sort (cost=332,186.51..332,265.01 rows=31,399 width=799) (actual rows= loops=)

  • Sort Key: ads.post_id, ai.publish_time
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.99..318,784.75 rows=31,399 width=799) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4.43..38,548.36 rows=18,608 width=767) (actual rows= loops=)

  • Join Filter: ((ads.post_id)::text = (adf.post_id)::text)
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.14..37,980.80 rows=18,608 width=751) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on wp_pidi_fb_ads ads (cost=0.00..34,801.44 rows=18,608 width=743) (actual rows= loops=)

  • Filter: (total_comments >= 300)
9. 0.000 0.000 ↓ 0.0

Index Scan using wp_pidi_ai_picked_ads_pkey on wp_pidi_ai_picked_ads ai (cost=0.14..0.16 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((ads.post_id)::text = (post_id)::text)
10. 0.000 0.000 ↓ 0.0

Materialize (cost=4.29..9.33 rows=2 width=16) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on wp_pidi_fb_ads_favorite adf (cost=4.29..9.32 rows=2 width=16) (actual rows= loops=)

  • Recheck Cond: (user_id = 43)
12. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (user_id = 43)
13. 0.000 0.000 ↓ 0.0

Index Scan using wp_pidi_fb_ads_tracking_pkey on wp_pidi_fb_ads_tracking adst (cost=0.56..15.03 rows=3 width=48) (actual rows= loops=)

  • Index Cond: (((post_id)::text = (ads.post_id)::text) AND (statistical_time >= (ads.statistical_time - '6 days'::interval)) AND (statistical_time <= ads.statistical_time))