explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HwxP : Optimization for: plan #Geki

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.018 0.079 ↓ 0.0 0 1

Sort (cost=1,080.87..1,081.00 rows=53 width=11,827) (actual time=0.079..0.079 rows=0 loops=1)

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

Initplan (for Sort)

3. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_types_value_unique on activity_types activity_types_1 (cost=0.14..2.45 rows=1 width=4) (never executed)

  • Index Cond: ((value)::text = 'HEALTH_MEASURE_TARGET'::text)
4. 0.000 0.061 ↓ 0.0 0 1

Nested Loop Left Join (cost=550.64..1,076.90 rows=53 width=11,827) (actual time=0.061..0.061 rows=0 loops=1)

5. 0.001 0.061 ↓ 0.0 0 1

Nested Loop Left Join (cost=550.37..1,045.90 rows=53 width=10,279) (actual time=0.061..0.061 rows=0 loops=1)

6. 0.001 0.060 ↓ 0.0 0 1

Nested Loop Left Join (cost=550.22..1,024.51 rows=53 width=9,763) (actual time=0.059..0.060 rows=0 loops=1)

7. 0.001 0.059 ↓ 0.0 0 1

Nested Loop Left Join (cost=550.08..1,003.11 rows=53 width=9,247) (actual time=0.059..0.059 rows=0 loops=1)

8. 0.000 0.058 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.94..981.72 rows=53 width=8,731) (actual time=0.058..0.058 rows=0 loops=1)

9. 0.001 0.058 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.79..960.19 rows=53 width=8,215) (actual time=0.057..0.058 rows=0 loops=1)

10. 0.002 0.057 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.65..938.80 rows=53 width=7,699) (actual time=0.057..0.057 rows=0 loops=1)

11. 0.000 0.055 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.51..919.75 rows=53 width=7,183) (actual time=0.055..0.055 rows=0 loops=1)

12. 0.001 0.056 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.37..898.22 rows=53 width=6,667) (actual time=0.055..0.056 rows=0 loops=1)

13. 0.002 0.055 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.22..876.69 rows=53 width=6,151) (actual time=0.055..0.055 rows=0 loops=1)

14. 0.000 0.053 ↓ 0.0 0 1

Nested Loop Left Join (cost=549.08..856.59 rows=53 width=5,995) (actual time=0.053..0.053 rows=0 loops=1)

  • Filter: ((((activities.""biometricStartDate"" IS NULL) OR (activities.""biometricStartDate"" <= '2019-09-23 00:00:00+00'::timestamp with time zone)) AND ((activities.""biometricEndDate"" IS NULL) OR (activities.""biometricEndDate"" >= '2019-09-23 00:00:00+00'::timestamp with time zone)) AND (event_activities.""eventType"" = 'BIOMETRIC_SCREENINGS'::text)) OR ((activities.""activityTypeId"" = $0) AND (activity_health_measures.""startDate"" <= '2019-09-23 00:00:00+00'::timestamp with time zone) AND (activity_health_measures.""endDate"" >= '2019-09-23 00:00:00+00'::timestamp with time zone)))
15. 0.003 0.054 ↓ 0.0 0 1

Hash Left Join (cost=548.80..698.39 rows=246 width=5,660) (actual time=0.053..0.054 rows=0 loops=1)

  • Hash Cond: (activities.""contentTypeId"" = content_types.id)
16. 0.000 0.051 ↓ 0.0 0 1

Hash Left Join (cost=510.45..647.02 rows=246 width=5,144) (actual time=0.051..0.051 rows=0 loops=1)

  • Hash Cond: (activities.""completionLabelId"" = completion_labels.id)
17. 0.000 0.051 ↓ 0.0 0 1

Hash Left Join (cost=472.10..594.55 rows=246 width=4,628) (actual time=0.051..0.051 rows=0 loops=1)

  • Hash Cond: (activities.""categoryTypeId"" = category_types.id)
18. 0.003 0.052 ↓ 0.0 0 1

Hash Left Join (cost=433.75..555.17 rows=246 width=4,112) (actual time=0.051..0.052 rows=0 loops=1)

  • Hash Cond: (activities.""activityTypeId"" = activity_types.id)
19. 0.000 0.049 ↓ 0.0 0 1

Hash Left Join (cost=395.40..491.30 rows=246 width=3,596) (actual time=0.049..0.049 rows=0 loops=1)

  • Hash Cond: (activities.""prefixId"" = activity_prefixes.id)
