explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IrfD

Settings
# exclusive inclusive rows x rows loops node
1. 0.040 1.410 ↓ 13.0 13 1

Sort (cost=154.20..154.20 rows=1 width=12,637) (actual time=1.403..1.410 rows=13 loops=1)

  • Sort Key: activities.""sortOrder"", activities.id
  • Sort Method: quicksort Memory: 34kB
2.          

Initplan (for Sort)

3. 0.004 0.024 ↑ 1.0 1 1

Result (cost=0.58..0.68 rows=1 width=4) (actual time=0.023..0.024 rows=1 loops=1)

4.          

Initplan (for Result)

5. 0.002 0.020 ↑ 1.0 1 1

Limit (cost=0.43..0.58 rows=1 width=4) (actual time=0.019..0.020 rows=1 loops=1)

6. 0.018 0.018 ↑ 1,535,445.0 1 1

Index Only Scan Backward using activity_participants_metrics_pkey on activity_participants_metrics activity_participants_metrics_1 (cost=0.43..233,950.23 rows=1,535,445 width=4) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (id IS NOT NULL)
  • Heap Fetches: 1
7. 0.034 1.346 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.96..153.51 rows=1 width=12,637) (actual time=0.397..1.346 rows=13 loops=1)

8. 0.062 1.312 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.81..152.89 rows=1 width=12,481) (actual time=0.394..1.312 rows=13 loops=1)

  • Join Filter: (activity_participants_metrics.""activityParticipantsUuid"" = activity_participants.uuid)
  • Rows Removed by Join Filter: 13
9. 0.020 1.198 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.39..150.05 rows=1 width=12,465) (actual time=0.359..1.198 rows=13 loops=1)

10. 0.032 1.165 ↓ 13.0 13 1

Nested Loop Left Join (cost=45.26..149.64 rows=1 width=12,454) (actual time=0.355..1.165 rows=13 loops=1)

  • Join Filter: (aagp.""userId"" = activity_participants.""userId"")
11. 0.030 1.133 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.70..147.28 rows=1 width=12,495) (actual time=0.352..1.133 rows=13 loops=1)

12. 0.036 1.103 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.28..144.45 rows=1 width=12,414) (actual time=0.349..1.103 rows=13 loops=1)

13. 0.031 1.067 ↓ 13.0 13 1

Nested Loop Left Join (cost=44.14..144.09 rows=1 width=10,866) (actual time=0.346..1.067 rows=13 loops=1)

14. 0.026 1.036 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.86..142.60 rows=1 width=10,531) (actual time=0.344..1.036 rows=13 loops=1)

15. 0.020 1.010 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.72..141.72 rows=1 width=10,015) (actual time=0.341..1.010 rows=13 loops=1)

16. 0.014 0.977 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.58..140.84 rows=1 width=9,499) (actual time=0.339..0.977 rows=13 loops=1)

17. 0.028 0.950 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.43..139.96 rows=1 width=8,983) (actual time=0.337..0.950 rows=13 loops=1)

18. 0.032 0.922 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.29..139.08 rows=1 width=7,947) (actual time=0.333..0.922 rows=13 loops=1)

19. 0.030 0.890 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.15..138.20 rows=1 width=6,915) (actual time=0.331..0.890 rows=13 loops=1)

20. 0.028 0.860 ↓ 13.0 13 1

Nested Loop Left Join (cost=43.00..137.32 rows=1 width=6,399) (actual time=0.328..0.860 rows=13 loops=1)

21. 0.027 0.819 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.86..136.44 rows=1 width=6,315) (actual time=0.321..0.819 rows=13 loops=1)

22. 0.027 0.753 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.71..135.56 rows=1 width=5,799) (actual time=0.315..0.753 rows=13 loops=1)

23. 0.016 0.700 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.57..134.68 rows=1 width=5,283) (actual time=0.313..0.700 rows=13 loops=1)

24. 0.033 0.671 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.42..133.80 rows=1 width=4,767) (actual time=0.310..0.671 rows=13 loops=1)

25. 0.021 0.638 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.28..132.92 rows=1 width=4,251) (actual time=0.307..0.638 rows=13 loops=1)

26. 0.019 0.578 ↓ 13.0 13 1

Nested Loop Left Join (cost=42.13..132.04 rows=1 width=3,735) (actual time=0.301..0.578 rows=13 loops=1)

27. 0.037 0.520 ↓ 13.0 13 1

Nested Loop Left Join (cost=41.99..131.16 rows=1 width=3,219) (actual time=0.295..0.520 rows=13 loops=1)

28. 0.030 0.457 ↓ 13.0 13 1

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

29. 0.027 0.427 ↓ 13.0 13 1

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

30. 0.067 0.361 ↓ 13.0 13 1

Hash Join (cost=41.59..130.00 rows=1 width=3,079) (actual time=0.280..0.361 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 3))
31. 0.205 0.205 ↑ 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.031..0.205 rows=64 loops=1)

  • Index Cond: (""userId"" = '24a8398514996d6da25375deccf74170f8770f52'::text)
32. 0.032 0.089 ↑ 1.9 13 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
33. 0.057 0.057 ↑ 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.057 rows=13 loops=1)

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

SubPlan (for Hash Join)

35. 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[]))
36. 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"")
37. 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"")
38. 0.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (id = activity_participants.""completionStatusId"")
39. 0.039 0.039 ↑ 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.003 rows=1 loops=13)

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

  • Index Cond: (activities.""activityTypeId"" = id)
41. 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)
42. 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.000..0.001 rows=0 loops=13)

  • Index Cond: (activities.""completionLabelId"" = id)
43. 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)
44. 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)
45. 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)
46. 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)
47. 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)
48. 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)
49. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""activityCategoryUuid"" = uuid)
50. 0.013 0.013 ↓ 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.001..0.001 rows=0 loops=13)

  • Index Cond: (activities.""activitySubcategoryUuid"" = uuid)
51. 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)
52. 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)
53. 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)
54. 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)
55. 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))
56. 0.013 0.013 ↓ 0.0 0 13

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

  • Index Cond: (id = aagp.""completionStatusId"")
57. 0.052 0.052 ↑ 1.0 1 13

Index Scan using activity_participants_metrics_pkey on activity_participants_metrics (cost=0.43..2.74 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=13)

  • Index Cond: (id = $1)
58. 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)