explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 791w

Settings

Optimization(s) for this plan:

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

GroupAggregate (cost=2,458,625.84..2,459,146.83 rows=13,893 width=59) (actual rows= loops=)

  • Group Key: u.object_id, u.user_id
  • Filter: (sum((((u.scroll_depth * u.time_spent))::double precision / a.word_count)) > '0'::double precision)
2. 0.000 0.000 ↓ 0.0

Sort (cost=2,458,625.84..2,458,660.58 rows=13,893 width=67) (actual rows= loops=)

  • Sort Key: u.object_id, u.user_id
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=118,853.49..2,457,669.86 rows=13,893 width=67) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=117,412.53..117,412.78 rows=25 width=104) (actual rows= loops=)

  • Group Key: a.content_id, b."article_type.name", b.created, a.word_count
5. 0.000 0.000 ↓ 0.0

Append (cost=1,000.42..117,412.28 rows=25 width=104) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.42..86,504.26 rows=21 width=43) (actual rows= loops=)

  • Workers Planned: 2
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..85,502.16 rows=9 width=43) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on r_content_keywords a (cost=0.00..9,158.22 rows=18,888 width=15) (actual rows= loops=)

  • Filter: (word_count > '0'::double precision)
9. 0.000 0.000 ↓ 0.0

Index Scan using idx_r_article_raw_article_id on r_article_raw b (cost=0.42..4.03 rows=1 width=36) (actual rows= loops=)

  • Index Cond: ((article_id)::text = (a.content_id)::text)
  • Filter: ((domainshort ~~ 'www.rtl.hr%'::text) AND ("article_type.name" = ANY ('{article,viral_story,sport_developing_story,developing_story}'::text[])) AND ((created)::date <= CURRENT_DATE) AND ((created)::date >= (CURRENT_DATE - '3 days'::interval)))
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.42..7,499.13 rows=1 width=67) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..7,490.68 rows=1 width=28) (actual rows= loops=)

  • Workers Planned: 2
12. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on r_gallery_raw b_1 (cost=0.00..6,490.58 rows=1 width=28) (actual rows= loops=)

  • Filter: (("substring"(domain, 9) ~~ 'www.rtl.hr%'::text) AND ((created)::date <= CURRENT_DATE) AND ((created)::date >= (CURRENT_DATE - '3 days'::interval)))
13. 0.000 0.000 ↓ 0.0

Index Scan using idx_content_id on r_content_keywords a_1 (cost=0.42..8.44 rows=1 width=15) (actual rows= loops=)

  • Index Cond: ((content_id)::text = ((b_1.gallery_id)::character varying)::text)
  • Filter: (word_count > '0'::double precision)
14. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.42..23,408.64 rows=3 width=67) (actual rows= loops=)

  • Workers Planned: 2
15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..22,408.34 rows=1 width=67) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on r_media_raw b_2 (cost=0.00..22,399.89 rows=1 width=28) (actual rows= loops=)

  • Filter: (("substring"(domain, 9) ~~ 'www.rtl.hr%'::text) AND ((created)::date <= CURRENT_DATE) AND ((created)::date >= (CURRENT_DATE - '3 days'::interval)))
17. 0.000 0.000 ↓ 0.0

Index Scan using idx_content_id on r_content_keywords a_2 (cost=0.42..8.44 rows=1 width=15) (actual rows= loops=)

  • Index Cond: ((content_id)::text = ((b_2.media_id)::character varying)::text)
  • Filter: (word_count > '0'::double precision)
18. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on r_upscore_prepare u (cost=1,440.96..93,604.71 rows=556 width=59) (actual rows= loops=)

  • Recheck Cond: ((object_id)::text = (a.content_id)::text)
  • Filter: ((time_spent > 10) AND (date <= CURRENT_DATE) AND (date >= (CURRENT_DATE - '1 day'::interval)))
19. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_r_upscore_prepare_object_id (cost=0.00..1,440.82 rows=24,823 width=0) (actual rows= loops=)

  • Index Cond: ((object_id)::text = (a.content_id)::text)