explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iSRwm

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

Insert on fact_airtable_records (cost=3,233,972.93..3,233,980.93 rows=200 width=276) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* (cost=3,233,972.93..3,233,980.93 rows=200 width=276) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,233,972.93..3,233,976.43 rows=200 width=316) (actual rows= loops=)

  • Group Key: airtable.id, airtable.campaign_id, airtable.channel, airtable.source
4.          

CTE airtable

5. 0.000 0.000 ↓ 0.0

Seq Scan on src_airtable_records (cost=0.00..10.07 rows=257 width=102) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=158,273.98..1,568,999.42 rows=95,140,768 width=244) (actual rows= loops=)

  • Hash Cond: (campaigns.id = analytics.dsp_campaign_id)
7. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=25,553.13..26,386.46 rows=34,611 width=236) (actual rows= loops=)

  • Merge Cond: ((campaigns.campaign_id = humming.id) AND ((campaigns.channel)::text = airtable.channel) AND ((campaigns.source)::text = airtable.source))
8. 0.000 0.000 ↓ 0.0

Sort (cost=10,370.56..10,566.06 rows=78,199 width=46) (actual rows= loops=)

  • Sort Key: campaigns.campaign_id, campaigns.channel, campaigns.source
9. 0.000 0.000 ↓ 0.0

Seq Scan on dim_dsp_campaigns campaigns (cost=0.00..1,606.99 rows=78,199 width=46) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Materialize (cost=15,182.57..15,355.62 rows=34,611 width=236) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Sort (cost=15,182.57..15,269.10 rows=34,611 width=236) (actual rows= loops=)

  • Sort Key: humming.id, airtable.channel, airtable.source
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,231.36..8,667.08 rows=34,611 width=236) (actual rows= loops=)

  • Hash Cond: ((airtable.campaign_id)::text = humming.public_uid)
13. 0.000 0.000 ↓ 0.0

CTE Scan on airtable (cost=0.00..5.14 rows=257 width=220) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=4,525.27..4,525.27 rows=139,927 width=25) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on dim_campaigns humming (cost=0.00..4,525.27 rows=139,927 width=25) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=68,735.38..68,735.38 rows=3,150,038 width=40) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on fact_campaign_performance_hourly analytics (cost=0.00..68,735.38 rows=3,150,038 width=40) (actual rows= loops=)