explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yk7v

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 19,931.360 ↑ 1.0 2 1

Append (cost=706,401.18..1,412,802.40 rows=2 width=8) (actual time=9,903.962..19,931.360 rows=2 loops=1)

2. 8,524.413 9,903.961 ↑ 1.0 1 1

Aggregate (cost=706,401.18..706,401.19 rows=1 width=8) (actual time=9,903.961..9,903.961 rows=1 loops=1)

  • Output: sum(st_length(makearc((lag(points.geom) OVER (?)), points.geom, (lead(points.geom) OVER (?)), NULL::integer)))
3. 618.709 1,379.548 ↑ 1.0 1,000,000 1

WindowAgg (cost=168,901.18..193,901.18 rows=1,000,000 width=104) (actual time=647.592..1,379.548 rows=1,000,000 loops=1)

  • Output: lag(points.geom) OVER (?), points.geom, lead(points.geom) OVER (?), points.kpi, ((points.kpi % 3))
4. 491.171 760.839 ↑ 1.0 1,000,000 1

Sort (cost=168,901.18..171,401.18 rows=1,000,000 width=40) (actual time=647.557..760.839 rows=1,000,000 loops=1)

  • Output: points.kpi, ((points.kpi % 3)), points.geom
  • Sort Key: ((points.kpi % 3)), points.kpi
  • Sort Method: external merge Disk: 46024kB
5. 146.730 269.668 ↑ 1.0 1,000,000 1

Gather (cost=10.00..14,552.33 rows=1,000,000 width=40) (actual time=186.269..269.668 rows=1,000,000 loops=1)

  • Output: points.kpi, ((points.kpi % 3)), points.geom
  • Workers Planned: 2
  • Workers Launched: 2
  • JIT for worker 0:
  • Functions: 2
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 0.217 ms, Inlining 29.188 ms, Optimization 9.995 ms, Emission 5.651 ms, Total 45.050 ms
  • JIT for worker 1:
  • Functions: 2
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 0.218 ms, Inlining 28.447 ms, Optimization 10.188 ms, Emission 5.635 ms, Total 44.488 ms
6. 122.938 122.938 ↑ 1.3 333,333 3

Parallel Seq Scan on public.points (cost=0.00..13,542.33 rows=416,667 width=40) (actual time=91.817..122.938 rows=333,333 loops=3)

  • Output: points.kpi, (points.kpi % 3), points.geom
  • Worker 0: actual time=44.962..92.463 rows=506400 loops=1
  • Worker 1: actual time=44.384..90.217 rows=493480 loops=1
7. 8,758.656 10,027.396 ↑ 1.0 1 1

Aggregate (cost=706,401.18..706,401.19 rows=1 width=8) (actual time=10,027.396..10,027.396 rows=1 loops=1)

  • Output: sum(st_length(makearc((lag(points_1.geom) OVER (?)), points_1.geom, (lead(points_1.geom) OVER (?)), NULL::integer)))
8. 1,268.740 1,268.740 ↑ 1.0 1,000,000 1

WindowAgg (cost=168,901.18..193,901.18 rows=1,000,000 width=104) (actual time=529.972..1,268.740 rows=1,000,000 loops=1)