explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mUIu

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 129.698 ↓ 23.8 143 1

Append (cost=33.23..276.69 rows=6 width=438) (actual time=10.536..129.698 rows=143 loops=1)

2. 0.237 1.160 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=33.23..33.27 rows=1 width=430) (actual time=1.160..1.160 rows=0 loops=1)

3. 0.001 0.923 ↓ 0.0 0 1

GroupAggregate (cost=33.23..33.26 rows=1 width=534) (actual time=0.923..0.923 rows=0 loops=1)

  • Group Key: gc.id, g.id, "user".id
4. 0.032 0.922 ↓ 0.0 0 1

Sort (cost=33.23..33.24 rows=1 width=489) (actual time=0.922..0.922 rows=0 loops=1)

  • Sort Key: gc.id, "user".id
  • Sort Method: quicksort Memory: 25kB
5. 0.001 0.890 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.12..33.22 rows=1 width=489) (actual time=0.889..0.890 rows=0 loops=1)

  • Join Filter: (gs.goal_id = g.id)
6. 0.000 0.889 ↓ 0.0 0 1

Nested Loop (cost=0.85..24.91 rows=1 width=473) (actual time=0.889..0.889 rows=0 loops=1)

7. 0.001 0.889 ↓ 0.0 0 1

Nested Loop (cost=0.56..16.60 rows=1 width=441) (actual time=0.889..0.889 rows=0 loops=1)

8. 0.888 0.888 ↓ 0.0 0 1

Index Scan using goal_comment_goal_id_fk on goal_comment gc (cost=0.28..8.29 rows=1 width=353) (actual time=0.888..0.888 rows=0 loops=1)

  • Index Cond: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
9. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" (cost=0.29..8.30 rows=1 width=88) (never executed)

  • Index Cond: (id = gc.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
10. 0.000 0.000 ↓ 0.0 0

Index Scan using goal_pkey on goal g (cost=0.29..8.30 rows=1 width=32) (never executed)

  • Index Cond: (id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using goal_share_pkey on goal_share gs (cost=0.28..8.30 rows=1 width=32) (never executed)

  • Index Cond: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
  • Heap Fetches: 0
12. 0.000 1.621 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=137.79..137.86 rows=2 width=381) (actual time=1.621..1.621 rows=0 loops=1)

13. 0.001 1.621 ↓ 0.0 0 1

GroupAggregate (cost=137.79..137.84 rows=2 width=397) (actual time=1.621..1.621 rows=0 loops=1)

  • Group Key: gn.id, g_1.user_id
14. 0.460 1.620 ↓ 0.0 0 1

Sort (cost=137.79..137.80 rows=2 width=312) (actual time=1.620..1.620 rows=0 loops=1)

  • Sort Key: gn.id, g_1.user_id
  • Sort Method: quicksort Memory: 25kB
15. 0.001 1.160 ↓ 0.0 0 1

Nested Loop (cost=0.57..137.78 rows=2 width=312) (actual time=1.160..1.160 rows=0 loops=1)

16. 0.002 0.890 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..16.61 rows=1 width=48) (actual time=0.889..0.890 rows=1 loops=1)

  • Join Filter: (gs_1.goal_id = g_1.id)
17. 0.031 0.031 ↑ 1.0 1 1

