explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FqSQ : Optimization for: plan #Tsso

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.041 13,010.477 ↑ 111.1 9 1

Nested Loop (cost=1,611,114.12..1,611,099,176.84 rows=1,000 width=12) (actual time=963.612..13,010.477 rows=9 loops=1)

2.          

CTE days

3. 0.082 0.082 ↑ 111.1 9 1

Function Scan on generate_series dd (cost=0.01..15.01 rows=1,000 width=4) (actual time=0.017..0.082 rows=9 loops=1)

4. 0.108 0.108 ↑ 111.1 9 1

CTE Scan on days (cost=0.00..20.00 rows=1,000 width=4) (actual time=0.019..0.108 rows=9 loops=1)

5. 0.036 13,010.328 ↑ 1.0 1 9

Limit (cost=1,611,099.11..1,611,099.12 rows=1 width=8) (actual time=1,445.590..1,445.592 rows=1 loops=9)

6. 174.978 13,010.292 ↑ 1.0 1 9

Aggregate (cost=1,611,099.11..1,611,099.12 rows=1 width=8) (actual time=1,445.588..1,445.588 rows=1 loops=9)

7. 12,835.314 12,835.314 ↑ 3.7 136,897 9

Index Only Scan using event_series_created_on_key on event_series (cost=0.57..1,609,849.04 rows=500,029 width=0) (actual time=1.849..1,426.146 rows=136,897 loops=9)

  • Index Cond: ((created_at < days.date) AND (created_at > (days.date - '1 day'::interval)) AND (key = 'key6'::text))
  • Heap Fetches: 1232074
Planning time : 0.224 ms
Execution time : 13,010.541 ms