explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FFJN

Settings
# exclusive inclusive rows x rows loops node
1. 28.266 52,989.105 ↑ 1.0 1 1

Aggregate (cost=9.55..9.56 rows=1 width=32) (actual time=52,989.104..52,989.105 rows=1 loops=1)

2.          

CTE numbers

3. 0.113 0.114 ↓ 2.9 90 1

Recursive Union (cost=0.00..2.95 rows=31 width=4) (actual time=0.002..0.114 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)

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)

  • Filter: (n < 89)
  • Rows Removed by Filter: 0
6.          

CTE pixels

7. 0.636 1.933 ↓ 2,607.0 2,607 1

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

8. 0.043 0.043 ↓ 33.0 33 1

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

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

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

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

CTE rawrays

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

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

12.          

CTE norms

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

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

14.          

CTE rays

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

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

16.          

CTE iters

17. 30.525 16,441.538 ↓ 3,792.0 41,712 1

Recursive Union (cost=0.00..4.07 rows=11 width=44) (actual time=0.033..16,441.538 rows=41,712 loops=1)

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

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

19. 7,275.680 16,388.720 ↓ 2,444.0 2,444 16

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

  • Join Filter: ((iters."row" = rays_1."row") AND (iters.col = rays_1.col))
  • Rows Removed by Join Filter: 6369227
20. 19.824 19.824 ↓ 2,607.0 2,607 16

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

21. 9,093.216 9,093.216 ↓ 814.7 2,444 41,712

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

  • Filter: (it < 15)
  • Rows Removed by Filter: 163
22.          

CTE lastiters

23. 349.758 52,679.562 ↓ 2,607.0 2,607 1

Nested Loop (cost=0.00..0.77 rows=1 width=104) (actual time=14,747.427..52,679.562 rows=2,607 loops=1)

  • Join Filter: ((it0.col = it2.col) AND (it0."row" = it2."row"))
  • Rows Removed by Join Filter: 6793842
24. 347.442 32,441.001 ↓ 2,607.0 2,607 1

Nested Loop (cost=0.00..0.51 rows=1 width=80) (actual time=14,742.384..32,441.001 rows=2,607 loops=1)

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

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

  • Filter: (it = 15)
  • Rows Removed by Filter: 39105
26. 17,354.799 17,354.799 ↓ 2,607.0 2,607 2,607

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

  • Filter: (it = 14)
  • Rows Removed by Filter: 39105
27. 19,888.803 19,888.803 ↓ 2,607.0 2,607 2,607

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

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

CTE res

29. 52,956.604 52,956.604 ↓ 2,607.0 2,607 1

CTE Scan on lastiters (cost=0.00..0.03 rows=1 width=36) (actual time=14,747.442..52,956.604 rows=2,607 loops=1)

30. 52,960.839 52,960.839 ↓ 2,607.0 2,607 1

CTE Scan on res (cost=0.00..0.02 rows=1 width=36) (actual time=14,747.444..52,960.839 rows=2,607 loops=1)