Index Scan using goal_pkey on goal g_1 (cost=0.29..8.30 rows=1 width=32) (actual time=0.030..0.031 rows=1 loops=1)

  • Index Cond: (id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
18. 0.857 0.857 ↓ 0.0 0 1

Index Only Scan using goal_share_pkey on goal_share gs_1 (cost=0.28..8.30 rows=1 width=32) (actual time=0.857..0.857 rows=0 loops=1)

  • Index Cond: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
  • Heap Fetches: 0
19. 0.269 0.269 ↓ 0.0 0 1

Seq Scan on goal_note gn (cost=0.00..121.15 rows=2 width=280) (actual time=0.269..0.269 rows=0 loops=1)

  • Filter: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
  • Rows Removed by Filter: 2360
20. 1.114 125.996 ↓ 71.5 143 1

Nested Loop (cost=1.42..63.76 rows=2 width=632) (actual time=7.752..125.996 rows=143 loops=1)

21. 0.268 39.654 ↓ 71.5 143 1

Nested Loop Left Join (cost=1.14..18.38 rows=2 width=325) (actual time=5.375..39.654 rows=143 loops=1)

  • Filter: ((ahr.user_id IS NULL) = (user_1.id IS NULL))
  • Rows Removed by Filter: 19
22. 0.067 6.014 ↓ 54.0 162 1

Nested Loop (cost=0.85..17.14 rows=3 width=237) (actual time=4.953..6.014 rows=162 loops=1)

23. 0.005 3.630 ↑ 1.0 1 1

Nested Loop (cost=0.56..16.60 rows=1 width=214) (actual time=3.629..3.630 rows=1 loops=1)

24. 2.287 2.287 ↑ 1.0 1 1

Index Scan using ad_hoc_request_goal_goal_id_fk on ad_hoc_request_goal ahgg (cost=0.28..8.29 rows=1 width=32) (actual time=2.286..2.287 rows=1 loops=1)

  • Index Cond: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
25. 1.338 1.338 ↑ 1.0 1 1

Index Scan using ad_hoc_request_group_pkey on ad_hoc_request_group ahg (cost=0.29..8.30 rows=1 width=182) (actual time=1.338..1.338 rows=1 loops=1)

  • Index Cond: (id = ahgg.ad_hoc_request_group_id)
26. 2.317 2.317 ↓ 54.0 162 1

Index Scan using ad_hoc_request_group_id_email_uk on ad_hoc_request ahr (cost=0.29..0.52 rows=3 width=71) (actual time=1.320..2.317 rows=162 loops=1)

  • Index Cond: (ad_hoc_request_group_id = ahg.id)
27. 33.372 33.372 ↑ 1.0 1 162

Index Scan using user_pkey on "user" user_1 (cost=0.29..0.40 rows=1 width=88) (actual time=0.206..0.206 rows=1 loops=162)

  • Index Cond: (id = ahr.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 0
28. 65.351 65.351 ↑ 1.0 1 143

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv (cost=0.29..0.54 rows=1 width=414) (actual time=0.457..0.457 rows=1 loops=143)

  • Index Cond: (ad_hoc_request_id = ahr.id)
29.          

SubPlan (for Nested Loop)

30. 0.000 19.877 ↓ 0.0 0 143

HashSetOp Intersect (cost=4.30..22.15 rows=2 width=20) (actual time=0.139..0.139 rows=0 loops=143)

31. 0.143 19.877 ↓ 0.0 0 143

Append (cost=4.30..22.14 rows=4 width=20) (actual time=0.138..0.139 rows=0 loops=143)

32. 0.286 19.162 ↓ 0.0 0 143

Subquery Scan on *SELECT* 1_1 (cost=4.30..11.15 rows=2 width=20) (actual time=0.134..0.134 rows=0 loops=143)

33. 0.143 18.876 ↓ 0.0 0 143

Bitmap Heap Scan on ad_hoc_review_share ahrs (cost=4.30..11.13 rows=2 width=16) (actual time=0.132..0.132 rows=0 loops=143)

  • Recheck Cond: (ad_hoc_review_id = ahrv.id)
  • Heap Blocks: exact=11
34. 18.733 18.733 ↓ 0.0 0 143

Bitmap Index Scan on ad_hoc_review_share_pkey (cost=0.00..4.30 rows=2 width=0) (actual time=0.131..0.131 rows=0 loops=143)

  • Index Cond: (ad_hoc_review_id = ahrv.id)
35. 0.286 0.572 ↓ 0.0 0 143

Subquery Scan on *SELECT* 2_1 (cost=4.30..10.96 rows=2 width=20) (actual time=0.004..0.004 rows=0 loops=143)

36. 0.000 0.286 ↓ 0.0 0 143

Bitmap Heap Scan on goal_share gs_2 (cost=4.30..10.94 rows=2 width=16) (actual time=0.002..0.002 rows=0 loops=143)

  • Recheck Cond: (goal_id = ahgg.goal_id)
37. 0.286 0.286 ↓ 0.0 0 143

Bitmap Index Scan on goal_share_pkey (cost=0.00..4.29 rows=2 width=0) (actual time=0.002..0.002 rows=0 loops=143)

  • Index Cond: (goal_id = ahgg.goal_id)
38. 0.000 0.883 ↓ 0.0 0 1

Nested Loop (cost=1.83..41.74 rows=1 width=170) (actual time=0.883..0.883 rows=0 loops=1)

39. 0.000 0.883 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.54..18.42 rows=1 width=246) (actual time=0.883..0.883 rows=0 loops=1)

  • Filter: ((qr.user_id IS NULL) = (user_2.id IS NULL))
40. 0.001 0.883 ↓ 0.0 0 1

Nested Loop (cost=1.26..17.68 rows=2 width=158) (actual time=0.883..0.883 rows=0 loops=1)

41. 0.000 0.882 ↓ 0.0 0 1

Nested Loop (cost=0.84..17.02 rows=1 width=134) (actual time=0.882..0.882 rows=0 loops=1)

42. 0.000 0.882 ↓ 0.0 0 1

Nested Loop (cost=0.56..16.60 rows=1 width=123) (actual time=0.882..0.882 rows=0 loops=1)

43. 0.882 0.882 ↓ 0.0 0 1

Index Scan using questionnaire_request_goal_goal_id_fk on questionnaire_request_goal qgg (cost=0.28..8.29 rows=1 width=32) (actual time=0.882..0.882 rows=0 loops=1)

  • Index Cond: (goal_id = '3fc829a0-3dba-48f5-9a3b-1f1f5d4fd9f5'::uuid)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using questionnaire_request_group_pkey on questionnaire_request_group qg (cost=0.29..8.30 rows=1 width=91) (never executed)

  • Index Cond: (id = qgg.questionnaire_request_group_id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using questionnaire_pkey on questionnaire q (cost=0.28..0.43 rows=1 width=43) (never executed)

  • Index Cond: (id = qg.questionnaire_id)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using questionnaire_request_group_id_email_uk on questionnaire_request qr (cost=0.41..0.63 rows=3 width=72) (never executed)

  • Index Cond: (questionnaire_request_group_id = qg.id)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using user_pkey on "user" user_2 (cost=0.29..0.36 rows=1 width=88) (never executed)

  • Index Cond: (id = qr.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
48. 0.000 0.000 ↓ 0.0 0

Index Scan using questionnaire_review_questionnaire_request_id_key on questionnaire_review qrv (cost=0.29..0.69 rows=1 width=32) (never executed)

  • Index Cond: (questionnaire_request_id = qr.id)
49.          

SubPlan (for Nested Loop)

50. 0.000 0.000 ↓ 0.0 0

HashSetOp Intersect (cost=4.30..22.62 rows=2 width=20) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Append (cost=4.30..22.61 rows=4 width=20) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 1_2 (cost=4.30..11.63 rows=2 width=20) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on questionnaire_review_share qrs (cost=4.30..11.61 rows=2 width=16) (never executed)

  • Recheck Cond: (questionnaire_review_id = qrv.id)
54. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on questionnaire_review_share_pkey (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (questionnaire_review_id = qrv.id)
55. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 2_2 (cost=4.30..10.96 rows=2 width=20) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on goal_share gs_3 (cost=4.30..10.94 rows=2 width=16) (never executed)

  • Recheck Cond: (goal_id = qgg.goal_id)
57. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on goal_share_pkey (cost=0.00..4.29 rows=2 width=0) (never executed)

  • Index Cond: (goal_id = qgg.goal_id)
Planning time : 86.345 ms
Execution time : 136.825 ms