explain.depesz.com

PostgreSQL's explain analyze made readable

Result: h75

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 1.533 ↓ 13.0 13 1

Limit (cost=154.07..154.08 rows=1 width=12,637) (actual time=1.494..1.533 rows=13 loops=1)

2. 0.061 1.500 ↓ 13.0 13 1

Sort (cost=154.07..154.08 rows=1 width=12,637) (actual time=1.492..1.500 rows=13 loops=1)

  • Sort Key: activities.""sortOrder"", activities.id
  • Sort Method: quicksort Memory: 34kB
3. 0.026 1.439 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.70..154.06 rows=1 width=12,637) (actual time=0.387..1.439 rows=13 loops=1)

4. 0.031 1.400 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.55..153.45 rows=1 width=12,481) (actual time=0.383..1.400 rows=13 loops=1)

5. 0.051 1.252 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.13..152.47 rows=1 width=12,465) (actual time=0.368..1.252 rows=13 loops=1)

  • Join Filter: (aagp_cs.id = aagp.""completionStatusId"")
  • Rows Removed by Join Filter: 39
6. 0.018 1.175 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.13..150.86 rows=1 width=12,454) (actual time=0.359..1.175 rows=13 loops=1)

  • Join Filter: (aagp.""userId"" = activity_participants.""userId"")
7. 0.033 1.144 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.57..148.50 rows=1 width=12,495) (actual time=0.356..1.144 rows=13 loops=1)

8. 0.030 1.111 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.15..145.68 rows=1 width=12,414) (actual time=0.352..1.111 rows=13 loops=1)

9. 0.029 1.081 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.01..145.32 rows=1 width=10,866) (actual time=0.350..1.081 rows=13 loops=1)

10. 0.035 1.052 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.73..143.82 rows=1 width=10,531) (actual time=0.348..1.052 rows=13 loops=1)

11. 0.032 1.017 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.59..142.94 rows=1 width=10,015) (actual time=0.344..1.017 rows=13 loops=1)

12. 0.030 0.985 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.45..142.06 rows=1 width=9,499) (actual time=0.341..0.985 rows=13 loops=1)

13. 0.014 0.955 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.30..141.19 rows=1 width=8,983) (actual time=0.337..0.955 rows=13 loops=1)

14. 0.027 0.928 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.16..140.31 rows=1 width=7,947) (actual time=0.335..0.928 rows=13 loops=1)

15. 0.033 0.901 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.02..139.43 rows=1 width=6,915) (actual time=0.333..0.901 rows=13 loops=1)

16. 0.028 0.868 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.87..138.55 rows=1 width=6,399) (actual time=0.330..0.868 rows=13 loops=1)

17. 0.024 0.827 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.73..137.67 rows=1 width=6,315) (actual time=0.323..0.827 rows=13 loops=1)

18. 0.028 0.764 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.58..136.79 rows=1 width=5,799) (actual time=0.317..0.764 rows=13 loops=1)

19. 0.019 0.710 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.44..135.90 rows=1 width=5,283) (actual time=0.313..0.710 rows=13 loops=1)

20. 0.028 0.678 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.29..135.02 rows=1 width=4,767) (actual time=0.310..0.678 rows=13 loops=1)

21. 0.034 0.650 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.15..134.14 rows=1 width=4,251) (actual time=0.308..0.650 rows=13 loops=1)

22. 0.037 0.590 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.00..133.26 rows=1 width=3,735) (actual time=0.302..0.590 rows=13 loops=1)

23. 0.051 0.527 ↓ 13.0 13 1

Nested Loop Left Join (cost=41.86..132.38 rows=1 width=3,219) (actual time=0.296..0.527 rows=13 loops=1)

  • Join Filter: (completion_statuses.id = activity_participants.""completionStatusId"")
  • Rows Removed by Join Filter: 26
24. 0.032 0.450 ↓ 13.0 13 1

Nested Loop Left Join (cost=41.86..130.78 rows=1 width=3,204) (actual time=0.288..0.450 rows=13 loops=1)

25. 0.023 0.418 ↓ 13.0 13 1

Nested Loop Left Join (cost=41.72..130.39 rows=1 width=3,193) (actual time=0.284..0.418 rows=13 loops=1)

26. 0.068 0.356 ↓ 13.0 13 1

Hash Join (cost=41.59..130.00 rows=1 width=3,079) (actual time=0.277..0.356 rows=13 loops=1)

  • Hash Cond: (activity_participants.""activityId"" = activities.id)
  • Join Filter: (((activities.""deletedAt"" IS NULL) AND (activity_participants.""deletedAt"" IS NULL)) OR (hashed SubPlan 1))
27. 0.200 0.200 ↑ 1.1 64 1

Index Scan using activity_participants_userid_index on activity_participants (cost=0.56..88.60 rows=72 width=123) (actual time=0.030..0.200 rows=64 loops=1)

  • Index Cond: (""userId"" = '24a8398514996d6da25375deccf74170f8770f52'::text)
28. 0.029 0.088 ↑ 1.9 13 1

Hash (cost=36.85..36.85 rows=25 width=2,960) (actual time=0.088..0.088 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
29. 0.059 0.059 ↑ 1.9 13 1

Index Scan using activity_rootid on activities (cost=0.42..36.85 rows=25 width=2,960) (actual time=0.014..0.059 rows=13 loops=1)

  • Index Cond: (""rootId"" = ANY ('{54318,54324,54304,54310,54312}'::integer[]))
30.          

SubPlan (for Hash Join)

31. 0.000 0.000 ↓ 0.0 0

Seq Scan on deleted_reasons deleted_reasons_1 (cost=0.00..1.61 rows=2 width=4) (never executed)

  • Filter: ((value)::text = ANY ('{EXPIRED,LOST_ELIGIBILITY}'::text[]))
32. 0.039 0.039 ↑ 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.002..0.003 rows=1 loops=13)

  • Index Cond: (id = activity_participants.""createdReasonId"")
33. 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: (id = activity_participants.""deletedReasonId"")
34. 0.026 0.026 ↑ 1.0 3 13

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

35. 0.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (activities.""prefixId"" = id)
36. 0.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (activities.""activityTypeId"" = id)
37. 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)
38. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""completionLabelId"" = id)
39. 0.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (activities.""contentTypeId"" = id)
40. 0.039 0.039 ↑ 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.002..0.003 rows=1 loops=13)

  • Index Cond: (activities.""reportingTypeId"" = id)
41. 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)
42. 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)
43. 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)
44. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""activityUnitUuid"" = uuid)
45. 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)
46. 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)
47. 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)
48. 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)
49. 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)
50. 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)
51. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: ((""userId"" = '24a8398514996d6da25375deccf74170f8770f52'::text) AND (""activityGroupId"" = aag.id))
52. 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)

53. 0.013 0.117 ↓ 0.0 0 13

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

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

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

55. 0.091 0.091 ↓ 0.0 0 13

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

  • Index Cond: (""activityParticipantsUuid"" = activity_participants.uuid)
  • Heap Fetches: 0
56. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""wellsourceHraSettingsId"" = id)