explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7eaO

Settings
# exclusive inclusive rows x rows loops node
1. 7.801 31,740.183 ↓ 5,000.0 5,000 1

Limit (cost=686,001.78..686,171.72 rows=1 width=67) (actual time=31,646.784..31,740.183 rows=5,000 loops=1)

2. 95.920 31,732.382 ↓ 34.0 55,000 1

Gather (cost=410,879.72..686,001.78 rows=1,619 width=67) (actual time=30,890.880..31,732.382 rows=55,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 498.803 31,636.462 ↓ 27.2 18,336 3

Nested Loop (cost=409,879.72..684,839.88 rows=675 width=67) (actual time=30,906.988..31,636.462 rows=18,336 loops=3)

  • Join Filter: (user_hubs.user_id = users.id)
4. 32.027 31,137.637 ↓ 20.8 18,336 3

Hash Join (cost=409,879.29..682,139.70 rows=880 width=51) (actual time=30,901.277..31,137.637 rows=18,336 loops=3)

  • Hash Cond: ((user_hubs.hub_id = d.hub_id) AND (user_clusters.cluster_id = d.cluster_id))
5. 2,138.692 31,104.793 ↑ 8.4 32,460 3

Parallel Hash Join (cost=409,864.24..680,698.77 rows=271,591 width=51) (actual time=30,900.240..31,104.793 rows=32,460 loops=3)

  • Hash Cond: (user_clusters.user_id = user_hubs.user_id)
6. 10,571.108 10,571.108 ↑ 1.3 2,476,582 3

Parallel Seq Scan on user_clusters (cost=0.00..220,350.81 rows=3,096,291 width=24) (actual time=0.050..10,571.108 rows=2,476,582 loops=3)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 38683
7. 327.029 18,394.993 ↑ 1.2 180,522 3

Parallel Hash (cost=405,750.42..405,750.42 rows=212,706 width=27) (actual time=18,394.993..18,394.993 rows=180,522 loops=3)

  • Buckets: 65536 Batches: 16 Memory Usage: 2720kB
8. 18,067.964 18,067.964 ↑ 1.2 180,522 3

Parallel Seq Scan on user_hubs (cost=0.00..405,750.42 rows=212,706 width=27) (actual time=0.057..18,067.964 rows=180,522 loops=3)

  • Filter: ((deleted_at IS NULL) AND (user_type IS NOT NULL) AND (import_status = 'joined'::text))
  • Rows Removed by Filter: 2401201
9. 0.331 0.817 ↑ 1.0 441 3

Hash (cost=8.42..8.42 rows=442 width=8) (actual time=0.817..0.817 rows=441 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
10. 0.486 0.486 ↑ 1.0 441 3

Seq Scan on cluster_hubs d (cost=0.00..8.42 rows=442 width=8) (actual time=0.075..0.486 rows=441 loops=3)

11. 0.022 0.022 ↑ 1.0 1 55,008

Index Scan using users_pkey on users (cost=0.43..3.05 rows=1 width=4) (actual time=0.022..0.022 rows=1 loops=55,008)

  • Index Cond: (id = user_clusters.user_id)
  • Filter: (deleted_at IS NULL)
Planning time : 24.795 ms
Execution time : 31,741.262 ms