explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jTdH

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.002 38,808.448 ↓ 0.0 0 1

Nested Loop (cost=1,844,592.16..1,844,624.28 rows=1 width=43) (actual time=38,808.448..38,808.448 rows=0 loops=1)

  • Join Filter: (user_hubs.user_type ~~* (h.settings #>> '{userTypes,student,Student}'::text[]))
2. 0.003 38,807.188 ↑ 1.0 1 1

Nested Loop (cost=1,844,591.88..1,844,615.96 rows=1 width=50) (actual time=38,807.184..38,807.188 rows=1 loops=1)

3. 0.006 38,807.046 ↑ 1.0 1 1

Nested Loop (cost=1,844,591.45..1,844,607.50 rows=1 width=39) (actual time=38,807.043..38,807.046 rows=1 loops=1)

4. 0.000 38,806.923 ↑ 1.0 1 1

Index Scan using users_pkey on users (cost=1,844,591.01..1,844,599.03 rows=1 width=4) (actual time=38,806.921..38,806.923 rows=1 loops=1)

  • Index Cond: (id = 73206)
  • Filter: ((deleted_at IS NULL) AND (NOT (hashed SubPlan 1)))
5.          

SubPlan (for Index Scan)

6. 20.816 38,821.376 ↓ 0.0 0 1

Gather (cost=1,000.00..1,844,587.30 rows=1,311 width=4) (actual time=38,806.777..38,821.376 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 38,800.560 38,800.560 ↓ 0.0 0 3 / 3

Parallel Seq Scan on email_history (cost=0.00..1,843,456.20 rows=546 width=4) (actual time=38,800.560..38,800.560 rows=0 loops=3)

  • Filter: ((hub_id = 39) AND (email_id = 'ReachOutNotification'::text))
  • Rows Removed by Filter: 12348485
8. 0.117 0.117 ↑ 1.0 1 1

Index Scan using user_clusters_user_id_hub_id_unique on user_clusters (cost=0.43..8.46 rows=1 width=39) (actual time=0.116..0.117 rows=1 loops=1)

  • Index Cond: ((cluster_id = 39) AND (user_id = 73206))
9. 0.139 0.139 ↑ 1.0 1 1

Index Scan using user_hubs_hub_id_user_id_idx on user_hubs (cost=0.43..8.46 rows=1 width=15) (actual time=0.138..0.139 rows=1 loops=1)

  • Index Cond: ((hub_id = 39) AND (user_id = 73206))
  • Filter: ((deleted_at IS NULL) AND (NOT is_admin) AND (deleted_at IS NULL) AND (completed_signup_at IS NOT NULL))
10. 1.258 1.258 ↓ 0.0 0 1

Index Scan using hubs_pkey on hubs h (cost=0.28..8.30 rows=1 width=35) (actual time=1.258..1.258 rows=0 loops=1)

  • Index Cond: (id = 39)
  • Filter: (((settings #>> '{enabledModules}'::text[]))::jsonb ? 'helpingHands'::text)
  • Rows Removed by Filter: 1
Planning time : 1.457 ms
Execution time : 38,823.352 ms