explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZsTo

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 6,806.714 ↓ 0.0 0 1

Limit (cost=972.38..998.68 rows=1 width=4) (actual time=6,806.706..6,806.714 rows=0 loops=1)

2. 0.008 6,806.713 ↓ 0.0 0 1

Nested Loop Semi Join (cost=972.38..974,420.01 rows=37,016 width=4) (actual time=6,806.705..6,806.713 rows=0 loops=1)

  • Join Filter: (projects.namespace_id = namespaces.id)
3. 801.424 6,806.705 ↓ 0.0 0 1

Merge Anti Join (cost=0.86..417,074.21 rows=74,033 width=4) (actual time=6,806.704..6,806.705 rows=0 loops=1)

  • Merge Cond: (projects.id = project_pages_metadata.project_id)
4. 5,568.637 5,568.637 ↑ 1.0 3,089,363 1

Index Scan using projects_pkey on projects (cost=0.43..297,389.60 rows=3,162,213 width=8) (actual time=0.056..5,568.637 rows=3,089,363 loops=1)

5. 436.644 436.644 ↓ 1.0 3,089,363 1

Index Only Scan using index_project_pages_metadata_on_project_id on project_pages_metadata (cost=0.43..73,176.83 rows=3,088,180 width=8) (actual time=0.018..436.644 rows=3,089,363 loops=1)

  • Heap Fetches: 39,142
6. 0.000 0.000 ↓ 0.0 0

Materialize (cost=971.52..989.06 rows=501 width=4) (never executed)

7. 0.000 0.000 ↓ 0.0 0

CTE Scan on base_and_descendants namespaces (cost=971.52..981.54 rows=501 width=4) (never executed)

8.          

CTE base_and_descendants

9. 0.000 0.000 ↓ 0.0 0

Recursive Union (cost=0.43..971.52 rows=501 width=344) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Index Scan using namespaces_pkey on namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=344) (never executed)

  • Index Cond: (id = 1,503,835)
11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..95.81 rows=50 width=344) (never executed)

12. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Index Scan using index_namespaces_on_parent_id_and_id on namespaces namespaces_2 (cost=0.43..9.51 rows=5 width=344) (never executed)

  • Index Cond: (parent_id = base_and_descendants.id)
Planning time : 1.661 ms
Execution time : 6,807.018 ms