explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Nnsg : ray trace

Settings
# exclusive inclusive rows x rows loops node
1. 2.274 132.273 ↑ 1.0 1 1

Aggregate (cost=10,000,000,139.44..10,000,000,139.45 rows=1 width=16) (actual time=132.273..132.273 rows=1 loops=1)

2.          

CTE numbers

3. 0.053 0.053 ↑ 11.1 90 1

Function Scan on generate_series gs (cost=0.00..10.00 rows=1,000 width=4) (actual time=0.040..0.053 rows=90 loops=1)

4.          

CTE pixels

5. 0.494 1.728 ↓ 104.3 2,607 1

Nested Loop (cost=10,000,000,000.00..10,000,000,050.45 rows=25 width=8) (actual time=0.065..1.728 rows=2,607 loops=1)

6. 0.079 0.079 ↓ 6.6 33 1

CTE Scan on numbers rows (cost=0.00..25.00 rows=5 width=4) (actual time=0.054..0.079 rows=33 loops=1)

  • Filter: ((n > 4) AND (n < 38))
  • Rows Removed by Filter: 57
7. 1.155 1.155 ↓ 15.8 79 33

CTE Scan on numbers cols (cost=0.00..25.00 rows=5 width=4) (actual time=0.003..0.035 rows=79 loops=33)

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

CTE rawrays

9. 7.395 7.395 ↓ 104.3 2,607 1

CTE Scan on pixels (cost=0.00..1.44 rows=25 width=8) (actual time=0.085..7.395 rows=2,607 loops=1)

10.          

CTE norms

11. 11.752 11.752 ↓ 104.3 2,607 1

CTE Scan on rawrays (cost=0.00..0.94 rows=25 width=32) (actual time=0.098..11.752 rows=2,607 loops=1)

12.          

CTE rays

13. 15.330 15.330 ↓ 104.3 2,607 1

CTE Scan on norms (cost=0.00..0.69 rows=25 width=40) (actual time=0.103..15.330 rows=2,607 loops=1)

14.          

CTE iters

15. 6.880 100.697 ↓ 1,191.8 41,712 1

Recursive Union (cost=0.00..73.42 rows=35 width=44) (actual time=0.108..100.697 rows=41,712 loops=1)

16. 17.737 17.737 ↓ 104.3 2,607 1

CTE Scan on rays (cost=0.00..0.50 rows=25 width=8) (actual time=0.106..17.737 rows=2,607 loops=1)

17. 70.338 76.080 ↓ 2,444.0 2,444 16

Hash Join (cost=0.88..7.22 rows=1 width=44) (actual time=0.077..4.755 rows=2,444 loops=16)

  • Hash Cond: ((iters."row" = rays_1."row") AND (iters.col = rays_1.col))
18. 4.752 4.752 ↓ 29.4 2,444 16

WorkTable Scan on iters (cost=0.00..5.63 rows=83 width=20) (actual time=0.009..0.297 rows=2,444 loops=16)

  • Filter: (it < 15)
  • Rows Removed by Filter: 163
19. 0.664 0.990 ↓ 104.3 2,607 1

Hash (cost=0.50..0.50 rows=25 width=32) (actual time=0.990..0.990 rows=2,607 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 163kB
20. 0.326 0.326 ↓ 104.3 2,607 1

CTE Scan on rays rays_1 (cost=0.00..0.50 rows=25 width=32) (actual time=0.000..0.326 rows=2,607 loops=1)

21.          

CTE lastiters

22. 0.798 128.268 ↓ 2,607.0 2,607 1

Hash Join (cost=1.60..2.43 rows=1 width=32) (actual time=126.396..128.268 rows=2,607 loops=1)

  • Hash Cond: ((it0.col = it2.col) AND (it0."row" = it2."row"))
23. 0.700 9.782 ↓ 2,607.0 2,607 1

Hash Join (cost=0.80..1.61 rows=1 width=32) (actual time=8.685..9.782 rows=2,607 loops=1)

  • Hash Cond: ((it0.col = it1.col) AND (it0."row" = it1."row"))
24. 4.479 4.479 ↓ 2,607.0 2,607 1

CTE Scan on iters it0 (cost=0.00..0.79 rows=1 width=16) (actual time=4.070..4.479 rows=2,607 loops=1)

  • Filter: (it = 15)
  • Rows Removed by Filter: 39105
25. 0.371 4.603 ↓ 2,607.0 2,607 1

Hash (cost=0.79..0.79 rows=1 width=16) (actual time=4.603..4.603 rows=2,607 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 123kB
26. 4.232 4.232 ↓ 2,607.0 2,607 1

CTE Scan on iters it1 (cost=0.00..0.79 rows=1 width=16) (actual time=3.473..4.232 rows=2,607 loops=1)

  • Filter: (it = 14)
  • Rows Removed by Filter: 39105
27. 0.376 117.688 ↓ 2,607.0 2,607 1

Hash (cost=0.79..0.79 rows=1 width=16) (actual time=117.688..117.688 rows=2,607 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 123kB
28. 117.312 117.312 ↓ 2,607.0 2,607 1

CTE Scan on iters it2 (cost=0.00..0.79 rows=1 width=16) (actual time=100.162..117.312 rows=2,607 loops=1)

  • Filter: (it = 13)
  • Rows Removed by Filter: 39105
29.          

CTE res

30. 129.259 129.259 ↓ 2,607.0 2,607 1

CTE Scan on lastiters (cost=0.00..0.03 rows=1 width=32) (actual time=126.400..129.259 rows=2,607 loops=1)

31. 129.999 129.999 ↓ 2,607.0 2,607 1

CTE Scan on res (cost=0.00..0.02 rows=1 width=16) (actual time=126.403..129.999 rows=2,607 loops=1)