explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OY6W

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 0.277 ↑ 1.0 1 1

Aggregate (cost=60.38..60.39 rows=1 width=0) (actual time=0.277..0.277 rows=1 loops=1)

2.          

CTE temp

3. 0.018 0.259 ↑ 10.1 10 1

Recursive Union (cost=0.43..58.11 rows=101 width=8) (actual time=0.033..0.259 rows=10 loops=1)

4. 0.001 0.031 ↑ 1.0 1 1

Limit (cost=0.43..0.48 rows=1 width=8) (actual time=0.031..0.031 rows=1 loops=1)

5. 0.030 0.030 ↑ 9,999,985.0 1 1

Index Only Scan using ints_n_idx on ints (cost=0.43..435,358.01 rows=9,999,985 width=8) (actual time=0.030..0.030 rows=1 loops=1)

  • Heap Fetches: 1
6. 0.020 0.210 ↑ 10.0 1 10

Nested Loop (cost=0.43..5.56 rows=10 width=8) (actual time=0.020..0.021 rows=1 loops=10)

7. 0.000 0.000 ↑ 10.0 1 10

WorkTable Scan on temp temp_1 (cost=0.00..0.20 rows=10 width=8) (actual time=0.000..0.000 rows=1 loops=10)

8. 0.010 0.190 ↑ 1.0 1 10

Limit (cost=0.43..0.52 rows=1 width=8) (actual time=0.019..0.019 rows=1 loops=10)

9. 0.180 0.180 ↑ 3,333,328.0 1 10

Index Only Scan using ints_n_idx on ints ints_1 (cost=0.43..270,273.66 rows=3,333,328 width=8) (actual time=0.018..0.018 rows=1 loops=10)

  • Index Cond: (n > temp_1.i)
  • Heap Fetches: 9
10. 0.269 0.269 ↑ 10.1 10 1

CTE Scan on temp (cost=0.00..2.02 rows=101 width=0) (actual time=0.036..0.269 rows=10 loops=1)