explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JCE

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1.076 ↓ 0.0 0 1

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

  • Buffers: shared hit=1
2.          

CTE restricted_projects

3. 0.006 0.849 ↑ 1,280.0 1 1

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

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

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

5. 0.003 0.446 ↑ 200.0 1 1

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

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

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

  • Group Key: gitlab_secondary_namespaces.id
7. 0.440 0.440 ↑ 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.157..0.440 rows=1 loops=1)

8.          

CTE base_and_descendants

9. 0.000 0.439 ↑ 19,215.0 1 1

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

10. 0.156 0.156 ↑ 15.0 1 1

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

11. 0.010 0.283 ↓ 0.0 0 1

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

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

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

13. 0.002 0.003 ↑ 150.0 1 1

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

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

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

15. 0.006 1.076 ↓ 0.0 0 1

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

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

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

17. 0.000 0.221 ↓ 0.0 0 1

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

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

Hash Right Join (cost=148.69..170.48 rows=1 width=8) (actual time=0.221..0.221 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.005 0.005 ↑ 103.8 8 1

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

  • Buffers: shared hit=1
20. 0.004 0.207 ↑ 1.1 8 1

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

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

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

Planning time : 0.308 ms
Execution time : 1.733 ms