explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NdCX

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.026 4.200 ↓ 1.0 113 1

Subquery Scan on cs (cost=539.54..540.42 rows=110 width=76) (actual time=3.920..4.200 rows=113 loops=1)

2. 0.259 4.174 ↓ 1.0 113 1

WindowAgg (cost=539.54..540.09 rows=110 width=68) (actual time=3.918..4.174 rows=113 loops=1)

3.          

CTE daily_sums

4. 0.928 3.795 ↓ 1.0 113 1

GroupAggregate (cost=537.11..538.14 rows=110 width=68) (actual time=2.718..3.795 rows=113 loops=1)

  • Group Key: sponsored_brands_daily_campaign_performances.date
5. 0.821 2.867 ↓ 5.2 1,510 1

Sort (cost=537.11..537.26 rows=292 width=13) (actual time=2.692..2.867 rows=1,510 loops=1)

  • Sort Key: sponsored_brands_daily_campaign_performances.date
  • Sort Method: quicksort Memory: 145kB
6. 1.734 2.046 ↓ 5.2 1,510 1

Bitmap Heap Scan on sponsored_brands_daily_campaign_performances (cost=6.54..534.72 rows=292 width=13) (actual time=0.403..2.046 rows=1,510 loops=1)

  • Recheck Cond: (profile_id = '3811963422597420'::bigint)
  • Heap Blocks: exact=366
7. 0.312 0.312 ↓ 6.0 1,745 1

Bitmap Index Scan on sb_daily_campaign_performances_profile_id_campaign_id_date_pkey (cost=0.00..6.52 rows=292 width=0) (actual time=0.312..0.312 rows=1,745 loops=1)

  • Index Cond: (profile_id = '3811963422597420'::bigint)
8. 0.052 3.915 ↓ 1.0 113 1

Sort (cost=1.41..1.46 rows=110 width=68) (actual time=3.902..3.915 rows=113 loops=1)

  • Sort Key: daily_sums.date
  • Sort Method: quicksort Memory: 33kB
9. 3.863 3.863 ↓ 1.0 113 1

CTE Scan on daily_sums (cost=0.00..0.66 rows=110 width=68) (actual time=2.722..3.863 rows=113 loops=1)

Planning time : 0.202 ms
Execution time : 4.311 ms