explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jk5j

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 0.807 ↓ 13.0 13 1

Nested Loop Left Join (cost=5.22..133.92 rows=1 width=9,846) (actual time=0.100..0.807 rows=13 loops=1)

  • Join Filter: (aagp_cs.id = aagp.""completionStatusId"")
  • Rows Removed by Join Filter: 39
2. 0.017 0.753 ↓ 13.0 13 1

Nested Loop Left Join (cost=5.22..132.31 rows=1 width=9,835) (actual time=0.092..0.753 rows=13 loops=1)

  • Join Filter: (aagp.""userId"" = activity_participants.""userId"")
3. 0.015 0.736 ↓ 13.0 13 1

Nested Loop Left Join (cost=4.66..129.96 rows=1 width=9,835) (actual time=0.090..0.736 rows=13 loops=1)

4. 0.017 0.721 ↓ 13.0 13 1

Nested Loop Left Join (cost=4.24..127.13 rows=1 width=9,754) (actual time=0.089..0.721 rows=13 loops=1)

5. 0.017 0.704 ↓ 13.0 13 1

Nested Loop Left Join (cost=4.10..126.77 rows=1 width=8,206) (actual time=0.087..0.704 rows=13 loops=1)

6. 0.020 0.687 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.82..125.28 rows=1 width=7,871) (actual time=0.086..0.687 rows=13 loops=1)

7. 0.017 0.667 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.68..124.40 rows=1 width=7,355) (actual time=0.084..0.667 rows=13 loops=1)

8. 0.014 0.650 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.54..123.52 rows=1 width=6,839) (actual time=0.083..0.650 rows=13 loops=1)

9. 0.015 0.636 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.39..122.64 rows=1 width=6,323) (actual time=0.081..0.636 rows=13 loops=1)

10. 0.018 0.621 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.25..121.76 rows=1 width=5,287) (actual time=0.080..0.621 rows=13 loops=1)

11. 0.017 0.603 ↓ 13.0 13 1

Nested Loop Left Join (cost=3.11..120.88 rows=1 width=4,255) (actual time=0.077..0.603 rows=13 loops=1)

12. 0.012 0.586 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.96..120.00 rows=1 width=3,739) (actual time=0.076..0.586 rows=13 loops=1)

13. 0.023 0.561 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.82..119.12 rows=1 width=3,655) (actual time=0.071..0.561 rows=13 loops=1)

14. 0.019 0.525 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.67..118.24 rows=1 width=3,139) (actual time=0.067..0.525 rows=13 loops=1)

15. 0.014 0.493 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.53..117.36 rows=1 width=2,623) (actual time=0.065..0.493 rows=13 loops=1)

16. 0.020 0.479 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.38..116.48 rows=1 width=2,107) (actual time=0.063..0.479 rows=13 loops=1)

17. 0.019 0.459 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.24..115.60 rows=1 width=1,591) (actual time=0.062..0.459 rows=13 loops=1)

18. 0.023 0.427 ↓ 13.0 13 1

Nested Loop Left Join (cost=2.09..114.72 rows=1 width=1,075) (actual time=0.058..0.427 rows=13 loops=1)

19. 0.021 0.391 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.95..113.84 rows=1 width=559) (actual time=0.053..0.391 rows=13 loops=1)

20. 0.019 0.357 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.82..113.45 rows=1 width=544) (actual time=0.050..0.357 rows=13 loops=1)

21. 0.020 0.325 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.68..113.07 rows=1 width=426) (actual time=0.046..0.325 rows=13 loops=1)

22. 0.012 0.305 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.54..112.45 rows=1 width=270) (actual time=0.044..0.305 rows=13 loops=1)

23. 0.021 0.202 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.11..111.43 rows=1 width=254) (actual time=0.033..0.202 rows=13 loops=1)

  • Filter: (((activities.""deletedAt"" IS NULL) AND (activity_participants.""deletedAt"" IS NULL)) OR ((deleted_reasons.value)::text = ANY ('{EXPIRED,LOST_ELIGIBILITY}'::text[])))
24. 0.021 0.181 ↓ 13.0 13 1

Nested Loop (cost=0.98..111.04 rows=1 width=251) (actual time=0.031..0.181 rows=13 loops=1)

25. 0.043 0.043 ↑ 1.9 13 1

Index Scan using activity_rootid on activities (cost=0.42..36.85 rows=25 width=136) (actual time=0.012..0.043 rows=13 loops=1)

  • Index Cond: (""rootId"" = ANY ('{54318,54324,54304,54310,54312}'::integer[]))
26. 0.117 0.117 ↑ 1.0 1 13

Index Scan using activity_participants_activityid_userid_unique on activity_participants (cost=0.56..2.87 rows=1 width=123) (actual time=0.009..0.009 rows=1 loops=13)

  • Index Cond: ((""activityId"" = activities.id) AND (""userId"" = '24a8398514996d6da25375deccf74170f8770f52'::text))
27. 0.000 0.000 ↓ 0.0 0 13

Index Scan using deleted_reasons_pkey on deleted_reasons (cost=0.13..0.29 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activity_participants.""deletedReasonId"" = id)
28. 0.013 0.091 ↓ 0.0 0 13

