explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IeJz

Settings
# exclusive inclusive rows x rows loops node
1. 10.175 41,883.693 ↓ 5,000.0 5,000 1

Limit (cost=686,737.62..686,904.89 rows=1 width=67) (actual time=41,728.178..41,883.693 rows=5,000 loops=1)

2. 168.835 41,873.518 ↓ 33.4 55,000 1

Gather (cost=411,589.94..686,737.62 rows=1,645 width=67) (actual time=40,564.870..41,873.518 rows=55,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 1
3. 867.378 41,704.683 ↓ 40.2 27,503 2

Nested Loop (cost=410,589.94..685,573.12 rows=685 width=67) (actual time=40,551.642..41,704.683 rows=27,503 loops=2)

  • Join Filter: (user_hubs.user_id = users.id)
4. 55.865 40,837.280 ↓ 31.3 27,503 2

Hash Join (cost=410,589.51..682,872.92 rows=880 width=51) (actual time=40,548.464..40,837.280 rows=27,503 loops=2)

  • Hash Cond: ((user_hubs.hub_id = d.hub_id) AND (user_clusters.cluster_id = d.cluster_id))
5. 3,172.049 40,777.877 ↑ 8.5 31,823 2

Parallel Hash Join (cost=410,574.46..681,431.99 rows=271,591 width=51) (actual time=40,544.730..40,777.877 rows=31,823 loops=2)

  • Hash Cond: (user_clusters.user_id = user_hubs.user_id)
6. 13,383.161 13,383.161 ↓ 1.2 3,714,873 2

Parallel Seq Scan on user_clusters (cost=0.00..220,350.81 rows=3,096,291 width=24) (actual time=0.265..13,383.161 rows=3,714,873 loops=2)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 58025
7. 463.276 24,222.667 ↓ 1.3 270,782 2

Parallel Hash (cost=406,395.15..406,395.15 rows=216,105 width=27) (actual time=24,222.666..24,222.667 rows=270,782 loops=2)

  • Buckets: 65536 Batches: 16 Memory Usage: 2688kB
8. 23,759.391 23,759.391 ↓ 1.3 270,782 2

Parallel Seq Scan on user_hubs (cost=0.00..406,395.15 rows=216,105 width=27) (actual time=3.799..23,759.391 rows=270,782 loops=2)

  • Filter: ((deleted_at IS NULL) AND (user_type IS NOT NULL) AND (import_status = 'joined'::text))
  • Rows Removed by Filter: 3601802
9. 0.253 3.538 ↑ 1.0 441 2

Hash (cost=8.42..8.42 rows=442 width=8) (actual time=3.538..3.538 rows=441 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
10. 3.285 3.285 ↑ 1.0 441 2

Seq Scan on cluster_hubs d (cost=0.00..8.42 rows=442 width=8) (actual time=0.029..3.285 rows=441 loops=2)

11. 0.025 0.025 ↑ 1.0 1 55,006

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

  • Index Cond: (id = user_clusters.user_id)
  • Filter: (deleted_at IS NULL)
Planning time : 56.919 ms
Execution time : 41,884.777 ms