explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gD4u

Settings
# exclusive inclusive rows x rows loops node
1. 0.884 172,726.482 ↓ 165.0 165 1

Nested Loop Left Join (cost=336,183.53..1,603,005.44 rows=1 width=906) (actual time=143,097.308..172,726.482 rows=165 loops=1)

  • Join Filter: (jbs."classId" = cls.id)
2. 48,687.186 172,721.803 ↓ 165.0 165 1

Hash Right Join (cost=336,183.53..1,602,997.43 rows=1 width=916) (actual time=143,096.286..172,721.803 rows=165 loops=1)

  • Hash Cond: (s."recipientId" = u.id)
  • Filter: (s.id IS NULL)
  • Rows Removed by Filter: 14681718
3. 109,872.415 109,872.415 ↓ 1.0 18,103,378 1

Seq Scan on smses s (cost=0.00..1,199,067.90 rows=18,065,536 width=32) (actual time=171.710..109,872.415 rows=18,103,378 loops=1)

  • Filter: (("deletedAt" IS NULL) AND ((type)::text = 'Onboarding reminder'::text))
  • Rows Removed by Filter: 778496
4. 75.000 14,162.202 ↓ 16,178.0 32,356 1

Hash (cost=336,183.51..336,183.51 rows=2 width=916) (actual time=14,162.202..14,162.202 rows=32,356 loops=1)

  • Buckets: 1024 Batches: 16 (originally 1) Memory Usage: 1025kB
5. 36.159 14,087.202 ↓ 16,178.0 32,356 1

Nested Loop (cost=204,504.34..336,183.51 rows=2 width=916) (actual time=11,944.518..14,087.202 rows=32,356 loops=1)

6. 685.906 13,741.555 ↓ 19,343.0 38,686 1

Hash Join (cost=204,503.92..336,166.82 rows=2 width=924) (actual time=11,928.449..13,741.555 rows=38,686 loops=1)

  • Hash Cond: (ui.id = u."latestUserInformationId")
7. 5,905.595 5,905.595 ↓ 1.0 188,024 1

Seq Scan on user_informations ui (cost=0.00..130,972.39 rows=184,133 width=27) (actual time=389.952..5,905.595 rows=188,024 loops=1)

  • Filter: ((source)::text = ANY ('{"Web Chat","Web Chat Referrals"}'::text[]))
  • Rows Removed by Filter: 754037
8. 82.187 7,150.054 ↓ 1,682.0 38,686 1

Hash (cost=204,503.63..204,503.63 rows=23 width=913) (actual time=7,150.054..7,150.054 rows=38,686 loops=1)

  • Buckets: 1024 Batches: 16 (originally 1) Memory Usage: 1025kB
9. 90.169 7,067.867 ↓ 1,682.0 38,686 1

Hash Join (cost=147,810.66..204,503.63 rows=23 width=913) (actual time=6,422.097..7,067.867 rows=38,686 loops=1)

  • Hash Cond: (u.id = ur."userId")
10. 18.560 1,668.740 ↓ 1.1 63,441 1

Nested Loop (cost=0.28..56,474.01 rows=58,405 width=893) (actual time=1,112.231..1,668.740 rows=63,441 loops=1)

11. 0.934 1.928 ↑ 1.0 1 1

Nested Loop (cost=0.28..14.71 rows=1 width=40) (actual time=1.584..1.928 rows=1 loops=1)

  • -> Index Scan using classes_pkey on classes cls (cost=0.28..8.30 rows=1 width=24) (actual time=0.914..0.919 rows=1 loops
12. 0.994 0.994 ↑ 1.0 1 1

Seq Scan on channels ch (cost=0.00..6.40 rows=1 width=16) (actual time=0.656..0.994 rows=1 loops=1)

  • Filter: (("incomingClassId" = 'f5f8df6e-f9a1-4e96-a0dc-ff93047616f0'::uuid) AND ((type)::text = 'Web Chat'::text) AN
  • Rows Removed by Filter: 136
  • Index Cond: (id = 'f5f8df6e-f9a1-4e96-a0dc-ff93047616f0'::uuid)
13. 1,648.252 1,648.252 ↓ 1.1 63,441 1

Seq Scan on users u (cost=0.00..55,875.25 rows=58,405 width=869) (actual time=1,110.634..1,648.252 rows=63,441 loops=1)

  • Filter: (("deletedAt" IS NULL) AND ("deactivatedAt" IS NULL) AND ("classId" = 'f5f8df6e-f9a1-4e96-a0dc-ff93047616f0'::uuid
  • Rows Removed by Filter: 1440134
14. 28.180 5,308.958 ↓ 73.0 43,146 1

Hash (cost=147,802.99..147,802.99 rows=591 width=20) (actual time=5,308.958..5,308.958 rows=43,146 loops=1)

  • Buckets: 1024 Batches: 4 (originally 1) Memory Usage: 1025kB
15. 4,767.281 5,280.778 ↓ 73.0 43,146 1

Hash Join (cost=17,201.58..147,802.99 rows=591 width=20) (actual time=527.675..5,280.778 rows=43,146 loops=1)

  • Hash Cond: (ur."responseId" = rs.id)
  • -> Seq Scan on user_responses ur (cost=0.00..119520.13 rows=2953425 width=36) (actual time=1.039..4304.454 rows=2955090
  • Filter: "isValid
  • Rows Removed by Filter: 612336
16. 0.033 513.497 ↑ 4.7 11 1

Hash (cost=17,200.92..17,200.92 rows=52 width=16) (actual time=513.497..513.497 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
17. 0.062 513.464 ↑ 4.7 11 1

Nested Loop (cost=0.42..17,200.92 rows=52 width=16) (actual time=62.654..513.464 rows=11 loops=1)

18. 506.472 506.472 ↑ 7.3 11 1

Seq Scan on instructions i (cost=0.00..16,528.92 rows=80 width=16) (actual time=60.858..506.472 rows=11 loops=1)

  • Filter: (text = 'Where do you live?'::text)
  • Rows Removed by Filter: 398223
19. 6.930 6.930 ↑ 1.0 1 11

Index Scan using "responses_instructionId_idx" on responses rs (cost=0.42..8.39 rows=1 width=32) (actual time=0.628..0.630 rows=1 loops=11)

  • Index Cond: ("instructionId" = i.id)
20. 309.488 309.488 ↑ 1.0 1 38,686

Index Scan using scheduled_interviews_user_id on scheduled_interviews sch (cost=0.42..8.33 rows=1 width=24) (actual time=0.008..0.008 rows=1 loops=38,686)

  • Index Cond: ("userId" = u.id)
21. 3.795 3.795 ↑ 1.0 1 165

Seq Scan on jobs jbs (cost=0.00..8.00 rows=1 width=22) (actual time=0.023..0.023 rows=1 loops=165)

  • Filter: ("classId" = 'f5f8df6e-f9a1-4e96-a0dc-ff93047616f0'::uuid)
  • Rows Removed by Filter: 239