explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mOmb

Settings
# exclusive inclusive rows x rows loops node
1. 88.674 4,213.248 ↑ 1.0 100 1

Hash Join (cost=16,911.07..3,470,443.46 rows=100 width=131) (actual time=950.430..4,213.248 rows=100 loops=1)

  • Hash Cond: (usr.id = question_responses.user_id)
2. 416.802 4,123.299 ↓ 1.0 364,362 1

Hash Left Join (cost=15,118.38..3,465,926.65 rows=362,983 width=79) (actual time=232.445..4,123.299 rows=364,362 loops=1)

  • Hash Cond: (usr.auth_id = auth.id)
3. 222.446 3,478.909 ↓ 1.0 364,362 1

Hash Join (cost=641.96..3,440,476.39 rows=362,983 width=59) (actual time=4.630..3,478.909 rows=364,362 loops=1)

  • Hash Cond: (usr.company_id = company.id)
4. 365.957 3,251.891 ↓ 1.0 364,362 1

Merge Left Join (cost=3.51..3,438,884.52 rows=362,983 width=63) (actual time=0.044..3,251.891 rows=364,362 loops=1)

  • Merge Cond: (usr.id = invites.user_id)
  • Join Filter: (invites.created_at = recent_invites.max_created_at)
  • Rows Removed by Join Filter: 87498
5. 460.511 2,632.429 ↓ 1.0 364,336 1

Nested Loop Left Join (cost=2.60..3,411,944.44 rows=362,983 width=33) (actual time=0.034..2,632.429 rows=364,336 loops=1)

6. 377.667 1,078.910 ↓ 1.0 364,336 1

Merge Left Join (cost=2.18..87,974.97 rows=362,983 width=25) (actual time=0.019..1,078.910 rows=364,336 loops=1)

  • Merge Cond: (usr.id = detail.user_id)
7. 386.472 386.472 ↓ 1.0 364,336 1

Index Scan using users_pkey on users usr (cost=0.42..33,135.19 rows=362,983 width=12) (actual time=0.007..386.472 rows=364,336 loops=1)

8. 314.771 314.771 ↓ 1.1 361,480 1

Index Scan using entity_user_details_user_id_fkey on user_details detail (cost=0.42..49,786.86 rows=342,461 width=17) (actual time=0.008..314.771 rows=361,480 loops=1)

9. 0.000 1,093.008 ↑ 1.0 1 364,336

Subquery Scan on recent_invites (cost=0.42..9.15 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=364,336)

  • Filter: (recent_invites.user_id = usr.id)
10. 364.336 1,093.008 ↑ 2.0 1 364,336

GroupAggregate (cost=0.42..9.12 rows=2 width=12) (actual time=0.003..0.003 rows=1 loops=364,336)

  • Group Key: invites_1.user_id
11. 728.672 728.672 ↑ 2.0 1 364,336

Index Scan using entity_invites_user_id_fkey on invites invites_1 (cost=0.42..9.09 rows=2 width=12) (actual time=0.002..0.002 rows=1 loops=364,336)

  • Index Cond: (user_id = usr.id)
12. 253.505 253.505 ↑ 1.0 381,556 1

Index Scan using entity_invites_user_id_fkey on invites (cost=0.42..20,209.62 rows=388,200 width=50) (actual time=0.006..253.505 rows=381,556 loops=1)

13. 2.009 4.572 ↓ 1.0 6,912 1

Hash (cost=552.09..552.09 rows=6,909 width=4) (actual time=4.572..4.572 rows=6,912 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 307kB
14. 2.563 2.563 ↓ 1.0 6,912 1

Seq Scan on companies company (cost=0.00..552.09 rows=6,909 width=4) (actual time=0.006..2.563 rows=6,912 loops=1)

15. 125.378 227.588 ↑ 1.0 322,751 1

Hash (cost=8,194.63..8,194.63 rows=324,863 width=28) (actual time=227.588..227.588 rows=322,751 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 2964kB
16. 102.210 102.210 ↑ 1.0 322,751 1

Seq Scan on auths auth (cost=0.00..8,194.63 rows=324,863 width=28) (actual time=0.006..102.210 rows=322,751 loops=1)

17. 0.061 1.275 ↑ 1.0 100 1

Hash (cost=1,791.44..1,791.44 rows=100 width=266) (actual time=1.275..1.275 rows=100 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
18. 0.045 1.214 ↑ 1.0 100 1

Nested Loop (cost=2.99..1,791.44 rows=100 width=266) (actual time=0.077..1.214 rows=100 loops=1)

19. 0.059 0.969 ↑ 1.0 100 1

Nested Loop (cost=2.57..967.44 rows=100 width=203) (actual time=0.068..0.969 rows=100 loops=1)

20. 0.126 0.610 ↑ 1.0 100 1

Nested Loop (cost=2.14..902.65 rows=100 width=8) (actual time=0.059..0.610 rows=100 loops=1)

21. 0.043 0.284 ↑ 1.0 100 1

Limit (cost=1.70..56.40 rows=100 width=8) (actual time=0.049..0.284 rows=100 loops=1)

22. 0.054 0.241 ↑ 2.0 100 1

Nested Loop (cost=1.70..108.90 rows=196 width=8) (actual time=0.048..0.241 rows=100 loops=1)

23. 0.004 0.051 ↑ 4.5 8 1

Nested Loop (cost=1.27..28.67 rows=36 width=4) (actual time=0.039..0.051 rows=8 loops=1)

24. 0.002 0.023 ↑ 3.0 1 1

Nested Loop (cost=0.84..17.62 rows=3 width=4) (actual time=0.023..0.023 rows=1 loops=1)

25. 0.013 0.013 ↑ 1.0 1 1

Index Scan using review_cycles_entity_id_key on review_cycles (cost=0.42..8.44 rows=1 width=4) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: (entity_id = 'eb14b36c-595c-49d9-814b-46b9efd2cc31'::uuid)
26. 0.008 0.008 ↑ 3.0 1 1

Index Scan using entity_review_groups_review_cycle_id_fkey on review_groups (cost=0.42..9.15 rows=3 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (review_cycle_id = review_cycles.id)
27. 0.024 0.024 ↑ 11.2 8 1

Index Scan using entity_review_requests_review_group_id_fkey on review_requests (cost=0.43..2.79 rows=90 width=8) (actual time=0.015..0.024 rows=8 loops=1)

  • Index Cond: (review_group_id = review_groups.id)
28. 0.136 0.136 ↑ 3.8 12 8

Index Scan using review_request_questions_review_request_id_fkey on review_request_questions (cost=0.43..1.77 rows=46 width=12) (actual time=0.005..0.017 rows=12 loops=8)

  • Index Cond: (review_request_id = review_requests.id)
29. 0.200 0.200 ↑ 1.0 1 100

Index Scan using review_responses_review_request_question_id_fkey on review_responses (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=100)

  • Index Cond: (review_request_question_id = review_request_questions.id)
30. 0.300 0.300 ↑ 1.0 1 100

Index Scan using question_responses_pkey on question_responses (cost=0.43..0.65 rows=1 width=203) (actual time=0.003..0.003 rows=1 loops=100)

  • Index Cond: (id = review_responses.question_response_id)
31. 0.200 0.200 ↑ 1.0 1 100

Index Scan using question_revisions_pkey on question_revisions (cost=0.42..8.24 rows=1 width=71) (actual time=0.002..0.002 rows=1 loops=100)

  • Index Cond: (id = review_request_questions.question_revision_id)
Planning time : 2.351 ms
Execution time : 4,213.478 ms