20. 0.002 0.049 ↓ 0.0 0 1

Merge Right Join (cost=357.05..428.63 rows=246 width=3,080) (actual time=0.049..0.049 rows=0 loops=1)

  • Merge Cond: (event_activities.id = activities.""eventActivityId"")
21. 0.008 0.008 ↑ 500.0 1 1

Index Scan using event_activities_pkey on event_activities (cost=0.15..65.85 rows=500 width=84) (actual time=0.008..0.008 rows=1 loops=1)

22. 0.009 0.039 ↓ 0.0 0 1

Sort (cost=356.90..357.52 rows=246 width=2,996) (actual time=0.039..0.039 rows=0 loops=1)

  • Sort Key: activities.""eventActivityId"
  • Sort Method: quicksort Memory: 25kB
23. 0.002 0.030 ↓ 0.0 0 1

Merge Right Join (cost=321.27..347.13 rows=246 width=2,996) (actual time=0.029..0.030 rows=0 loops=1)

  • Merge Cond: (hra_activity_settings.id = activities.""hraSettingsId"")
24. 0.008 0.008 ↑ 200.0 1 1

Index Scan using hra_activity_settings_pkey on hra_activity_settings (cost=0.14..25.46 rows=200 width=36) (actual time=0.008..0.008 rows=1 loops=1)

25. 0.009 0.020 ↓ 0.0 0 1

Sort (cost=319.84..320.45 rows=246 width=2,960) (actual time=0.020..0.020 rows=0 loops=1)

  • Sort Key: activities.""hraSettingsId"
  • Sort Method: quicksort Memory: 25kB
26. 0.011 0.011 ↓ 0.0 0 1

Index Scan using ""sponsorId_activities"" on activities (cost=0.42..310.07 rows=246 width=2,960) (actual time=0.010..0.011 rows=0 loops=1)

  • Index Cond: (""sponsorId"" = '8dc869d1-6cb7-45bf-ad7e-4347b18613e2'::uuid)
  • Filter: (""deletedAt"" IS NULL)
27. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.00..24.00 rows=140 width=520) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Seq Scan on activity_prefixes (cost=0.00..24.00 rows=140 width=520) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.00..24.00 rows=140 width=520) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Seq Scan on activity_types (cost=0.00..24.00 rows=140 width=520) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.00..24.00 rows=140 width=520) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Seq Scan on category_types (cost=0.00..24.00 rows=140 width=520) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.00..24.00 rows=140 width=520) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Seq Scan on completion_labels (cost=0.00..24.00 rows=140 width=520) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.00..24.00 rows=140 width=520) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Seq Scan on content_types (cost=0.00..24.00 rows=140 width=520) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_health_measures_pkey on activity_health_measures (cost=0.28..0.53 rows=1 width=335) (never executed)

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

Index Scan using wellsource_hra_settings_pkey on wellsource_hra_settings (cost=0.14..0.28 rows=1 width=156) (never executed)

  • Index Cond: (activities.""wellsourceHraSettingsId"" = id)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using reporting_types_pkey on reporting_types (cost=0.14..0.31 rows=1 width=520) (never executed)

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

Index Scan using time_units_pkey on time_units fu (cost=0.14..0.31 rows=1 width=520) (never executed)

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

Index Scan using activity_health_measure_types_pkey on activity_health_measure_types (cost=0.14..0.26 rows=1 width=520) (never executed)

  • Index Cond: (activity_health_measures.""healthMeasureTypeId"" = id)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_categories_uuid_unique on activity_categories (cost=0.14..0.30 rows=1 width=532) (never executed)

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

Index Scan using activity_subcategories_uuid_unique on activity_subcategories (cost=0.14..0.31 rows=1 width=532) (never executed)

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

Index Scan using activity_kinds_uuid_unique on activity_kinds (cost=0.14..0.30 rows=1 width=532) (never executed)

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

Index Scan using activity_metrics_uuid_unique on activity_metrics (cost=0.14..0.30 rows=1 width=532) (never executed)

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

Index Scan using activity_units_uuid_unique on activity_units (cost=0.14..0.30 rows=1 width=532) (never executed)

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

Index Scan using activity_questions_uuid_unique on activity_questions (cost=0.27..0.48 rows=1 width=532) (never executed)

  • Index Cond: (activities.""activityQuestionUuid"" = uuid)