explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uEJP

Settings
# exclusive inclusive rows x rows loops node
1. 2.081 1,931.648 ↑ 2.4 318 1

Sort (cost=84,798.13..84,800.08 rows=779 width=11,827) (actual time=1,931.546..1,931.648 rows=318 loops=1)

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

Initplan (for Sort)

3. 0.011 0.011 ↑ 1.0 1 1

Index Scan using activity_types_value_unique on activity_types activity_types_1 (cost=0.14..2.45 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((value)::text = 'HEALTH_MEASURE_TARGET'::text)
4. 0.591 1,929.556 ↑ 2.4 318 1

Nested Loop Left Join (cost=595.81..84,758.27 rows=779 width=11,827) (actual time=123.700..1,929.556 rows=318 loops=1)

5. 0.552 1,928.647 ↑ 2.4 318 1

Nested Loop Left Join (cost=595.54..84,386.16 rows=779 width=10,279) (actual time=123.695..1,928.647 rows=318 loops=1)

6. 0.649 1,927.777 ↑ 2.4 318 1

Nested Loop Left Join (cost=595.40..84,113.45 rows=779 width=9,763) (actual time=123.689..1,927.777 rows=318 loops=1)

7. 0.955 1,926.810 ↑ 2.4 318 1

Nested Loop Left Join (cost=595.26..83,840.73 rows=779 width=9,247) (actual time=123.683..1,926.810 rows=318 loops=1)

8. 1.278 1,925.855 ↑ 2.4 318 1

Nested Loop Left Join (cost=595.11..83,568.01 rows=779 width=8,731) (actual time=123.677..1,925.855 rows=318 loops=1)

9. 0.855 1,923.941 ↑ 2.4 318 1

Nested Loop Left Join (cost=594.97..83,293.35 rows=779 width=8,215) (actual time=122.954..1,923.941 rows=318 loops=1)

10. 0.675 1,923.086 ↑ 2.4 318 1

Nested Loop Left Join (cost=594.83..83,020.63 rows=779 width=7,699) (actual time=122.950..1,923.086 rows=318 loops=1)

11. 0.614 1,922.093 ↑ 2.4 318 1

Nested Loop Left Join (cost=594.69..82,740.58 rows=779 width=7,183) (actual time=122.942..1,922.093 rows=318 loops=1)

12. 1.000 1,921.161 ↑ 2.4 318 1

Nested Loop Left Join (cost=594.54..82,465.92 rows=779 width=6,667) (actual time=122.936..1,921.161 rows=318 loops=1)

13. 0.862 1,918.889 ↑ 2.4 318 1

Nested Loop Left Join (cost=594.40..82,191.25 rows=779 width=6,151) (actual time=122.923..1,918.889 rows=318 loops=1)

14. 170.866 1,917.709 ↑ 2.4 318 1

Hash Left Join (cost=594.25..81,916.62 rows=779 width=5,995) (actual time=122.914..1,917.709 rows=318 loops=1)

  • Hash Cond: (activities.""activityHealthMeasureId"" = activity_health_measures.id)
  • Filter: (((activities.""deletedAt"" IS NULL) AND ((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) AND (activities.""sponsorId"" = '4c1e4570-e21a-47bd-b0ea-c5c1483130cb'::uuid)))
  • Rows Removed by Filter: 153867
15. 218.518 1,744.761 ↓ 1.0 154,185 1

Hash Left Join (cost=345.50..80,961.89 rows=153,794 width=5,660) (actual time=0.417..1,744.761 rows=154,185 loops=1)

  • Hash Cond: (activities.""hraSettingsId"" = hra_activity_settings.id)
16. 188.870 1,526.020 ↓ 1.0 154,185 1

Hash Left Join (cost=303.00..80,323.66 rows=153,794 width=5,624) (actual time=0.183..1,526.020 rows=154,185 loops=1)

  • Hash Cond: (activities.""contentTypeId"" = content_types.id)
17. 230.847 1,337.140 ↓ 1.0 154,185 1

Hash Left Join (cost=264.65..72,168.09 rows=153,794 width=5,108) (actual time=0.162..1,337.140 rows=154,185 loops=1)

  • Hash Cond: (activities.""completionLabelId"" = completion_labels.id)
18. 195.172 1,106.282 ↓ 1.0 154,185 1

Hash Left Join (cost=226.30..63,303.51 rows=153,794 width=4,592) (actual time=0.140..1,106.282 rows=154,185 loops=1)

  • Hash Cond: (activities.""eventActivityId"" = event_activities.id)
19. 174.676 911.083 ↓ 1.0 154,185 1

Hash Left Join (cost=115.05..60,490.63 rows=153,794 width=4,508) (actual time=0.107..911.083 rows=154,185 loops=1)

  • Hash Cond: (activities.""categoryTypeId"" = category_types.id)
20. 215.737 736.381 ↓ 1.0 154,185 1

Hash Left Join (cost=76.70..59,875.46 rows=153,794 width=3,992) (actual time=0.076..736.381 rows=154,185 loops=1)

  • Hash Cond: (activities.""activityTypeId"" = activity_types.id)
21. 210.140 520.636 ↓ 1.0 154,185 1

Hash Left Join (cost=38.35..43,880.98 rows=153,794 width=3,476) (actual time=0.060..520.636 rows=154,185 loops=1)

  • Hash Cond: (activities.""prefixId"" = activity_prefixes.id)
22. 310.466 310.466 ↓ 1.0 154,185 1

Seq Scan on activities (cost=0.00..28,613.40 rows=153,794 width=2,960) (actual time=0.012..310.466 rows=154,185 loops=1)

23. 0.015 0.030 ↑ 7.4 19 1

Hash (cost=24.00..24.00 rows=140 width=520) (actual time=0.030..0.030 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
24. 0.015 0.015 ↑ 7.4 19 1

Seq Scan on activity_prefixes (cost=0.00..24.00 rows=140 width=520) (actual time=0.006..0.015 rows=19 loops=1)

25. 0.002 0.008 ↑ 46.7 3 1

Hash (cost=24.00..24.00 rows=140 width=520) (actual time=0.008..0.008 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.006 0.006 ↑ 46.7 3 1

Seq Scan on activity_types (cost=0.00..24.00 rows=140 width=520) (actual time=0.004..0.006 rows=3 loops=1)

27. 0.012 0.026 ↑ 7.8 18 1

Hash (cost=24.00..24.00 rows=140 width=520) (actual time=0.026..0.026 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 0.014 0.014 ↑ 7.8 18 1

Seq Scan on category_types (cost=0.00..24.00 rows=140 width=520) (actual time=0.003..0.014 rows=18 loops=1)

29. 0.010 0.027 ↑ 38.5 13 1

Hash (cost=60.00..60.00 rows=500 width=84) (actual time=0.027..0.027 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
30. 0.017 0.017 ↑ 38.5 13 1

Seq Scan on event_activities (cost=0.00..60.00 rows=500 width=84) (actual time=0.007..0.017 rows=13 loops=1)

31. 0.005 0.011 ↑ 35.0 4 1

Hash (cost=24.00..24.00 rows=140 width=520) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.006 0.006 ↑ 35.0 4 1

Seq Scan on completion_labels (cost=0.00..24.00 rows=140 width=520) (actual time=0.003..0.006 rows=4 loops=1)

33. 0.004 0.010 ↑ 35.0 4 1

Hash (cost=24.00..24.00 rows=140 width=520) (actual time=0.010..0.010 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.006 0.006 ↑ 35.0 4 1

Seq Scan on content_types (cost=0.00..24.00 rows=140 width=520) (actual time=0.004..0.006 rows=4 loops=1)

35. 0.119 0.223 ↓ 1.1 220 1

Hash (cost=22.00..22.00 rows=200 width=36) (actual time=0.223..0.223 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
36. 0.104 0.104 ↓ 1.1 220 1

Seq Scan on hra_activity_settings (cost=0.00..22.00 rows=200 width=36) (actual time=0.011..0.104 rows=220 loops=1)

37. 1.023 2.082 ↓ 1.1 1,158 1

Hash (cost=136.00..136.00 rows=1,100 width=335) (actual time=2.082..2.082 rows=1,158 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 173kB
38. 1.059 1.059 ↓ 1.1 1,158 1

Seq Scan on activity_health_measures (cost=0.00..136.00 rows=1,100 width=335) (actual time=0.006..1.059 rows=1,158 loops=1)

39. 0.318 0.318 ↓ 0.0 0 318

Index Scan using wellsource_hra_settings_pkey on wellsource_hra_settings (cost=0.14..0.25 rows=1 width=156) (actual time=0.001..0.001 rows=0 loops=318)

  • Index Cond: (activities.""wellsourceHraSettingsId"" = id)
40. 1.272 1.272 ↑ 1.0 1 318

Index Scan using reporting_types_pkey on reporting_types (cost=0.14..0.25 rows=1 width=520) (actual time=0.003..0.004 rows=1 loops=318)

  • Index Cond: (activities.""reportingTypeId"" = id)
41. 0.318 0.318 ↓ 0.0 0 318

Index Scan using time_units_pkey on time_units fu (cost=0.14..0.25 rows=1 width=520) (actual time=0.001..0.001 rows=0 loops=318)

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

Index Scan using activity_health_measure_types_pkey on activity_health_measure_types (cost=0.14..0.26 rows=1 width=520) (actual time=0.001..0.001 rows=0 loops=318)

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

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

  • Index Cond: (activities.""activityCategoryUuid"" = uuid)
44. 0.636 0.636 ↓ 0.0 0 318

Index Scan using activity_subcategories_uuid_unique on activity_subcategories (cost=0.14..0.25 rows=1 width=532) (actual time=0.002..0.002 rows=0 loops=318)

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

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

  • Index Cond: (activities.""activityKindUuid"" = uuid)
46. 0.318 0.318 ↓ 0.0 0 318

Index Scan using activity_metrics_uuid_unique on activity_metrics (cost=0.14..0.25 rows=1 width=532) (actual time=0.001..0.001 rows=0 loops=318)

  • Index Cond: (activities.""activityMetricUuid"" = uuid)
47. 0.318 0.318 ↓ 0.0 0 318

Index Scan using activity_units_uuid_unique on activity_units (cost=0.14..0.25 rows=1 width=532) (actual time=0.001..0.001 rows=0 loops=318)

  • Index Cond: (activities.""activityUnitUuid"" = uuid)
48. 0.318 0.318 ↓ 0.0 0 318

Index Scan using activity_questions_uuid_unique on activity_questions (cost=0.27..0.38 rows=1 width=532) (actual time=0.001..0.001 rows=0 loops=318)

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