explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dBPE : Optimization for: Req WITH #1 - o; plan #kf9g

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.033 1,195.422 ↑ 1.0 1 1

Aggregate (cost=429,550.48..429,550.50 rows=1 width=88) (actual time=1,195.422..1,195.422 rows=1 loops=1)

2.          

CTE count_stats

3. 189.033 1,195.328 ↑ 1.0 1 1

Aggregate (cost=429,547.26..429,547.27 rows=1 width=8) (actual time=1,195.328..1,195.328 rows=1 loops=1)

4. 455.544 1,006.295 ↓ 1.0 1,834,652 1

Bitmap Heap Scan on stats_wasac (cost=64,728.00..425,091.78 rows=1,782,189 width=4) (actual time=568.424..1,006.295 rows=1,834,652 loops=1)

  • Recheck Cond: (((action)::text = 'IAI_encart_nominal_bandeau'::text) AND (date_stat > (now() - '15 days'::interval)))
  • Heap Blocks: exact=73895
5. 550.751 550.751 ↓ 1.0 1,834,652 1

Bitmap Index Scan on stats_wasac_action_date_stat (cost=0.00..64,282.46 rows=1,782,189 width=0) (actual time=550.751..550.751 rows=1,834,652 loops=1)

  • Index Cond: (((action)::text = 'IAI_encart_nominal_bandeau'::text) AND (date_stat > (now() - '15 days'::interval)))
6.          

Initplan (forAggregate)

7. 0.014 0.014 ↓ 0.0 0 1

Seq Scan on admin_iai admin_iai_1 (cost=0.00..1.49 rows=1 width=66) (actual time=0.014..0.014 rows=0 loops=1)

  • Filter: ((cle)::text = 'RELEASE'::text)
  • Rows Removed by Filter: 39
8. 1,195.336 1,195.336 ↑ 1.0 1 1

CTE Scan on count_stats (cost=0.00..0.02 rows=1 width=8) (actual time=1,195.335..1,195.336 rows=1 loops=1)

9. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on count_stats count_stats_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

10. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on count_stats count_stats_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

11. 0.037 0.037 ↑ 2.0 1 1

Seq Scan on admin_iai (cost=0.00..1.58 rows=2 width=90) (actual time=0.032..0.037 rows=1 loops=1)

  • Filter: (((cle)::text = 'MIN_REFRESH'::text) OR ((cle)::text = 'RELEASE'::text))
  • Rows Removed by Filter: 38