explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HQJW

Settings
# exclusive inclusive rows x rows loops node
1. 9.822 45,666.210 ↓ 5,000.0 5,000 1

Limit (cost=709,850.80..709,882.44 rows=1 width=67) (actual time=45,536.487..45,666.210 rows=5,000 loops=1)

2. 88.170 45,656.388 ↓ 5.8 55,000 1

Gather (cost=412,115.15..709,850.80 rows=9,410 width=67) (actual time=44,526.257..45,656.388 rows=55,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 1
3. 807.748 45,568.218 ↓ 7.0 27,502 2

Nested Loop (cost=411,115.15..707,909.80 rows=3,921 width=67) (actual time=44,528.625..45,568.218 rows=27,502 loops=2)

  • Join Filter: (user_hubs.user_id = users.id)
4. 3,758.817 44,760.446 ↓ 5.5 27,502 2

Parallel Hash Join (cost=411,114.72..692,472.67 rows=5,031 width=51) (actual time=44,525.346..44,760.446 rows=27,502 loops=2)

  • Hash Cond: ((user_clusters.user_id = user_hubs.user_id) AND (user_clusters.cluster_id = user_hubs.cluster_id))
5. 14,042.621 14,042.621 ↓ 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.016..14,042.621 rows=3,714,873 loops=2)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 58025
6. 527.812 26,959.008 ↓ 1.3 270,782 2

Parallel Hash (cost=406,395.15..406,395.15 rows=216,105 width=31) (actual time=26,959.008..26,959.008 rows=270,782 loops=2)

  • Buckets: 65536 Batches: 16 Memory Usage: 2688kB
7. 26,431.196 26,431.196 ↓ 1.3 270,782 2

Parallel Seq Scan on user_hubs (cost=0.00..406,395.15 rows=216,105 width=31) (actual time=18.231..26,431.196 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
8. 0.024 0.024 ↑ 1.0 1 55,005

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

  • Index Cond: (id = user_clusters.user_id)
  • Filter: (deleted_at IS NULL)
Planning time : 8.418 ms
Execution time : 45,667.454 ms