explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VpyU

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 186.336 ↑ 2.1 30 1

Limit (cost=13,570.60..13,571.46 rows=64 width=215) (actual time=186.041..186.336 rows=30 loops=1)

2. 0.308 186.332 ↑ 2.1 30 1

GroupAggregate (cost=13,570.60..13,571.46 rows=64 width=215) (actual time=186.039..186.332 rows=30 loops=1)

  • Group Key: sponsored_brands_campaigns.name, sponsored_brands_campaigns.id, sponsored_brands_campaigns.state, sponsored_brands_campaigns.budget, (CASE WHEN (x7.max_bid IS NOT NULL) THEN x7.acos_target ELSE NULL::numeric END), (CASE WHEN (x7.max_bid IS NOT NULL) THEN x7.min_bid ELSE NULL::numeric END), x7.max_bid
3. 0.576 186.024 ↓ 6.9 444 1

Sort (cost=13,570.60..13,570.63 rows=64 width=132) (actual time=186.000..186.024 rows=444 loops=1)

  • Sort Key: sponsored_brands_campaigns.name, sponsored_brands_campaigns.id, sponsored_brands_campaigns.state, sponsored_brands_campaigns.budget, (CASE WHEN (x7.max_bid IS NOT NULL) THEN x7.acos_target ELSE NULL::numeric END), (CASE WHEN (x7.max_bid IS NOT NULL) THEN x7.min_bid ELSE NULL::numeric END), x7.max_bid
  • Sort Method: quicksort Memory: 87kB
4. 0.247 185.448 ↓ 6.9 444 1

Hash Left Join (cost=88.90..13,570.21 rows=64 width=132) (actual time=12.122..185.448 rows=444 loops=1)

  • Hash Cond: (sponsored_brands_campaigns.id = x7.campaign_id)
5. 79.806 183.429 ↓ 6.9 444 1

Hash Right Join (cost=19.20..13,500.48 rows=64 width=63) (actual time=10.327..183.429 rows=444 loops=1)

  • Hash Cond: (x28.campaign_id = sponsored_brands_campaigns.id)
  • Filter: ((x28.date IS NULL) OR ((x28.date >= '2019-09-06'::date) AND (x28.date <= '2019-10-06'::date)))
  • Rows Removed by Filter: 1180
6. 103.556 103.556 ↑ 1.0 743,589 1

Seq Scan on sponsored_brands_daily_campaign_performances x28 (cost=0.00..13,090.78 rows=743,595 width=21) (actual time=0.015..103.556 rows=743,589 loops=1)

7. 0.019 0.067 ↓ 3.4 31 1

Hash (cost=19.17..19.17 rows=9 width=50) (actual time=0.067..0.067 rows=31 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
8. 0.027 0.048 ↓ 3.4 31 1

Bitmap Heap Scan on sponsored_brands_campaigns (cost=2.10..19.17 rows=9 width=50) (actual time=0.031..0.048 rows=31 loops=1)

  • Recheck Cond: (profile_id = '3811963422597420'::bigint)
  • Heap Blocks: exact=2
9. 0.021 0.021 ↓ 3.4 31 1

Bitmap Index Scan on sponsored_brands_campaigns_id_profile_id_pkey (cost=0.00..2.10 rows=9 width=0) (actual time=0.021..0.021 rows=31 loops=1)

  • Index Cond: (profile_id = '3811963422597420'::bigint)
10. 0.881 1.772 ↓ 1.0 3,370 1

Hash (cost=58.02..58.02 rows=3,339 width=23) (actual time=1.771..1.772 rows=3,370 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 219kB
11. 0.891 0.891 ↓ 1.0 3,370 1

Seq Scan on sb_campaign_strategies x7 (cost=0.00..58.02 rows=3,339 width=23) (actual time=0.014..0.891 rows=3,370 loops=1)

Planning time : 0.862 ms
Execution time : 186.489 ms