explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9KPN

Settings
# exclusive inclusive rows x rows loops node
1. 2.287 241,333.705 ↓ 2.9 575 1

Sort (cost=73,396.70..73,397.20 rows=200 width=76) (actual time=241,333.600..241,333.705 rows=575 loops=1)

  • Sort Key: merged.nb_stops DESC
  • Sort Method: quicksort Memory: 5405kB
2.          

CTE stops

3. 6,955.781 6,955.781 ↓ 1.2 47,739 1

Index Scan using history_place_stops_history_place_id_idx on history_place_stops (cost=0.42..70,184.33 rows=39,147 width=1,720) (actual time=12.516..6,955.781 rows=47,739 loops=1)

  • Index Cond: (history_place_id = 168436)
  • Filter: (ellipse_95 IS NOT NULL)
  • Rows Removed by Filter: 28271
4.          

CTE clustered

5. 202,696.896 209,959.858 ↓ 1.2 47,739 1

WindowAgg (cost=0.00..1,272.28 rows=39,147 width=92) (actual time=209,809.691..209,959.858 rows=47,739 loops=1)

6. 7,262.962 7,262.962 ↓ 1.2 47,739 1

CTE Scan on stops (cost=0.00..782.94 rows=39,147 width=88) (actual time=12.524..7,262.962 rows=47,739 loops=1)

7.          

CTE merged

8. 30,665.006 240,841.445 ↓ 2.9 575 1

HashAggregate (cost=1,172.45..1,175.95 rows=200 width=76) (actual time=210,338.752..240,841.445 rows=575 loops=1)

  • Group Key: clustered.cluster_id
9. 210,176.439 210,176.439 ↓ 1.2 47,659 1

CTE Scan on clustered (cost=0.00..782.94 rows=38,951 width=40) (actual time=209,809.701..210,176.439 rows=47,659 loops=1)

  • Filter: (cluster_id IS NOT NULL)
  • Rows Removed by Filter: 80
10. 241,331.418 241,331.418 ↓ 2.9 575 1

CTE Scan on merged (cost=0.00..756.50 rows=200 width=76) (actual time=210,342.529..241,331.418 rows=575 loops=1)

Planning time : 2.552 ms
Execution time : 241,631.360 ms