explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YDBP

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,780.013 14,255.035 ↓ 18.4 17,777,807 1

Nested Loop (cost=74,516.61..813,268.56 rows=965,796 width=198) (actual time=0.059..14,255.035 rows=17,777,807 loops=1)

2.          

CTE cte

3. 28.966 520.953 ↓ 1.0 341,718 1

Append (cost=0.00..74,516.61 rows=340,503 width=30) (actual time=0.019..520.953 rows=341,718 loops=1)

4. 491.987 491.987 ↓ 1.0 341,718 1

Seq Scan on rpa_event_2019_05 (cost=0.00..72,814.10 rows=340,503 width=30) (actual time=0.018..491.987 rows=341,718 loops=1)

  • Filter: ((event_sentiment_score IS NOT NULL) AND (timestamp_utc >= '2019-05-01 00:00:00+00'::timestamp with time zone) AND (timestamp_utc < '2019-06-01 00:00:00+00'::timestamp with time zone) AND (relevance >= 100) AND ((topic_group)::text = 'earnings'::text))
  • Rows Removed by Filter: 530027
5. 657.429 3,763.418 ↓ 7.6 4,355,802 1

Nested Loop (cost=0.00..279,499.88 rows=573,460 width=139) (actual time=0.043..3,763.418 rows=4,355,802 loops=1)

6. 713.963 713.963 ↓ 1.0 341,718 1

CTE Scan on cte (cost=0.00..6,810.06 rows=340,503 width=80) (actual time=0.023..713.963 rows=341,718 loops=1)

7. 2,392.026 2,392.026 ↓ 6.5 13 341,718

Index Scan using rpa_entity_entity_id_idx on rpa_entity en1 (cost=0.00..0.78 rows=2 width=59) (actual time=0.002..0.007 rows=13 loops=341,718)

  • Index Cond: (rp_entity_id = cte.rp_entity_id)
  • Rows Removed by Index Recheck: 0
  • Filter: ((cte.timestamp_utc >= valid_from) AND (cte.timestamp_utc <= valid_to))
  • Rows Removed by Filter: 6
8. 8,711.604 8,711.604 ↓ 2.0 4 4,355,802

Index Scan using rpa_entity_entity_id_idx on rpa_entity en2 (cost=0.00..0.78 rows=2 width=59) (actual time=0.001..0.002 rows=4 loops=4,355,802)

  • Index Cond: (rp_entity_id = cte.rp_source_id)
  • Filter: ((cte.timestamp_utc >= valid_from) AND (cte.timestamp_utc <= valid_to))