explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EL67

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.155 ↑ 11.0 1 1

Limit (cost=971.52..971.74 rows=11 width=2,954) (actual time=0.103..0.155 rows=1 loops=1)

2.          

CTE base_and_descendants

3. 0.014 0.148 ↑ 501.0 1 1

Recursive Union (cost=0.43..971.52 rows=501 width=344) (actual time=0.097..0.148 rows=1 loops=1)

4. 0.084 0.084 ↑ 1.0 1 1

Index Scan using namespaces_pkey on namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=344) (actual time=0.084..0.084 rows=1 loops=1)

  • Index Cond: (id = 1,503,835)
5. 0.002 0.050 ↓ 0.0 0 1

Nested Loop (cost=0.43..95.81 rows=50 width=344) (actual time=0.050..0.050 rows=0 loops=1)

6. 0.002 0.002 ↑ 10.0 1 1

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.001..0.002 rows=1 loops=1)

7. 0.046 0.046 ↓ 0.0 0 1

Index Scan using index_namespaces_on_parent_id_and_id on namespaces namespaces_2 (cost=0.43..9.51 rows=5 width=344) (actual time=0.046..0.046 rows=0 loops=1)

  • Index Cond: (parent_id = base_and_descendants.id)
8. 0.153 0.153 ↑ 501.0 1 1

CTE Scan on base_and_descendants namespaces (cost=0.00..10.02 rows=501 width=2,954) (actual time=0.102..0.153 rows=1 loops=1)

Planning time : 3.168 ms
Execution time : 0.719 ms