explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W9HX

Settings
# exclusive inclusive rows x rows loops node
1. 5.151 3,115.898 ↑ 1.0 1 1

Aggregate (cost=10,000,000,009.61..10,000,000,009.62 rows=1 width=32) (actual time=3,115.898..3,115.898 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.118 0.119 ↓ 2.9 90 1

Recursive Union (cost=0.00..2.95 rows=31 width=4) (actual time=0.003..0.119 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.520 1.479 ↓ 2,607.0 2,607 1

Nested Loop (cost=10,000,000,000.00..10,000,000,001.56 rows=1 width=8) (actual time=0.033..1.479 rows=2,607 loops=1)

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

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

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

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

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

CTE rawrays

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

CTE Scan on pixels (cost=0.00..0.06 rows=1 width=104) (actual time=0.042..7.076 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. 12.220 12.220 ↓ 2,607.0 2,607 1

CTE Scan on rawrays (cost=0.00..0.04 rows=1 width=136) (actual time=0.049..12.220 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. 18.776 18.776 ↓ 2,607.0 2,607 1

CTE Scan on norms (cost=0.00..0.03 rows=1 width=104) (actual time=0.055..18.776 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. 17.274 2,732.062 ↓ 3,792.0 41,712 1

Recursive Union (cost=0.00..4.09 rows=11 width=44) (actual time=0.058..2,732.062 rows=41,712 loops=1)

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

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

  • Output: rays."row", rays.col, 0, 0.0
19. 2,685.226 2,694.208 ↓ 2,444.0 2,444 16

Hash Join (cost=0.04..0.39 rows=1 width=44) (actual time=0.086..168.388 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)))
  • Hash Cond: ((iters."row" = rays_1."row") AND (iters.col = rays_1.col))
20. 8.192 8.192 ↓ 814.7 2,444 16

WorkTable Scan on iters (cost=0.00..0.22 rows=3 width=44) (actual time=0.014..0.512 rows=2,444 loops=16)

  • Output: iters."row", iters.col, iters.it, iters.v
  • Filter: (iters.it < 15)
  • Rows Removed by Filter: 163
21. 0.526 0.790 ↓ 2,607.0 2,607 1

Hash (cost=0.02..0.02 rows=1 width=104) (actual time=0.790..0.790 rows=2,607 loops=1)

  • Output: rays_1."row", rays_1.col, rays_1.x, rays_1.y, rays_1.z
  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 234kB
22. 0.264 0.264 ↓ 2,607.0 2,607 1

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

  • Output: rays_1."row", rays_1.col, rays_1.x, rays_1.y, rays_1.z
23.          

CTE lastiters

24. 1.708 2,783.226 ↓ 2,607.0 2,607 1

Hash Join (cost=0.53..0.81 rows=1 width=104) (actual time=2,778.815..2,783.226 rows=2,607 loops=1)

  • Output: it0."row", it0.col, it0.v, it1.v, it2.v
  • Hash Cond: ((it0.col = it2.col) AND (it0."row" = it2."row"))
25. 1.420 17.573 ↓ 2,607.0 2,607 1

Hash Join (cost=0.26..0.53 rows=1 width=80) (actual time=14.855..17.573 rows=2,607 loops=1)

  • Output: it0."row", it0.col, it0.v, it1.v, it1.col, it1."row
  • Hash Cond: ((it0.col = it1.col) AND (it0."row" = it1."row"))
26. 9.375 9.375 ↓ 2,607.0 2,607 1

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

  • Output: it0."row", it0.col, it0.it, it0.v
  • Filter: (it0.it = 15)
  • Rows Removed by Filter: 39105
27. 1.698 6.778 ↓ 2,607.0 2,607 1

Hash (cost=0.25..0.25 rows=1 width=40) (actual time=6.778..6.778 rows=2,607 loops=1)

  • Output: it1.v, it1.col, it1."row
  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 884kB
28. 5.080 5.080 ↓ 2,607.0 2,607 1

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

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

Hash (cost=0.25..0.25 rows=1 width=40) (actual time=2,763.945..2,763.945 rows=2,607 loops=1)

  • Output: it2.v, it2.col, it2."row
  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 858kB
30. 2,761.650 2,761.650 ↓ 2,607.0 2,607 1

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

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

CTE res

32. 3,108.838 3,108.838 ↓ 2,607.0 2,607 1

CTE Scan on lastiters (cost=0.00..0.03 rows=1 width=36) (actual time=2,778.827..3,108.838 rows=2,607 loops=1)

  • Output: lastiters.col, ((lastiters.v0 - lastiters.v1) / (lastiters.v1 - lastiters.v2))
33. 3,110.747 3,110.747 ↓ 2,607.0 2,607 1

CTE Scan on res (cost=0.00..0.02 rows=1 width=36) (actual time=2,778.831..3,110.747 rows=2,607 loops=1)

  • Output: res.col, res.v