explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H80Q : a.sql

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 0.199 ↑ 1.4 5 1

HashAggregate (cost=26.86..26.93 rows=7 width=10) (actual time=0.198..0.199 rows=5 loops=1)

  • Group Key: vulnerability_occurrences.severity
2. 0.014 0.192 ↑ 2.0 21 1

Nested Loop (cost=8.50..26.66 rows=41 width=2) (actual time=0.156..0.192 rows=21 loops=1)

3. 0.000 0.157 ↑ 2.0 21 1

Nested Loop (cost=8.22..11.36 rows=41 width=8) (actual time=0.154..0.157 rows=21 loops=1)

4. 0.002 0.152 ↑ 1.0 1 1

HashAggregate (cost=7.95..7.96 rows=1 width=4) (actual time=0.152..0.152 rows=1 loops=1)

  • Group Key: max(ci_pipelines.id)
5. 0.002 0.150 ↑ 1.0 1 1

GroupAggregate (cost=7.92..7.94 rows=1 width=8) (actual time=0.150..0.150 rows=1 loops=1)

  • Group Key: ci_pipelines.project_id
6. 0.046 0.148 ↓ 4.0 4 1

Sort (cost=7.92..7.92 rows=1 width=8) (actual time=0.148..0.148 rows=4 loops=1)

  • Sort Key: ci_pipelines.project_id
  • Sort Method: quicksort Memory: 25kB
7. 0.002 0.102 ↓ 4.0 4 1

Nested Loop Semi Join (cost=5.77..7.91 rows=1 width=8) (actual time=0.090..0.102 rows=4 loops=1)

8. 0.009 0.090 ↑ 1.2 5 1

Nested Loop (cost=5.50..6.08 rows=6 width=8) (actual time=0.085..0.090 rows=5 loops=1)

  • Join Filter: (ci_pipelines.project_id = rs.source_id)
9. 0.001 0.057 ↓ 4.0 8 1

Unique (cost=5.35..5.36 rows=2 width=8) (actual time=0.056..0.057 rows=8 loops=1)

10. 0.011 0.056 ↓ 4.0 8 1

Sort (cost=5.35..5.36 rows=2 width=8) (actual time=0.056..0.056 rows=8 loops=1)

  • Sort Key: projects.id
  • Sort Method: quicksort Memory: 25kB
11. 0.005 0.045 ↓ 4.0 8 1

Merge Join (cost=0.28..5.34 rows=2 width=8) (actual time=0.014..0.045 rows=8 loops=1)

  • Merge Cond: (projects.id = rs.source_id)
12. 0.023 0.023 ↓ 1.1 46 1

Index Only Scan using idx_projects_on_repository_storage_last_repository_updated_at on projects (cost=0.14..2.77 rows=42 width=4) (actual time=0.006..0.023 rows=46 loops=1)

  • Heap Fetches: 46
13. 0.017 0.017 ↓ 2.7 8 1

Index Scan using index_routes_on_source_type_and_source_id on routes rs (cost=0.14..3.60 rows=3 width=4) (actual time=0.008..0.017 rows=8 loops=1)

  • Index Cond: ((source_type)::text = 'Project'::text)
  • Filter: ((path)::text ~~ 'gitlab-org/%'::text)
  • Rows Removed by Filter: 38
14. 0.024 0.024 ↑ 3.0 1 8

Index Scan using index_ci_pipelines_on_project_id_and_status_and_config_source on ci_pipelines (cost=0.14..0.32 rows=3 width=8) (actual time=0.003..0.003 rows=1 loops=8)

  • Index Cond: ((project_id = projects.id) AND ((status)::text = 'success'::text))
15. 0.010 0.010 ↑ 41.0 1 5

Index Only Scan using index_vulnerability_occurrence_pipelines_on_pipeline_id on vulnerability_occurrence_pipelines vulnerability_occurrence_pipelines_1 (cost=0.28..1.18 rows=41 width=4) (actual time=0.002..0.002 rows=1 loops=5)

  • Index Cond: (pipeline_id = ci_pipelines.id)
  • Heap Fetches: 4
16. 0.005 0.005 ↑ 2.0 21 1

Index Scan using index_vulnerability_occurrence_pipelines_on_pipeline_id on vulnerability_occurrence_pipelines (cost=0.28..3.00 rows=41 width=12) (actual time=0.002..0.005 rows=21 loops=1)

  • Index Cond: (pipeline_id = (max(ci_pipelines.id)))
17. 0.021 0.021 ↑ 1.0 1 21

Index Scan using vulnerability_occurrences_pkey on vulnerability_occurrences (cost=0.28..0.36 rows=1 width=10) (actual time=0.001..0.001 rows=1 loops=21)

  • Index Cond: (id = vulnerability_occurrence_pipelines.occurrence_id)
Planning time : 1.020 ms
Execution time : 0.277 ms