explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sggY

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 0.307 ↑ 1.0 1 1

GroupAggregate (cost=124.40..124.43 rows=1 width=556) (actual time=0.305..0.307 rows=1 loops=1)

  • Group Key: event.id
2.          

CTE schedules

3. 0.048 0.167 ↑ 25.0 4 1

HashAggregate (cost=8.32..11.32 rows=100 width=40) (actual time=0.159..0.167 rows=4 loops=1)

  • Group Key: (schedule_n.n / 2)
4. 0.046 0.119 ↑ 12.5 8 1

Subquery Scan on schedule_n (cost=4.32..7.57 rows=100 width=40) (actual time=0.038..0.119 rows=8 loops=1)

5. 0.017 0.073 ↑ 12.5 8 1

WindowAgg (cost=4.32..6.32 rows=100 width=40) (actual time=0.035..0.073 rows=8 loops=1)

6. 0.039 0.056 ↑ 12.5 8 1

Sort (cost=4.32..4.57 rows=100 width=32) (actual time=0.030..0.056 rows=8 loops=1)

  • Sort Key: arr_schedule.arr_schedule
  • Sort Method: quicksort Memory: 25kB
7. 0.017 0.017 ↑ 12.5 8 1

Function Scan on unnest arr_schedule (cost=0.00..1.00 rows=100 width=32) (actual time=0.011..0.017 rows=8 loops=1)

8. 0.009 0.293 ↑ 1.0 1 1

Sort (cost=113.08..113.08 rows=1 width=540) (actual time=0.291..0.293 rows=1 loops=1)

  • Sort Key: event.id
  • Sort Method: quicksort Memory: 25kB
9. 0.004 0.284 ↑ 1.0 1 1

Nested Loop (cost=0.14..113.07 rows=1 width=540) (actual time=0.179..0.284 rows=1 loops=1)

10. 0.051 0.273 ↑ 1.0 1 1

Nested Loop Semi Join (cost=0.00..112.40 rows=1 width=24) (actual time=0.171..0.273 rows=1 loops=1)

  • Join Filter: (schedules.rng && tsrange(eff.start_date_time, eff.end_date_time))
  • Rows Removed by Join Filter: 44
11. 0.018 0.018 ↑ 3.3 12 1

Seq Scan on effective_schedule eff (cost=0.00..10.40 rows=40 width=24) (actual time=0.006..0.018 rows=12 loops=1)

12. 0.204 0.204 ↑ 25.0 4 12

CTE Scan on schedules (cost=0.00..2.00 rows=100 width=32) (actual time=0.014..0.017 rows=4 loops=12)

13. 0.007 0.007 ↑ 1.0 1 1

Index Scan using "eventPK" on event (cost=0.14..0.66 rows=1 width=524) (actual time=0.005..0.007 rows=1 loops=1)

  • Index Cond: (id = eff.event_id)
Planning time : 0.186 ms
Execution time : 0.414 ms