explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8KFz

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 6,679.173 ↓ 0.0 0 1

Limit (cost=4,136.72..16,191.36 rows=1 width=96) (actual time=6,679.173..6,679.173 rows=0 loops=1)

2.          

CTE restricted_lfs_objects

3. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,910.21..4,017.97 rows=1,280 width=4) (never executed)

  • Hash Cond: (lfs_objects_projects.project_id = projects.id)
4. 0.000 0.000 ↓ 0.0 0

Foreign Scan on lfs_objects_projects (cost=100.00..186.80 rows=2,560 width=8) (never executed)

5. 0.000 0.000 ↓ 0.0 0

Hash (cost=3,807.71..3,807.71 rows=200 width=8) (never executed)

6. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=3,805.71..3,807.71 rows=200 width=8) (never executed)

  • Group Key: projects.id
7. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,680.36..3,802.05 rows=1,462 width=8) (never executed)

  • Hash Cond: (projects.id = projects_1.id)
8. 0.000 0.000 ↓ 0.0 0

Foreign Scan on projects (cost=100.00..197.75 rows=2,925 width=4) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Hash (cost=3,577.86..3,577.86 rows=200 width=4) (never executed)

10. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=3,575.86..3,577.86 rows=200 width=4) (never executed)

  • Group Key: projects_1.id
11. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,464.90..3,572.66 rows=1,280 width=4) (never executed)

  • Hash Cond: (projects_1.namespace_id = gitlab_secondary_namespaces.id)
12. 0.000 0.000 ↓ 0.0 0

Foreign Scan on projects projects_1 (cost=100.00..186.80 rows=2,560 width=8) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Hash (cost=3,362.40..3,362.40 rows=200 width=4) (never executed)

14. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=3,360.40..3,362.40 rows=200 width=4) (never executed)

  • Group Key: gitlab_secondary_namespaces.id
15. 0.000 0.000 ↓ 0.0 0

CTE Scan on base_and_descendants gitlab_secondary_namespaces (cost=2,735.91..3,120.21 rows=19,215 width=4) (never executed)

16.          

CTE base_and_descendants

17. 0.000 0.000 ↓ 0.0 0

Recursive Union (cost=100.00..2,735.91 rows=19,215 width=4) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Foreign Scan on geo_node_namespace_links (cost=100.00..146.86 rows=15 width=4) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=104.88..220.47 rows=1,920 width=4) (never executed)

  • Hash Cond: (namespaces.parent_id = base_and_descendants.id)
20. 0.000 0.000 ↓ 0.0 0

Foreign Scan on namespaces (cost=100.00..186.80 rows=2,560 width=8) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Hash (cost=3.00..3.00 rows=150 width=4) (never executed)

22. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on base_and_descendants (cost=0.00..3.00 rows=150 width=4) (never executed)

23. 0.001 6,679.171 ↓ 0.0 0 1

Nested Loop (cost=118.75..12,173.40 rows=1 width=96) (actual time=6,679.171..6,679.171 rows=0 loops=1)

  • Join Filter: (lfs_objects.id = restricted_lfs_objects.lfs_object_id)
24. 1,043.493 6,679.170 ↓ 0.0 0 1

Hash Right Join (cost=118.75..12,131.80 rows=1 width=96) (actual time=6,679.170..6,679.170 rows=0 loops=1)

  • Hash Cond: (lfs_object_registry.lfs_object_id = lfs_objects.id)
  • Filter: (lfs_object_registry.id IS NULL)
  • Rows Removed by Filter: 499998
25. 43.821 43.821 ↑ 1.0 499,998 1

Seq Scan on lfs_object_registry (cost=0.00..10,137.98 rows=499,998 width=12) (actual time=0.020..43.821 rows=499,998 loops=1)

26. 332.620 5,591.856 ↓ 71,428.3 499,998 1

Hash (cost=118.66..118.66 rows=7 width=96) (actual time=5,591.856..5,591.856 rows=499,998 loops=1)

  • Buckets: 131072 (originally 1024) Batches: 8 (originally 1) Memory Usage: 15361kB
27. 5,259.236 5,259.236 ↓ 71,428.3 499,998 1

Foreign Scan on lfs_objects (cost=100.00..118.66 rows=7 width=96) (actual time=1.246..5,259.236 rows=499,998 loops=1)

28. 0.000 0.000 ↓ 0.0 0

CTE Scan on restricted_lfs_objects (cost=0.00..25.60 rows=1,280 width=4) (never executed)

Planning time : 0.752 ms
Execution time : 6,681.686 ms