explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dgXd

Settings
# exclusive inclusive rows x rows loops node
1. 11.042 232.490 ↑ 1.0 5,000 1

Merge Left Join (cost=182.16..262.16 rows=5,000 width=8) (actual time=144.369..232.490 rows=5,000 loops=1)

  • Merge Cond: (s1.r1 = s2.i)
2.          

CTE s1

3. 3.053 3.053 ↓ 5.0 5,000 1

Function Scan on generate_series s (cost=0.00..25.00 rows=1,000 width=8) (actual time=0.485..3.053 rows=5,000 loops=1)

4.          

CTE s2

5. 96.867 96.867 ↓ 60.0 60,000 1

Function Scan on generate_series s_1 (cost=0.00..17.50 rows=1,000 width=8) (actual time=8.408..96.867 rows=60,000 loops=1)

6. 2.243 7.098 ↓ 5.0 5,000 1

Sort (cost=69.83..72.33 rows=1,000 width=8) (actual time=6.141..7.098 rows=5,000 loops=1)

  • Sort Key: s1.r1
  • Sort Method: quicksort Memory: 427kB
7. 4.855 4.855 ↓ 5.0 5,000 1

CTE Scan on s1 (cost=0.00..20.00 rows=1,000 width=8) (actual time=0.489..4.855 rows=5,000 loops=1)

8. 88.859 214.350 ↓ 50.2 50,250 1

Sort (cost=69.83..72.33 rows=1,000 width=8) (actual time=138.217..214.350 rows=50,250 loops=1)

  • Sort Key: s2.i
  • Sort Method: quicksort Memory: 4,349kB
9. 125.491 125.491 ↓ 60.0 60,000 1

CTE Scan on s2 (cost=0.00..20.00 rows=1,000 width=8) (actual time=8.412..125.491 rows=60,000 loops=1)

Planning time : 0.223 ms
Execution time : 234.380 ms