explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CgPp

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 34,674.126 ↑ 5,649.0 2 1

Hash Join (cost=37,016.94..2,068,942.89 rows=11,298 width=41) (actual time=17,142.644..34,674.126 rows=2 loops=1)

  • Hash Cond: (ccc.campaign_id = c.id)
2.          

CTE voice_biz

3. 0.031 0.061 ↑ 2.7 37 1

ProjectSet (cost=0.00..7.13 rows=100 width=4) (actual time=0.041..0.061 rows=37 loops=1)

4. 0.030 0.030 ↑ 1.0 1 1

Seq Scan on config_keeper_dynamicconfig (cost=0.00..6.56 rows=1 width=21) (actual time=0.018..0.030 rows=1 loops=1)

  • Filter: ((key_name)::text = 'us_re_active_voice_business_ids'::text)
  • Rows Removed by Filter: 209
5.          

CTE campaign_ids

6. 0.094 0.424 ↑ 2.8 183 1

Nested Loop (cost=2.53..2,004.78 rows=516 width=4) (actual time=0.108..0.424 rows=183 loops=1)

7. 0.028 0.108 ↑ 2.7 37 1

HashAggregate (cost=2.25..3.25 rows=100 width=4) (actual time=0.095..0.108 rows=37 loops=1)

  • Group Key: voice_biz.unnest
8. 0.080 0.080 ↑ 2.7 37 1

CTE Scan on voice_biz (cost=0.00..2.00 rows=100 width=4) (actual time=0.042..0.080 rows=37 loops=1)

9. 0.222 0.222 ↑ 1.0 5 37

Index Scan using voice_workflow_campaign_ad147619 on voice_workflow_campaign (cost=0.28..19.97 rows=5 width=8) (actual time=0.002..0.006 rows=5 loops=37)

  • Index Cond: (voice_business_id = voice_biz.unnest)
10. 0.027 34,673.352 ↑ 5,649.0 2 1

Nested Loop (cost=34,804.04..2,066,700.21 rows=11,298 width=45) (actual time=17,141.873..34,673.352 rows=2 loops=1)

11. 0.040 34,673.247 ↑ 1,907.8 6 1

Hash Join (cost=34,803.60..1,979,855.06 rows=11,447 width=41) (actual time=17,141.843..34,673.247 rows=6 loops=1)

  • Hash Cond: (ljl.campaign_id = campaign_ids.id)
12. 34,284.626 34,672.467 ↑ 2,861.8 8 1

Bitmap Heap Scan on lead_journey_leadjourneylog ljl (cost=34,787.49..1,979,651.50 rows=22,894 width=45) (actual time=17,141.085..34,672.467 rows=8 loops=1)

  • Recheck Cond: (id > 35141827)
  • Filter: ((NOT is_sent) AND should_sent AND (event_at > '2019-10-16 00:00:00+00'::timestamp with time zone) AND (updated_at <= (now() - '00:15:00'::interval)))
  • Rows Removed by Filter: 1765186
  • Heap Blocks: exact=187683
13. 387.841 387.841 ↓ 1.2 1,877,601 1

Bitmap Index Scan on lead_journey_leadjourneylog_pkey (cost=0.00..34,781.77 rows=1,549,511 width=0) (actual time=387.841..387.841 rows=1,877,601 loops=1)

  • Index Cond: (id > 35141827)
14. 0.064 0.740 ↑ 1.1 183 1

Hash (cost=13.61..13.61 rows=200 width=4) (actual time=0.740..0.740 rows=183 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
15. 0.142 0.676 ↑ 1.1 183 1

HashAggregate (cost=11.61..13.61 rows=200 width=4) (actual time=0.619..0.676 rows=183 loops=1)

  • Group Key: campaign_ids.id
16. 0.534 0.534 ↑ 2.8 183 1

CTE Scan on campaign_ids (cost=0.00..10.32 rows=516 width=4) (actual time=0.109..0.534 rows=183 loops=1)

17. 0.078 0.078 ↓ 0.0 0 6

Index Scan using voice_workflow_campaigncallcontact_pkey on voice_workflow_campaigncallcontact ccc (cost=0.43..7.59 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=6)

  • Index Cond: (id = ljl.campaign_call_contact_id)
  • Filter: (is_active AND (NOT is_test))
  • Rows Removed by Filter: 1
18. 0.348 0.755 ↑ 1.0 1,047 1

Hash (cost=187.91..187.91 rows=1,047 width=4) (actual time=0.754..0.755 rows=1,047 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
19. 0.407 0.407 ↑ 1.0 1,047 1

Index Only Scan using voice_workflow_campaign_pkey on voice_workflow_campaign c (cost=0.28..187.91 rows=1,047 width=4) (actual time=0.029..0.407 rows=1,047 loops=1)

  • Heap Fetches: 52
Planning time : 2.381 ms
Execution time : 34,674.978 ms