explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v2mH

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 176.673 ↑ 250.0 2 1

Limit (cost=357.34..455,398.41 rows=500 width=761) (actual time=158.396..176.673 rows=2 loops=1)

2. 0.028 176.671 ↑ 439.5 2 1

Nested Loop Left Join (cost=357.34..800,319.53 rows=879 width=761) (actual time=158.395..176.671 rows=2 loops=1)

  • Join Filter: (plans.id = gitlab_subscriptions.hosted_plan_id)
  • Rows Removed by Join Filter: 30
  • Filter: (((plans.name)::text = ANY ('{bronze,silver,gold,early_adopter}'::text[])) OR (projects.visibility_level = 20))
  • Rows Removed by Filter: 4
3. 0.008 176.613 ↑ 206.3 6 1

Nested Loop Left Join (cost=357.34..800,148.33 rows=1,238 width=765) (actual time=158.228..176.613 rows=6 loops=1)

4. 0.167 176.539 ↑ 206.3 6 1

Nested Loop (cost=356.91..799,566.69 rows=1,238 width=765) (actual time=158.212..176.539 rows=6 loops=1)

5. 3.181 176.354 ↑ 206.3 6 1

Nested Loop (cost=0.99..358,474.72 rows=1,238 width=761) (actual time=158.127..176.354 rows=6 loops=1)

6. 76.648 76.648 ↑ 4.9 19,305 1

Index Scan using index_mirror_data_on_next_execution_and_retry_count on project_mirror_data import_state (cost=0.56..102,625.89 rows=95,458 width=12) (actual time=0.503..76.648 rows=19,305 loops=1)

  • Index Cond: ((next_execution_timestamp <= '2020-03-23 13:44:00.840198+00'::timestamp with time zone) AND (retry_count <= 14))
  • Filter: ((status)::text <> ALL ('{scheduled,started}'::text[]))
  • Rows Removed by Filter: 174
7. 96.525 96.525 ↓ 0.0 0 19,305

Index Scan using projects_pkey on projects (cost=0.43..2.67 rows=1 width=753) (actual time=0.005..0.005 rows=0 loops=19,305)

  • Index Cond: (id = import_state.project_id)
  • Filter: ((NOT archived) AND mirror)
  • Rows Removed by Filter: 1
8. 0.000 0.018 ↑ 1.0 1 6

Index Only Scan using namespaces_pkey on namespaces root_namespaces (cost=355.92..356.28 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=6)

  • Index Cond: (id = (SubPlan 2))
  • Heap Fetches: 0
9.          

SubPlan (for Index Only Scan)

10. 0.150 0.150 ↑ 1.0 1 6

CTE Scan on base_and_ancestors namespaces_2 (cost=353.47..355.49 rows=1 width=4) (actual time=0.023..0.025 rows=1 loops=6)

  • Filter: (parent_id IS NULL)
11.          

CTE base_and_ancestors

12. 0.054 0.126 ↑ 101.0 1 6

Recursive Union (cost=0.43..353.47 rows=101 width=326) (actual time=0.019..0.021 rows=1 loops=6)

13. 0.060 0.060 ↑ 1.0 1 6

Index Scan using namespaces_pkey on namespaces (cost=0.43..3.45 rows=1 width=326) (actual time=0.010..0.010 rows=1 loops=6)

  • Index Cond: (id = projects.namespace_id)
14. 0.000 0.012 ↓ 0.0 0 6

Nested Loop (cost=0.43..34.80 rows=10 width=326) (actual time=0.001..0.002 rows=0 loops=6)

15. 0.006 0.006 ↑ 10.0 1 6

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

16. 0.006 0.006 ↓ 0.0 0 6

Index Scan using namespaces_pkey on namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=326) (actual time=0.000..0.001 rows=0 loops=6)

  • Index Cond: (id = base_and_ancestors.parent_id)
17. 0.066 0.066 ↑ 1.0 1 6

Index Scan using index_gitlab_subscriptions_on_namespace_id on gitlab_subscriptions (cost=0.43..0.46 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=6)

  • Index Cond: (namespace_id = root_namespaces.id)
18. 0.021 0.030 ↑ 1.0 6 6

Materialize (cost=0.00..4.09 rows=6 width=11) (actual time=0.003..0.005 rows=6 loops=6)

19. 0.009 0.009 ↑ 1.0 6 1

Seq Scan on plans (cost=0.00..4.06 rows=6 width=11) (actual time=0.009..0.009 rows=6 loops=1)

Planning time : 9.320 ms
Execution time : 177.614 ms