explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VZwj

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.218 158.930 ↑ 12.1 356 1

WindowAgg (cost=19,942.76..21,178.72 rows=4,299 width=108) (actual time=157.715..158.930 rows=356 loops=1)

2. 0.108 157.712 ↑ 12.1 356 1

Sort (cost=19,942.76..19,953.51 rows=4,299 width=84) (actual time=157.692..157.712 rows=356 loops=1)

  • Sort Key: a.service_data_id, a.five_min
  • Sort Method: quicksort Memory: 75kB
3. 0.057 157.604 ↑ 12.1 356 1

Subquery Scan on a (cost=18,188.86..19,683.32 rows=4,299 width=84) (actual time=155.865..157.604 rows=356 loops=1)

4. 0.448 157.547 ↑ 12.1 356 1

WindowAgg (cost=18,188.86..19,640.33 rows=4,299 width=84) (actual time=155.864..157.547 rows=356 loops=1)

5. 0.629 157.099 ↑ 12.1 356 1

Finalize GroupAggregate (cost=18,188.86..19,479.12 rows=4,299 width=44) (actual time=155.847..157.099 rows=356 loops=1)

  • Group Key: service_data.service_data_id, (time_bucket('00:05:00'::interval, service_data.measured_at))
6. 0.911 156.470 ↑ 10.5 356 1

Gather Merge (cost=18,188.86..18,806.89 rows=3,736 width=268) (actual time=155.821..156.470 rows=356 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
7. 0.532 155.559 ↑ 5.2 356 1

Partial GroupAggregate (cost=17,188.84..17,375.64 rows=1,868 width=268) (actual time=155.023..155.559 rows=356 loops=1)

  • Group Key: service_data.service_data_id, (time_bucket('00:05:00'::interval, service_data.measured_at))
8. 0.166 155.027 ↑ 5.2 356 1

Sort (cost=17,188.84..17,193.51 rows=1,868 width=268) (actual time=155.003..155.027 rows=356 loops=1)

  • Sort Key: (time_bucket('00:05:00'::interval, service_data.measured_at))
  • Sort Method: quicksort Memory: 119kB
9. 154.861 154.861 ↑ 5.2 356 1

Parallel Seq Scan on service_data (cost=0.00..17,087.34 rows=1,868 width=268) (actual time=150.632..154.861 rows=356 loops=1)

  • Filter: ((service_data_id = (current_setting('snap.service_data_id'::text))::integer) AND (time_bucket('00:05:00'::interval, measured_at) > (current_setting('snap.from_ts'::text))::timestamp without time zone))
  • Rows Removed by Filter: 479,377
Planning time : 0.905 ms
Execution time : 159.258 ms