explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2wqQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 4,291.646 ↓ 0.0 0 1

Limit (cost=3,935.62..17,232.80 rows=1 width=4) (actual time=4,291.646..4,291.646 rows=0 loops=1)

2.          

CTE restricted_lfs_objects

3. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,680.36..3,788.12 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,577.86..3,577.86 rows=200 width=4) (never executed)

6. 0.000 0.000 ↓ 0.0 0

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

  • Group Key: projects.id
7. 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.namespace_id = gitlab_secondary_namespaces.id)
8. 0.000 0.000 ↓ 0.0 0

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

9. 0.000 0.000 ↓ 0.0 0

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

10. 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
11. 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)

12.          

CTE base_and_descendants

13. 0.000 0.000 ↓ 0.0 0

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

14. 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)

15. 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)
16. 0.000 0.000 ↓ 0.0 0

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

17. 0.000 0.000 ↓ 0.0 0

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

18. 0.000 0.000 ↓ 0.0 0

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

19. 0.002 4,291.645 ↓ 0.0 0 1

Nested Loop (cost=147.50..13,444.68 rows=1 width=4) (actual time=4,291.645..4,291.645 rows=0 loops=1)

  • Join Filter: (lfs_objects.id = restricted_lfs_objects.lfs_object_id)
20. 879.183 4,291.643 ↓ 0.0 0 1

Hash Right Join (cost=147.50..13,403.08 rows=1 width=4) (actual time=4,291.643..4,291.643 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
21. 55.553 55.553 ↓ 1.0 499,998 1

Seq Scan on lfs_object_registry (cost=0.00..10,133.25 rows=499,525 width=12) (actual time=0.133..55.553 rows=499,998 loops=1)

22. 226.257 3,356.907 ↓ 17,241.3 499,998 1

Hash (cost=147.14..147.14 rows=29 width=4) (actual time=3,356.907..3,356.907 rows=499,998 loops=1)

  • Buckets: 524288 (originally 1024) Batches: 2 (originally 1) Memory Usage: 12874kB
23. 3,130.650 3,130.650 ↓ 17,241.3 499,998 1

Foreign Scan on lfs_objects (cost=100.00..147.14 rows=29 width=4) (actual time=0.597..3,130.650 rows=499,998 loops=1)

24. 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.794 ms
Execution time : 4,292.662 ms