explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GZ8c

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 6.768 ↓ 10.0 30 1

Limit (cost=67.77..67.81 rows=3 width=215) (actual time=6.155..6.768 rows=30 loops=1)

2. 0.624 6.762 ↓ 10.0 30 1

GroupAggregate (cost=67.77..67.81 rows=3 width=215) (actual time=6.153..6.762 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. 1.207 6.138 ↓ 148.0 444 1

Sort (cost=67.77..67.77 rows=3 width=132) (actual time=6.085..6.138 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.296 4.931 ↓ 148.0 444 1

Nested Loop Left Join (cost=2.24..67.76 rows=3 width=132) (actual time=0.074..4.931 rows=444 loops=1)

5. 0.673 3.303 ↓ 148.0 444 1

Nested Loop Left Join (cost=2.18..56.01 rows=3 width=63) (actual time=0.057..3.303 rows=444 loops=1)

  • 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. 0.032 0.057 ↓ 3.4 31 1

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

  • Recheck Cond: (profile_id = '3811963422597420'::bigint)
  • Heap Blocks: exact=2
7. 0.025 0.025 ↓ 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.025..0.025 rows=31 loops=1)

  • Index Cond: (profile_id = '3811963422597420'::bigint)
8. 2.573 2.573 ↓ 52.0 52 31

Index Scan using sb_daily_campaign_performances_profile_id_campaign_id_date_pkey on sponsored_brands_daily_campaign_performances x28 (cost=0.08..4.09 rows=1 width=21) (actual time=0.007..0.083 rows=52 loops=31)

  • Index Cond: ((profile_id = '3811963422597420'::bigint) AND (campaign_id = sponsored_brands_campaigns.id))
9. 1.332 1.332 ↑ 1.0 1 444

Index Scan using sponsored_brands_strategies_profile_id_campaign_id_pkey on sb_campaign_strategies x7 (cost=0.06..3.84 rows=1 width=23) (actual time=0.003..0.003 rows=1 loops=444)

  • Index Cond: ((profile_id = '3811963422597420'::bigint) AND (campaign_id = sponsored_brands_campaigns.id))
Planning time : 0.951 ms
Execution time : 6.920 ms