explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 35ly

Settings
# exclusive inclusive rows x rows loops node
1. 9.563 46,603.323 ↑ 1.0 1 1

Aggregate (cost=9.55..9.56 rows=1 width=32) (actual time=46,603.323..46,603.323 rows=1 loops=1)

  • Output: string_agg(("substring"('$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/|()1{}[]?-_+~<>i!lI;:,"^. '::text, (round(('1'::numeric + GREATEST('0'::numeric, LEAST('66'::numeric, (res.v * '67'::numeric)))), 0))::integer, 1) || CASE WHEN (res.col = 88) THEN '
2.          

CTE numbers

3. 0.070 0.071 ↓ 2.9 90 1

Recursive Union (cost=0.00..2.95 rows=31 width=4) (actual time=0.002..0.071 rows=90 loops=1)

4. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: 0
5. 0.000 0.000 ↑ 3.0 1 90

WorkTable Scan on numbers (cost=0.00..0.23 rows=3 width=4) (actual time=0.000..0.000 rows=1 loops=90)

  • Output: (numbers.n + 1)
  • Filter: (numbers.n < 89)
  • Rows Removed by Filter: 0
6.          

CTE pixels

7. 0.418 1.270 ↓ 2,607.0 2,607 1

Nested Loop (cost=0.00..1.56 rows=1 width=8) (actual time=0.021..1.270 rows=2,607 loops=1)

  • Output: rows.n, cols.n
8. 0.027 0.027 ↓ 33.0 33 1

CTE Scan on numbers rows (cost=0.00..0.78 rows=1 width=4) (actual time=0.015..0.027 rows=33 loops=1)

  • Output: rows.n
  • Filter: ((rows.n > 4) AND (rows.n < 38))
  • Rows Removed by Filter: 57
9. 0.825 0.825 ↓ 79.0 79 33

CTE Scan on numbers cols (cost=0.00..0.78 rows=1 width=4) (actual time=0.001..0.025 rows=79 loops=33)

  • Output: cols.n
  • Filter: ((cols.n > 9) AND (cols.n < 89))
  • Rows Removed by Filter: 11
10.          

CTE rawrays

11. 6.270 6.270 ↓ 2,607.0 2,607 1

CTE Scan on pixels (cost=0.00..0.06 rows=1 width=104) (actual time=0.027..6.270 rows=2,607 loops=1)

  • Output: pixels."row", pixels.col, (('-0.9049'::numeric + ((pixels.col)::numeric * 0.0065)) + ((pixels."row")::numeric * 0.0057)), ('-0.1487'::numeric + ((pixels."row")::numeric * '-0.0171'::numeric)), ((0.6713 + ((pixels.col)::numeric * 0.0045)) + ((pixels."row")::numeric * '-0.0081'::numeric))
12.          

CTE norms

13. 10.728 10.728 ↓ 2,607.0 2,607 1

CTE Scan on rawrays (cost=0.00..0.04 rows=1 width=136) (actual time=0.041..10.728 rows=2,607 loops=1)

  • Output: rawrays."row", rawrays.col, rawrays.x, rawrays.y, rawrays.z, (((('1'::numeric + (rawrays.x * rawrays.x)) + (rawrays.y * rawrays.y)) + (rawrays.z * rawrays.z)) / '2'::numeric)
14.          

CTE rays

15. 16.554 16.554 ↓ 2,607.0 2,607 1

CTE Scan on norms (cost=0.00..0.03 rows=1 width=104) (actual time=0.047..16.554 rows=2,607 loops=1)

  • Output: norms."row", norms.col, (norms.x / norms.n), (norms.y / norms.n), (norms.z / norms.n)
16.          

CTE iters

17. 33.140 21,160.846 ↓ 3,792.0 41,712 1

Recursive Union (cost=0.00..4.07 rows=11 width=44) (actual time=0.049..21,160.846 rows=41,712 loops=1)

18. 18.122 18.122 ↓ 2,607.0 2,607 1

CTE Scan on rays (cost=0.00..0.02 rows=1 width=44) (actual time=0.048..18.122 rows=2,607 loops=1)

  • Output: rays."row", rays.col, 0, 0.0
19. 10,308.192 21,109.584 ↓ 2,444.0 2,444 16

Nested Loop (cost=0.00..0.38 rows=1 width=44) (actual time=26.071..1,319.349 rows=2,444 loops=16)

  • Output: rays_1."row", rays_1.col, (iters.it + 1), (iters.v + GREATEST((abs((0.7 + (iters.v * rays_1.x))) - 0.3), (abs((0.7 + (iters.v * rays_1.y))) - 0.3), (abs(('-1.1'::numeric + (iters.v * rays_1.z))) - 0.3), (((- (0.28 + (((((0.7 + (iters.v * rays_1.x)) * (0.7 + (iters.v * rays_1.x))) + ((0.7 + (iters.v * rays_1.y)) * (0.7 + (iters.v * rays_1.y)))) + (('-1.1'::numeric + (iters.v * rays_1.z)) * ('-1.1'::numeric + (iters.v * rays_1.z)))) / 0.28))) / 2.0) + 0.42)))
  • Join Filter: ((iters."row" = rays_1."row") AND (iters.col = rays_1.col))
  • Rows Removed by Join Filter: 6369227
20. 39.696 39.696 ↓ 2,607.0 2,607 16

CTE Scan on rays rays_1 (cost=0.00..0.02 rows=1 width=104) (actual time=0.001..2.481 rows=2,607 loops=16)

  • Output: rays_1."row", rays_1.col, rays_1.x, rays_1.y, rays_1.z
21. 10,761.696 10,761.696 ↓ 814.7 2,444 41,712

WorkTable Scan on iters (cost=0.00..0.22 rows=3 width=44) (actual time=0.010..0.258 rows=2,444 loops=41,712)

  • Output: iters."row", iters.col, iters.it, iters.v
  • Filter: (iters.it < 15)
  • Rows Removed by Filter: 163
22.          

CTE lastiters

23. 497.647 46,258.750 ↓ 2,607.0 2,607 1

Nested Loop (cost=0.00..0.77 rows=1 width=104) (actual time=19,228.266..46,258.750 rows=2,607 loops=1)

  • Output: it0."row", it0.col, it0.v, it1.v, it2.v
  • Join Filter: ((it0.col = it2.col) AND (it0."row" = it2."row"))
  • Rows Removed by Join Filter: 6793842
24. 499.502 31,743.264 ↓ 2,607.0 2,607 1

Nested Loop (cost=0.00..0.51 rows=1 width=80) (actual time=19,224.359..31,743.264 rows=2,607 loops=1)

  • Output: it0."row", it0.col, it0.v, it1.v, it1.col, it1."row
  • Join Filter: ((it0.col = it1.col) AND (it0."row" = it1."row"))
  • Rows Removed by Join Filter: 6793842
25. 19,215.064 19,215.064 ↓ 2,607.0 2,607 1

CTE Scan on iters it0 (cost=0.00..0.25 rows=1 width=40) (actual time=19,214.256..19,215.064 rows=2,607 loops=1)

  • Output: it0."row", it0.col, it0.it, it0.v
  • Filter: (it0.it = 15)
  • Rows Removed by Filter: 39105
26. 12,028.698 12,028.698 ↓ 2,607.0 2,607 2,607

CTE Scan on iters it1 (cost=0.00..0.25 rows=1 width=40) (actual time=3.881..4.614 rows=2,607 loops=2,607)

  • Output: it1."row", it1.col, it1.it, it1.v
  • Filter: (it1.it = 14)
  • Rows Removed by Filter: 39105
27. 14,017.839 14,017.839 ↓ 2,607.0 2,607 2,607

CTE Scan on iters it2 (cost=0.00..0.25 rows=1 width=40) (actual time=3.555..5.377 rows=2,607 loops=2,607)

  • Output: it2."row", it2.col, it2.it, it2.v
  • Filter: (it2.it = 13)
  • Rows Removed by Filter: 39105
28.          

CTE res

29. 46,591.287 46,591.287 ↓ 2,607.0 2,607 1

CTE Scan on lastiters (cost=0.00..0.03 rows=1 width=36) (actual time=19,228.277..46,591.287 rows=2,607 loops=1)

  • Output: lastiters.col, ((lastiters.v0 - lastiters.v1) / (lastiters.v1 - lastiters.v2))
30. 46,593.760 46,593.760 ↓ 2,607.0 2,607 1

CTE Scan on res (cost=0.00..0.02 rows=1 width=36) (actual time=19,228.279..46,593.760 rows=2,607 loops=1)

  • Output: res.col, res.v