explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q7Aj

Settings
# exclusive inclusive rows x rows loops node
1. 9.095 11,576.726 ↓ 365.3 73,057 1

Group (cost=322,969.63..322,973.13 rows=200 width=40) (actual time=11,562.361..11,576.726 rows=73,057 loops=1)

  • Group Key: q.block, q.from_time, q.to_time, q.busy, ((q.block - q.busy))
2. 34.380 11,567.631 ↓ 365.3 73,057 1

Sort (cost=322,969.63..322,970.13 rows=200 width=40) (actual time=11,562.359..11,567.631 rows=73,057 loops=1)

  • Sort Key: q.block DESC, q.from_time, q.to_time, q.busy, ((q.block - q.busy))
  • Sort Method: external merge Disk: 3,584kB
3. 4.431 11,533.251 ↓ 365.3 73,057 1

Subquery Scan on q (cost=322,957.49..322,961.99 rows=200 width=40) (actual time=11,517.095..11,533.251 rows=73,057 loops=1)

4. 85.078 11,528.820 ↓ 365.3 73,057 1

HashAggregate (cost=322,957.49..322,959.49 rows=200 width=40) (actual time=11,517.094..11,528.820 rows=73,057 loops=1)

  • Group Key: time_series.from_time, time_series.to_time
5. 7,845.987 11,443.742 ↑ 5.7 100,918 1

Nested Loop Left Join (cost=0.25..25,941.83 rows=575,333 width=36) (actual time=13.289..11,443.742 rows=100,918 loops=1)

  • Join Filter: ""overlaps""(at.from_time, at.to_time, time_series.from_time, time_series.to_time)
  • Rows Removed by Join Filter: 125,404,821
6. 17.962 17.962 ↓ 73.1 73,057 1

Function Scan on calendar_times time_series (cost=0.25..10.25 rows=1,000 width=16) (actual time=12.800..17.962 rows=73,057 loops=1)

7. 3,579.619 3,579.793 ↑ 1.0 1,717 73,057

Materialize (cost=0.00..45.89 rows=1,726 width=20) (actual time=0.000..0.049 rows=1,717 loops=73,057)

8. 0.174 0.174 ↑ 1.0 1,717 1

Seq Scan on appointment_timeslots at (cost=0.00..37.26 rows=1,726 width=20) (actual time=0.010..0.174 rows=1,717 loops=1)

Planning time : 0.098 ms
Execution time : 11,579.477 ms