Subquery Scan on activity_participants_metrics (cost=0.43..0.92 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=13)

  • Filter: (activity_participants_metrics.""activityParticipantsUuid"" = activity_participants.uuid)
29. 0.013 0.078 ↓ 0.0 0 13

Limit (cost=0.43..0.82 rows=1 width=32) (actual time=0.006..0.006 rows=0 loops=13)

30. 0.065 0.065 ↓ 0.0 0 13

Index Only Scan Backward using activity_participants_metrics_3columns on activity_participants_metrics activity_participants_metrics_1 (cost=0.43..9.50 rows=23 width=32) (actual time=0.005..0.005 rows=0 loops=13)

  • Index Cond: (""activityParticipantsUuid"" = activity_participants.uuid)
  • Heap Fetches: 0
31. 0.000 0.000 ↓ 0.0 0 13

Index Scan using wellsource_hra_settings_pkey on wellsource_hra_settings hra (cost=0.14..0.52 rows=1 width=156) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""wellsourceHraSettingsId"" = id)
32. 0.013 0.013 ↑ 1.0 1 13

Index Scan using created_reasons_pkey on created_reasons (cost=0.13..0.29 rows=1 width=122) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (id = activity_participants.""createdReasonId"")
33. 0.013 0.013 ↑ 1.0 1 13

Index Scan using completion_statuses_pkey on completion_statuses (cost=0.13..0.28 rows=1 width=19) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (id = activity_participants.""completionStatusId"")
34. 0.013 0.013 ↑ 1.0 1 13

Index Scan using activity_prefixes_pkey on activity_prefixes (cost=0.14..0.78 rows=1 width=520) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (activities.""prefixId"" = id)
35. 0.013 0.013 ↑ 1.0 1 13

Index Scan using activity_types_pkey on activity_types (cost=0.14..0.78 rows=1 width=520) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (activities.""activityTypeId"" = id)
36. 0.000 0.000 ↓ 0.0 0 13

Index Scan using category_types_pkey on category_types (cost=0.14..0.78 rows=1 width=520) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""categoryTypeId"" = id)
37. 0.000 0.000 ↓ 0.0 0 13

Index Scan using completion_labels_pkey on completion_labels (cost=0.14..0.78 rows=1 width=520) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""completionLabelId"" = id)
38. 0.013 0.013 ↑ 1.0 1 13

Index Scan using content_types_pkey on content_types (cost=0.14..0.78 rows=1 width=520) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (activities.""contentTypeId"" = id)
39. 0.013 0.013 ↑ 1.0 1 13

Index Scan using reporting_types_pkey on reporting_types (cost=0.14..0.78 rows=1 width=520) (actual time=0.001..0.001 rows=1 loops=13)

  • Index Cond: (activities.""reportingTypeId"" = id)
40. 0.013 0.013 ↓ 0.0 0 13

Index Scan using event_activities_pkey on event_activities (cost=0.15..0.78 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""eventActivityId"" = id)
41. 0.000 0.000 ↓ 0.0 0 13

Index Scan using time_units_pkey on time_units fu (cost=0.14..0.78 rows=1 width=520) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""frequencyUnitId"" = id)
42. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_metrics_uuid_unique on activity_metrics metric (cost=0.14..0.78 rows=1 width=1,048) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activityMetricUuid"" = uuid)
43. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_units_uuid_unique on activity_units unit (cost=0.14..0.78 rows=1 width=1,052) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activityUnitUuid"" = uuid)
44. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_categories_uuid_unique on activity_categories category (cost=0.14..0.78 rows=1 width=532) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activityCategoryUuid"" = uuid)
45. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_subcategories_uuid_unique on activity_subcategories (cost=0.14..0.78 rows=1 width=532) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activitySubcategoryUuid"" = uuid)
46. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_kinds_uuid_unique on activity_kinds kind (cost=0.14..0.78 rows=1 width=532) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activityKindUuid"" = uuid)
47. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_health_measures_pkey on activity_health_measures ahm (cost=0.28..1.40 rows=1 width=335) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""activityHealthMeasureId"" = id)
48. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_health_measure_types_pkey on activity_health_measure_types ahmt (cost=0.14..0.26 rows=1 width=1,552) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (ahm.""healthMeasureTypeId"" = id)
49. 0.000 0.000 ↓ 0.0 0 13

Index Scan using activity_groups_id_deletedat on activity_groups aag (cost=0.42..2.73 rows=1 width=81) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: (activities.""alternativeActivityGroupId"" = id)
50. 0.000 0.000 ↓ 0.0 0 13

Index Scan using unique_userid_activitygroupid_activity_group_participants on activity_group_participants aagp (cost=0.56..2.26 rows=1 width=49) (actual time=0.000..0.000 rows=0 loops=13)

  • Index Cond: ((""userId"" = '24a8398514996d6da25375deccf74170f8770f52'::text) AND (""activityGroupId"" = aag.id))
51. 0.026 0.026 ↑ 1.0 3 13

Seq Scan on completion_statuses aagp_cs (cost=0.00..1.30 rows=3 width=19) (actual time=0.001..0.002 rows=3 loops=13)