explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sK1

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1.294 ↓ 0.0 0 1

Limit (cost=3,743.15..3,773.61 rows=1 width=4) (actual time=1.294..1.294 rows=0 loops=1)

  • Buffers: shared hit=1
2.          

CTE restricted_projects

3. 0.008 0.957 ↑ 1,280.0 1 1

Hash Join (cost=3,464.90..3,572.66 rows=1,280 width=4) (actual time=0.957..0.957 rows=1 loops=1)

  • Hash Cond: (projects.namespace_id = gitlab_secondary_namespaces.id)
4. 0.433 0.433 ↑ 2,560.0 1 1

Foreign Scan on projects (cost=100.00..186.80 rows=2,560 width=8) (actual time=0.433..0.433 rows=1 loops=1)

5. 0.001 0.516 ↑ 200.0 1 1

Hash (cost=3,362.40..3,362.40 rows=200 width=4) (actual time=0.516..0.516 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.003 0.515 ↑ 200.0 1 1

HashAggregate (cost=3,360.40..3,362.40 rows=200 width=4) (actual time=0.515..0.515 rows=1 loops=1)

  • Group Key: gitlab_secondary_namespaces.id
7. 0.512 0.512 ↑ 19,215.0 1 1

CTE Scan on base_and_descendants gitlab_secondary_namespaces (cost=2,735.91..3,120.21 rows=19,215 width=4) (actual time=0.195..0.512 rows=1 loops=1)

8.          

CTE base_and_descendants

9. 0.001 0.511 ↑ 19,215.0 1 1

Recursive Union (cost=100.00..2,735.91 rows=19,215 width=4) (actual time=0.194..0.511 rows=1 loops=1)

10. 0.193 0.193 ↑ 15.0 1 1

Foreign Scan on geo_node_namespace_links (cost=100.00..146.86 rows=15 width=4) (actual time=0.193..0.193 rows=1 loops=1)

11. 0.006 0.317 ↓ 0.0 0 1

Hash Join (cost=104.88..220.47 rows=1,920 width=4) (actual time=0.317..0.317 rows=0 loops=1)

  • Hash Cond: (namespaces.parent_id = base_and_descendants.id)
12. 0.309 0.309 ↑ 41.3 62 1

Foreign Scan on namespaces (cost=100.00..186.80 rows=2,560 width=8) (actual time=0.306..0.309 rows=62 loops=1)

13. 0.002 0.002 ↑ 150.0 1 1

Hash (cost=3.00..3.00 rows=150 width=4) (actual time=0.002..0.002 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.000 0.000 ↑ 150.0 1 1

WorkTable Scan on base_and_descendants (cost=0.00..3.00 rows=150 width=4) (actual time=0.000..0.000 rows=1 loops=1)

15. 0.002 1.293 ↓ 0.0 0 1

Hash Join (cost=170.49..200.95 rows=1 width=4) (actual time=1.293..1.293 rows=0 loops=1)

  • Hash Cond: (restricted_projects.id = ci_job_artifacts.project_id)
  • Buffers: shared hit=1
16. 0.958 0.958 ↑ 1,280.0 1 1

CTE Scan on restricted_projects (cost=0.00..25.60 rows=1,280 width=4) (actual time=0.958..0.958 rows=1 loops=1)

17. 0.000 0.333 ↓ 0.0 0 1

Hash (cost=170.48..170.48 rows=1 width=8) (actual time=0.333..0.333 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=1
18. 0.007 0.333 ↓ 0.0 0 1

Hash Right Join (cost=148.69..170.48 rows=1 width=8) (actual time=0.333..0.333 rows=0 loops=1)

  • Hash Cond: (job_artifact_registry.artifact_id = ci_job_artifacts.id)
  • Filter: (job_artifact_registry.id IS NULL)
  • Rows Removed by Filter: 8
  • Buffers: shared hit=1
19. 0.019 0.019 ↑ 103.8 8 1

Seq Scan on job_artifact_registry (cost=0.00..18.30 rows=830 width=8) (actual time=0.018..0.019 rows=8 loops=1)

  • Buffers: shared hit=1
20. 0.002 0.307 ↑ 1.1 8 1

Hash (cost=148.58..148.58 rows=9 width=8) (actual time=0.307..0.307 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.305 0.305 ↑ 1.1 8 1

Foreign Scan on ci_job_artifacts (cost=100.00..148.58 rows=9 width=8) (actual time=0.304..0.305 rows=8 loops=1)

Planning time : 0.217 ms
Execution time : 1.703 ms