explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rn4x

Settings
# exclusive inclusive rows x rows loops node
1. 78.508 157,003.272 ↓ 36.0 7,203 1

HashAggregate (cost=5,176,414.41..5,176,418.41 rows=200 width=104) (actual time=156,985.276..157,003.272 rows=7,203 loops=1)

  • Group Key: yahoo_performance_stats_campaigns_combined.campaign_id
2.          

CTE yahoo_performance_stats_campaigns_combined

3. 6,806.931 144,822.700 ↓ 1.0 8,421,669 1

Unique (cost=4,283,442.51..4,872,523.45 rows=8,415,442 width=396) (actual time=124,897.101..144,822.700 rows=8,421,669 loops=1)

4. 131,069.867 138,015.769 ↓ 1.0 8,421,669 1

Sort (cost=4,283,442.51..4,304,481.11 rows=8,415,442 width=396) (actual time=124,896.397..138,015.769 rows=8,421,669 loops=1)

  • Sort Key: yahoo_performance_stats_campaigns.advertiser_id, yahoo_performance_stats_campaigns.day, yahoo_performance_stats_campaigns.advertiser_name, yahoo_performance_stats_campaigns.advertiser_timezone, yahoo_performance_stats_campaigns.advertiser_currency, yahoo_performance_stats_campaigns.campaign_id, yahoo_performance_stats_campaigns.campaign_name, yahoo_performance_stats_campaigns.campaign_start_date, yahoo_performance_stats_campaigns.campaign_end_date, yahoo_performance_stats_campaigns.campaign_status, yahoo_performance_stats_campaigns.campaign_objective, yahoo_performance_stats_campaigns.budget, yahoo_performance_stats_campaigns.budget_type, yahoo_performance_stats_campaigns.impressions, yahoo_performance_stats_campaigns.clicks, yahoo_performance_stats_campaigns.ctr, yahoo_performance_stats_campaigns.conversions, yahoo_performance_stats_campaigns.spend, yahoo_performance_stats_campaigns.average_cpc, yahoo_performance_stats_campaigns.""average_cost-per-install"", yahoo_performance_stats_campaigns.average_cpm, yahoo_performance_stats_campaigns.pricing_type, yahoo_performance_stats_campaigns.source, yahoo_performance_stats_campaigns.average_position, yahoo_performance_stats_campaigns.max_bid, yahoo_performance_stats_campaigns.""timestamp"", yahoo_performance_stats_campaigns.fetch_time
  • Sort Method: external merge Disk: 2,880,384kB
5. 1,098.938 6,945.902 ↓ 1.0 8,421,669 1

Append (cost=0.00..636,748.05 rows=8,415,442 width=396) (actual time=0.911..6,945.902 rows=8,421,669 loops=1)

6. 5,820.906 5,820.906 ↓ 1.0 8,408,596 1

Seq Scan on yahoo_performance_stats_campaigns (cost=0.00..509,186.69 rows=8,402,369 width=321) (actual time=0.910..5,820.906 rows=8,408,596 loops=1)

7. 26.058 26.058 ↑ 1.0 13,073 1

Seq Scan on yahoo_performance_stats_campaigns yahoo_performance_stats_campaigns_1 (cost=0.00..1,329.73 rows=13,073 width=327) (actual time=2.575..26.058 rows=13,073 loops=1)

8. 156,924.764 156,924.764 ↑ 55.0 16,991 1

CTE Scan on yahoo_performance_stats_campaigns_combined (cost=0.00..294,540.47 rows=935,049 width=32) (actual time=126,000.113..156,924.764 rows=16,991 loops=1)

  • Filter: ((campaign_start_date <= (CURRENT_DATE - '30 days'::interval)) AND (day >= (CURRENT_DATE - '3 days'::interval)))
  • Rows Removed by Filter: 8,404,678