explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LCzIa

Settings
# exclusive inclusive rows x rows loops node
1. 2.396 480.835 ↑ 1.0 1 1

Result (cost=120,276.50..120,276.51 rows=1 width=32) (actual time=480.834..480.835 rows=1 loops=1)

2.          

CTE matches

3. 0.029 0.176 ↓ 3.4 24 1

Hash Join (cost=5.97..14.52 rows=7 width=46) (actual time=0.154..0.176 rows=24 loops=1)

  • Hash Cond: (user_media_offline.media_id = media.id)
4. 0.036 0.036 ↑ 1.0 27 1

Index Only Scan using user_media_offline_pkey on user_media_offline (cost=0.28..8.75 rows=27 width=16) (actual time=0.028..0.036 rows=27 loops=1)

  • Index Cond: (user_id = '3b634574-260d-4d74-880d-075c1be5a8cf'::uuid)
  • Heap Fetches: 0
5. 0.028 0.111 ↓ 2.0 46 1

Hash (cost=5.41..5.41 rows=23 width=46) (actual time=0.111..0.111 rows=46 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
6. 0.083 0.083 ↓ 2.0 46 1

Seq Scan on media (cost=0.00..5.41 rows=23 width=46) (actual time=0.020..0.083 rows=46 loops=1)

  • Filter: ((state = 'ACTIVE'::text) AND (lifecycle_status = 'ACTIVE'::text))
  • Rows Removed by Filter: 48
7.          

CTE view

8. 0.060 0.253 ↓ 3.4 24 1

Sort (cost=0.24..0.26 rows=7 width=48) (actual time=0.247..0.253 rows=24 loops=1)

  • Sort Key: matches.name, matches.id
  • Sort Method: quicksort Memory: 27kB
9. 0.193 0.193 ↓ 3.4 24 1

CTE Scan on matches (cost=0.00..0.14 rows=7 width=48) (actual time=0.156..0.193 rows=24 loops=1)

10.          

Initplan (forResult)

11. 133.136 478.439 ↑ 1.0 1 1

Aggregate (cost=120,261.72..120,261.73 rows=1 width=32) (actual time=478.438..478.439 rows=1 loops=1)

12. 0.035 345.303 ↓ 3.4 24 1

Nested Loop Left Join (cost=17,176.09..120,261.70 rows=7 width=80) (actual time=47.350..345.303 rows=24 loops=1)

13. 0.268 0.268 ↓ 3.4 24 1

CTE Scan on view (cost=0.00..0.14 rows=7 width=48) (actual time=0.250..0.268 rows=24 loops=1)

14. 5.880 345.000 ↑ 1.0 1 24

Nested Loop Left Join (cost=17,176.09..17,180.21 rows=1 width=48) (actual time=14.372..14.375 rows=1 loops=24)

15. 4.392 339.120 ↑ 1.0 1 24

Nested Loop Left Join (cost=17,105.42..17,109.01 rows=1 width=322) (actual time=14.128..14.130 rows=1 loops=24)

16. 0.024 334.728 ↑ 1.0 1 24

Nested Loop Left Join (cost=16,895.20..16,898.76 rows=1 width=290) (actual time=13.945..13.947 rows=1 loops=24)

17. 0.048 329.376 ↑ 1.0 1 24

Nested Loop Left Join (cost=16,628.59..16,632.12 rows=1 width=258) (actual time=13.722..13.724 rows=1 loops=24)

18. 0.048 39.624 ↑ 1.0 1 24

Nested Loop Left Join (cost=1,854.35..1,857.85 rows=1 width=226) (actual time=1.649..1.651 rows=1 loops=24)

19. 0.048 0.648 ↑ 1.0 1 24

Nested Loop Left Join (cost=5.95..9.42 rows=1 width=194) (actual time=0.026..0.027 rows=1 loops=24)

20. 0.096 0.096 ↑ 1.0 1 24

Index Scan using media_pkey on media vm (cost=0.14..3.59 rows=1 width=174) (actual time=0.003..0.004 rows=1 loops=24)

  • Index Cond: (id = view.id)
  • Filter: (state <> 'DELETED'::text)
21. 0.024 0.504 ↑ 1.0 1 24

Limit (cost=5.81..5.81 rows=1 width=52) (actual time=0.021..0.021 rows=1 loops=24)

22. 0.120 0.480 ↑ 2.0 1 24

Sort (cost=5.81..5.81 rows=2 width=52) (actual time=0.020..0.020 rows=1 loops=24)

  • Sort Key: media_version.version DESC
  • Sort Method: quicksort Memory: 25kB
23. 0.360 0.360 ↑ 1.0 2 24

Seq Scan on media_version (cost=0.00..5.80 rows=2 width=52) (actual time=0.005..0.015 rows=2 loops=24)

  • Filter: (media_id = vm.id)
  • Rows Removed by Filter: 142
24. 0.312 38.928 ↑ 1.0 1 24

Aggregate (cost=1,848.39..1,848.40 rows=1 width=32) (actual time=1.622..1.622 rows=1 loops=24)

25. 0.081 38.616 ↑ 1.5 2 24

Nested Loop Left Join (cost=615.34..1,848.38 rows=3 width=51) (actual time=0.772..1.609 rows=2 loops=24)

26. 0.120 0.336 ↑ 1.5 2 24

Hash Join (cost=4.36..5.61 rows=3 width=35) (actual time=0.011..0.014 rows=2 loops=24)

  • Hash Cond: (topic.id = media_topic.topic_id)
27. 0.096 0.096 ↑ 1.0 16 24

Seq Scan on topic (cost=0.00..1.20 rows=16 width=35) (actual time=0.001..0.004 rows=16 loops=24)

  • Filter: (state <> 'DELETED'::text)
28. 0.024 0.120 ↑ 1.5 2 24

Hash (cost=4.32..4.32 rows=3 width=16) (actual time=0.005..0.005 rows=2 loops=24)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
29. 0.096 0.096 ↑ 1.5 2 24

Index Only Scan using media_topic_pkey on media_topic (cost=0.27..4.32 rows=3 width=16) (actual time=0.003..0.004 rows=2 loops=24)

  • Index Cond: (media_id = vm.id)
  • Heap Fetches: 0
30. 0.204 38.199 ↑ 1.0 1 51

Nested Loop Left Join (cost=610.98..614.25 rows=1 width=48) (actual time=0.748..0.749 rows=1 loops=51)

31. 0.153 0.153 ↑ 1.0 1 51

Index Scan using topic_pkey on topic t (cost=0.14..0.90 rows=1 width=47) (actual time=0.002..0.003 rows=1 loops=51)

  • Index Cond: (id = topic.id)
  • Filter: (state <> 'DELETED'::text)
32. 1.224 37.383 ↑ 1.0 1 51

Aggregate (cost=610.85..610.86 rows=1 width=32) (actual time=0.733..0.733 rows=1 loops=51)

33. 0.867 36.159 ↓ 1.7 12 51

Nested Loop (cost=83.06..610.83 rows=7 width=52) (actual time=0.071..0.709 rows=12 loops=51)

  • Join Filter: (activity_type.id = activity_type_1.id)
  • Rows Removed by Join Filter: 66
34. 0.051 35.292 ↓ 1.7 12 51

Nested Loop Left Join (cost=83.06..608.47 rows=7 width=84) (actual time=0.070..0.692 rows=12 loops=51)

35. 0.385 0.969 ↓ 1.7 12 51

Hash Join (cost=1.31..3.94 rows=7 width=52) (actual time=0.005..0.019 rows=12 loops=51)

  • Hash Cond: (topic_activity_type.activity_type_id = activity_type.id)
36. 0.561 0.561 ↓ 1.5 12 51

Seq Scan on topic_activity_type (cost=0.00..2.60 rows=8 width=16) (actual time=0.004..0.011 rows=12 loops=51)

  • Filter: (topic_id = t.id)
  • Rows Removed by Filter: 116
37. 0.009 0.023 ↓ 1.1 13 1

Hash (cost=1.16..1.16 rows=12 width=36) (actual time=0.023..0.023 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.014 0.014 ↓ 1.1 13 1

Seq Scan on activity_type (cost=0.00..1.16 rows=12 width=36) (actual time=0.007..0.014 rows=13 loops=1)

  • Filter: (state <> 'DELETED'::text)
39. 1.224 34.272 ↑ 1.0 1 612

Nested Loop Left Join (cost=81.75..86.35 rows=1 width=48) (actual time=0.052..0.056 rows=1 loops=612)

40. 0.612 31.212 ↑ 1.0 1 612

Nested Loop Left Join (cost=48.46..53.02 rows=1 width=269) (actual time=0.048..0.051 rows=1 loops=612)

41. 0.612 17.136 ↑ 1.0 1 612

Nested Loop Left Join (cost=19.04..23.58 rows=1 width=237) (actual time=0.025..0.028 rows=1 loops=612)

42. 0.612 14.688 ↑ 1.0 1 612

Nested Loop Left Join (cost=9.53..14.03 rows=1 width=205) (actual time=0.021..0.024 rows=1 loops=612)

43. 0.612 8.568 ↑ 1.0 1 612

Nested Loop Left Join (cost=7.87..12.35 rows=1 width=173) (actual time=0.011..0.014 rows=1 loops=612)

  • Join Filter: (touch_point_group.id = touch_point_group_1.id)
  • Rows Removed by Join Filter: 4
44. 1.224 6.120 ↑ 1.0 1 612

Nested Loop Left Join (cost=0.54..4.85 rows=1 width=157) (actual time=0.009..0.010 rows=1 loops=612)

  • Join Filter: (touch_point_group.id = at.touch_point_group_id)
  • Rows Removed by Join Filter: 2
45. 0.000 4.284 ↑ 1.0 1 612

Nested Loop Left Join (cost=0.54..3.73 rows=1 width=157) (actual time=0.007..0.007 rows=1 loops=612)

46. 0.612 3.672 ↑ 1.0 1 612

Nested Loop Left Join (cost=0.41..2.87 rows=1 width=141) (actual time=0.005..0.006 rows=1 loops=612)

47. 0.612 2.448 ↑ 1.0 1 612

Nested Loop (cost=0.27..2.01 rows=1 width=109) (actual time=0.004..0.004 rows=1 loops=612)

48. 1.224 1.224 ↑ 1.0 1 612

Index Scan using activity_type_pkey on activity_type at (cost=0.14..1.15 rows=1 width=93) (actual time=0.002..0.002 rows=1 loops=612)

  • Index Cond: (id = activity_type.id)
49. 0.612 0.612 ↑ 1.0 1 612

Index Only Scan using activity_type_pkey on activity_type activity_type_2 (cost=0.14..0.77 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=612)

  • Index Cond: (id = at.id)
  • Heap Fetches: 612
50. 0.612 0.612 ↑ 1.0 1 612

Index Only Scan using activity_type_pkey on activity_type activity_type_3 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=612)

  • Index Cond: (id = activity_type_2.id)
  • Heap Fetches: 612
51. 0.612 0.612 ↑ 1.0 1 612

Index Only Scan using activity_type_pkey on activity_type activity_type_4 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=612)

  • Index Cond: (id = activity_type_2.id)
  • Heap Fetches: 612
52. 0.612 0.612 ↑ 2.5 2 612

Seq Scan on touch_point_group (cost=0.00..1.06 rows=5 width=16) (actual time=0.001..0.001 rows=2 loops=612)

  • Filter: (state <> 'DELETED'::text)
53. 1.224 1.836 ↑ 1.0 5 612

Group (cost=7.33..7.38 rows=5 width=52) (actual time=0.001..0.003 rows=5 loops=612)

  • Group Key: touch_point_group_1.id, (array_length(COALESCE(array_agg(activity_type_5.id), '{}'::uuid[]), 1))
54. 0.543 0.612 ↑ 1.0 5 612

Sort (cost=7.33..7.35 rows=5 width=34) (actual time=0.000..0.001 rows=5 loops=612)

  • Sort Key: touch_point_group_1.id, (array_length(COALESCE(array_agg(activity_type_5.id), '{}'::uuid[]), 1))
  • Sort Method: quicksort Memory: 25kB
55. 0.012 0.069 ↑ 1.0 5 1

Nested Loop Left Join (cost=1.21..7.27 rows=5 width=34) (actual time=0.033..0.069 rows=5 loops=1)

56. 0.007 0.007 ↑ 1.0 5 1

Seq Scan on touch_point_group touch_point_group_1 (cost=0.00..1.06 rows=5 width=30) (actual time=0.005..0.007 rows=5 loops=1)

  • Filter: (state <> 'DELETED'::text)
57. 0.020 0.050 ↑ 1.0 1 5

Aggregate (cost=1.21..1.22 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=5)

58. 0.030 0.030 ↑ 2.5 2 5

Seq Scan on activity_type activity_type_5 (cost=0.00..1.20 rows=5 width=16) (actual time=0.004..0.006 rows=2 loops=5)

  • Filter: ((touch_point_group_id = touch_point_group_1.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
59. 4.284 5.508 ↑ 1.0 1 612

Aggregate (cost=1.65..1.66 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=612)

60. 1.224 1.224 ↑ 1.0 1 612

Seq Scan on activity_type_rule (cost=0.00..1.15 rows=1 width=53) (actual time=0.001..0.002 rows=1 loops=612)

  • Filter: (activity_type_id = at.id)
  • Rows Removed by Filter: 12
61. 1.224 1.836 ↑ 1.0 1 612

Aggregate (cost=9.51..9.52 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=612)

62. 0.000 0.612 ↓ 0.0 0 612

Bitmap Heap Scan on activity_type_dispatch_type (cost=4.16..9.50 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=612)

  • Recheck Cond: (activity_type_id = at.id)
63. 0.612 0.612 ↓ 0.0 0 612

Bitmap Index Scan on pk_activity_type_dispatch_type (cost=0.00..4.16 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=612)

  • Index Cond: (activity_type_id = at.id)
64. 1.836 13.464 ↑ 1.0 1 612

Aggregate (cost=29.42..29.43 rows=1 width=32) (actual time=0.022..0.022 rows=1 loops=612)

65. 0.612 11.628 ↑ 1.0 1 612

Nested Loop Left Join (cost=19.81..29.41 rows=1 width=94) (actual time=0.017..0.019 rows=1 loops=612)

66. 0.612 8.568 ↑ 1.0 1 612

Nested Loop Left Join (cost=16.68..26.25 rows=1 width=62) (actual time=0.012..0.014 rows=1 loops=612)

67. 0.612 3.060 ↑ 1.0 1 612

Nested Loop (cost=0.27..9.49 rows=1 width=46) (actual time=0.004..0.005 rows=1 loops=612)

68. 1.224 1.224 ↑ 1.0 1 612

Seq Scan on activity_type_assignment (cost=0.00..1.16 rows=1 width=33) (actual time=0.001..0.002 rows=1 loops=612)

  • Filter: (activity_type_id = at.id)
  • Rows Removed by Filter: 12
69. 1.224 1.224 ↑ 1.0 1 612

Index Scan using idx_organizational_unit_materialized_path_btree_idx on organizational_unit (cost=0.27..8.29 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=612)

  • Index Cond: (id = activity_type_assignment.organizational_unit_id)
  • Filter: (state <> 'DELETED'::text)
70. 0.612 4.896 ↑ 1.0 1 612

Nested Loop Left Join (cost=16.41..16.75 rows=1 width=48) (actual time=0.007..0.008 rows=1 loops=612)

71. 0.612 3.672 ↑ 1.0 1 612

Nested Loop (cost=0.53..0.84 rows=1 width=164) (actual time=0.006..0.006 rows=1 loops=612)

72. 0.612 2.448 ↑ 1.0 1 612

Nested Loop (cost=0.40..0.64 rows=1 width=145) (actual time=0.004..0.004 rows=1 loops=612)

73. 1.224 1.224 ↑ 1.0 1 612

Index Scan using pk_organizational_unit on organizational_unit ou (cost=0.27..0.46 rows=1 width=161) (actual time=0.002..0.002 rows=1 loops=612)

  • Index Cond: (id = organizational_unit.id)
  • Filter: (state <> 'DELETED'::text)
74. 0.612 0.612 ↑ 1.0 1 612

Index Scan using pk_organizational_hierarchy on organizational_hierarchy (cost=0.12..0.17 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=612)

  • Index Cond: (id = ou.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
75. 0.612 0.612 ↑ 1.0 1 612

Index Scan using pk_organizational_unit_type on organizational_unit_type (cost=0.13..0.18 rows=1 width=35) (actual time=0.001..0.001 rows=1 loops=612)

  • Index Cond: (id = ou.organizational_unit_type_id)
  • Filter: (state = 'ACTIVE'::text)
76. 0.612 0.612 ↑ 1.0 1 612

Aggregate (cost=15.88..15.89 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=612)

77. 0.000 0.000 ↓ 0.0 0 612

Seq Scan on organizational_unit_tag (cost=0.00..15.88 rows=2 width=32) (actual time=0.000..0.000 rows=0 loops=612)

  • Filter: (organizational_unit_id = ou.id)
78. 1.224 2.448 ↑ 1.0 1 612

Aggregate (cost=3.13..3.14 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=612)

79. 0.561 1.224 ↓ 0.0 0 612

Nested Loop (cost=0.00..3.12 rows=1 width=71) (actual time=0.002..0.002 rows=0 loops=612)

  • Join Filter: (consent_item.consent_type_id = consent_type.id)
  • Rows Removed by Join Filter: 0
80. 0.000 0.612 ↓ 0.0 0 612

Nested Loop (cost=0.00..2.08 rows=1 width=45) (actual time=0.001..0.001 rows=0 loops=612)

  • Join Filter: (activity_type_assignment_consent_item.consent_item_id = consent_item.id)
81. 0.612 0.612 ↓ 0.0 0 612

Seq Scan on activity_type_assignment_consent_item (cost=0.00..1.01 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=612)

  • Filter: (activity_type_assignment_id = activity_type_assignment.id)
  • Rows Removed by Filter: 1
82. 0.051 0.051 ↑ 3.0 1 51

Seq Scan on consent_item (cost=0.00..1.03 rows=3 width=45) (actual time=0.001..0.001 rows=1 loops=51)

83. 0.051 0.051 ↑ 1.0 2 51

Seq Scan on consent_type (cost=0.00..1.02 rows=2 width=42) (actual time=0.001..0.001 rows=2 loops=51)

84. 1.224 1.836 ↑ 1.0 1 612

Aggregate (cost=33.30..33.31 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=612)

85. 0.000 0.612 ↓ 0.0 0 612

Nested Loop Left Join (cost=12.05..33.29 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=612)

86. 0.612 0.612 ↓ 0.0 0 612

Nested Loop (cost=11.46..26.17 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=612)

87. 0.000 0.000 ↓ 0.0 0 612

Hash Join (cost=11.32..25.11 rows=3 width=36) (actual time=0.000..0.000 rows=0 loops=612)

  • Hash Cond: (comment_type_1.id = activity_type_comment_type.comment_type_id)
88. 0.000 0.000 ↓ 0.0 0 612

Seq Scan on comment_type comment_type_1 (cost=0.00..13.00 rows=300 width=16) (actual time=0.000..0.000 rows=0 loops=612)

89. 0.000 0.000 ↓ 0.0 0

Hash (cost=11.28..11.28 rows=3 width=20) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on activity_type_comment_type (cost=4.17..11.28 rows=3 width=20) (never executed)

  • Recheck Cond: (activity_type_id = at.id)
91. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pk_activity_type_comment_type (cost=0.00..4.17 rows=3 width=0) (never executed)

  • Index Cond: (activity_type_id = at.id)
92. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type (cost=0.15..0.31 rows=1 width=16) (never executed)

  • Index Cond: (id = comment_type_1.id)
  • Filter: (state = 'ACTIVE'::text)
93. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.59..7.11 rows=1 width=48) (never executed)

94. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.44..6.79 rows=1 width=192) (never executed)

95. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..6.48 rows=1 width=160) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type act_com_type (cost=0.15..6.17 rows=1 width=144) (never executed)

  • Index Cond: (id = comment_type.id)
  • Filter: (state <> 'DELETED'::text)
97. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_2 (cost=0.15..0.31 rows=1 width=16) (never executed)

  • Index Cond: (id = act_com_type.id)
  • Heap Fetches: 0
98. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_3 (cost=0.15..0.31 rows=1 width=48) (never executed)

  • Index Cond: (id = comment_type_2.id)
  • Heap Fetches: 0
99. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_4 (cost=0.15..0.31 rows=1 width=48) (never executed)

  • Index Cond: (id = comment_type_2.id)
  • Heap Fetches: 0
100. 0.000 0.000 ↑ 2.2 6 612

Materialize (cost=0.00..1.19 rows=13 width=16) (actual time=0.000..0.000 rows=6 loops=612)

101. 0.007 0.007 ↑ 1.1 12 1

Seq Scan on activity_type activity_type_1 (cost=0.00..1.13 rows=13 width=16) (actual time=0.003..0.007 rows=12 loops=1)

102.          

SubPlan (forNested Loop Left Join)

103. 0.171 0.459 ↑ 1.0 1 51

Hash Join (cost=1.21..2.46 rows=1 width=0) (actual time=0.009..0.009 rows=1 loops=51)

  • Hash Cond: (template.id = template_topic.template_id)
104. 0.084 0.084 ↑ 2.5 4 28

Seq Scan on template (cost=0.00..1.21 rows=10 width=16) (actual time=0.002..0.003 rows=4 loops=28)

  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 6
105. 0.051 0.204 ↓ 1.5 3 51

Hash (cost=1.19..1.19 rows=2 width=16) (actual time=0.004..0.004 rows=3 loops=51)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
106. 0.153 0.153 ↓ 1.5 3 51

Seq Scan on template_topic (cost=0.00..1.19 rows=2 width=16) (actual time=0.002..0.003 rows=3 loops=51)

  • Filter: (t.id = topic_id)
  • Rows Removed by Filter: 12
107. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.34..2.54 rows=9 width=16) (never executed)

  • Hash Cond: (template_topic_1.template_id = template_1.id)
108. 0.000 0.000 ↓ 0.0 0

Seq Scan on template_topic template_topic_1 (cost=0.00..1.15 rows=15 width=32) (never executed)

109. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.21..1.21 rows=10 width=16) (never executed)

110. 0.000 0.000 ↓ 0.0 0

Seq Scan on template template_1 (cost=0.00..1.21 rows=10 width=16) (never executed)

  • Filter: ((state)::text = 'ACTIVE'::text)
111. 1.512 289.704 ↑ 1.0 1 24

Aggregate (cost=14,774.24..14,774.25 rows=1 width=32) (actual time=12.071..12.071 rows=1 loops=24)

112. 0.051 288.192 ↑ 1.3 3 24

Nested Loop Left Join (cost=3,695.75..14,774.23 rows=4 width=64) (actual time=3.862..12.008 rows=3 loops=24)

113. 0.102 0.480 ↑ 1.3 3 24

Hash Join (cost=5.62..6.87 rows=4 width=48) (actual time=0.016..0.020 rows=3 loops=24)

  • Hash Cond: (key_message.id = key_message_1.id)
114. 0.066 0.066 ↑ 1.0 13 22

Seq Scan on key_message (cost=0.00..1.16 rows=13 width=48) (actual time=0.001..0.003 rows=13 loops=22)

  • Filter: (state <> 'DELETED'::text)
115. 0.048 0.312 ↑ 1.3 3 24

Hash (cost=5.57..5.57 rows=4 width=32) (actual time=0.013..0.013 rows=3 loops=24)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
116. 0.076 0.264 ↑ 1.3 3 24

Hash Join (cost=4.39..5.57 rows=4 width=32) (actual time=0.009..0.011 rows=3 loops=24)

  • Hash Cond: (key_message_1.id = media_key_message.key_message_id)
117. 0.044 0.044 ↑ 1.0 13 22

Seq Scan on key_message key_message_1 (cost=0.00..1.13 rows=13 width=16) (actual time=0.001..0.002 rows=13 loops=22)

118. 0.048 0.144 ↑ 1.3 3 24

Hash (cost=4.34..4.34 rows=4 width=16) (actual time=0.006..0.006 rows=3 loops=24)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
119. 0.096 0.096 ↑ 1.3 3 24

Index Only Scan using media_key_message_pkey on media_key_message (cost=0.27..4.34 rows=4 width=16) (actual time=0.003..0.004 rows=3 loops=24)

  • Index Cond: (media_id = vm.id)
  • Heap Fetches: 0
120. 0.414 287.661 ↑ 1.0 1 69

Nested Loop Left Join (cost=3,690.13..3,691.83 rows=1 width=48) (actual time=4.168..4.169 rows=1 loops=69)

121. 0.069 0.345 ↑ 1.0 1 69

Nested Loop (cost=0.27..1.94 rows=1 width=119) (actual time=0.004..0.005 rows=1 loops=69)

122. 0.207 0.207 ↑ 1.0 1 69

Index Scan using key_message_pkey on key_message key_message_2 (cost=0.14..1.08 rows=1 width=119) (actual time=0.002..0.003 rows=1 loops=69)

  • Index Cond: (key_message.id = id)
  • Filter: (state <> 'DELETED'::text)
123. 0.069 0.069 ↑ 1.0 1 69

Index Only Scan using key_message_pkey on key_message key_message_3 (cost=0.14..0.77 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=69)

  • Index Cond: (id = key_message_2.id)
  • Heap Fetches: 0
124. 1.518 286.902 ↑ 1.0 1 69

Aggregate (cost=3,689.86..3,689.87 rows=1 width=32) (actual time=4.158..4.158 rows=1 loops=69)

125. 0.552 285.384 ↑ 1.0 6 69

Nested Loop Left Join (cost=614.03..3,689.85 rows=6 width=51) (actual time=0.717..4.136 rows=6 loops=69)

126. 0.345 1.242 ↑ 1.0 6 69

Hash Join (cost=3.05..4.30 rows=6 width=35) (actual time=0.013..0.018 rows=6 loops=69)

  • Hash Cond: (topic_1.id = key_message_topic.topic_id)
127. 0.276 0.276 ↑ 1.0 16 69

Seq Scan on topic topic_1 (cost=0.00..1.20 rows=16 width=35) (actual time=0.001..0.004 rows=16 loops=69)

  • Filter: (state <> 'DELETED'::text)
128. 0.138 0.621 ↑ 1.0 6 69

Hash (cost=2.98..2.98 rows=6 width=16) (actual time=0.009..0.009 rows=6 loops=69)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
129. 0.483 0.483 ↑ 1.0 6 69

Seq Scan on key_message_topic (cost=0.00..2.98 rows=6 width=16) (actual time=0.004..0.007 rows=6 loops=69)

  • Filter: (key_message_id = key_message_2.id)
  • Rows Removed by Filter: 72
130. 1.242 283.590 ↑ 1.0 1 414

Nested Loop Left Join (cost=610.98..614.25 rows=1 width=48) (actual time=0.685..0.685 rows=1 loops=414)

131. 0.828 0.828 ↑ 1.0 1 414

Index Scan using topic_pkey on topic t_1 (cost=0.14..0.90 rows=1 width=47) (actual time=0.002..0.002 rows=1 loops=414)

  • Index Cond: (id = topic_1.id)
  • Filter: (state <> 'DELETED'::text)
132. 9.108 279.036 ↑ 1.0 1 414

Aggregate (cost=610.85..610.86 rows=1 width=32) (actual time=0.674..0.674 rows=1 loops=414)

133. 6.210 269.928 ↓ 1.7 12 414

Nested Loop (cost=83.06..610.83 rows=7 width=52) (actual time=0.055..0.652 rows=12 loops=414)

  • Join Filter: (activity_type_6.id = activity_type_7.id)
  • Rows Removed by Join Filter: 66
134. 3.726 263.718 ↓ 1.7 12 414

Nested Loop Left Join (cost=83.06..608.47 rows=7 width=84) (actual time=0.054..0.637 rows=12 loops=414)

135. 2.469 6.624 ↓ 1.7 12 414

Hash Join (cost=1.31..3.94 rows=7 width=52) (actual time=0.005..0.016 rows=12 loops=414)

  • Hash Cond: (topic_activity_type_1.activity_type_id = activity_type_6.id)
136. 4.140 4.140 ↓ 1.5 12 414

Seq Scan on topic_activity_type topic_activity_type_1 (cost=0.00..2.60 rows=8 width=16) (actual time=0.004..0.010 rows=12 loops=414)

  • Filter: (topic_id = t_1.id)
  • Rows Removed by Filter: 116
137. 0.008 0.015 ↓ 1.1 13 1

Hash (cost=1.16..1.16 rows=12 width=36) (actual time=0.015..0.015 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
138. 0.007 0.007 ↓ 1.1 13 1

Seq Scan on activity_type activity_type_6 (cost=0.00..1.16 rows=12 width=36) (actual time=0.004..0.007 rows=13 loops=1)

  • Filter: (state <> 'DELETED'::text)
139. 9.936 253.368 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=81.75..86.35 rows=1 width=48) (actual time=0.048..0.051 rows=1 loops=4,968)

140. 4.968 233.496 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=48.46..53.02 rows=1 width=269) (actual time=0.044..0.047 rows=1 loops=4,968)

141. 4.968 129.168 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=19.04..23.58 rows=1 width=237) (actual time=0.023..0.026 rows=1 loops=4,968)

142. 4.968 109.296 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=9.53..14.03 rows=1 width=205) (actual time=0.019..0.022 rows=1 loops=4,968)

143. 4.968 64.584 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=7.87..12.35 rows=1 width=173) (actual time=0.010..0.013 rows=1 loops=4,968)

  • Join Filter: (touch_point_group_2.id = touch_point_group_3.id)
  • Rows Removed by Join Filter: 4
144. 4.968 44.712 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=0.54..4.85 rows=1 width=157) (actual time=0.008..0.009 rows=1 loops=4,968)

  • Join Filter: (touch_point_group_2.id = at_1.touch_point_group_id)
  • Rows Removed by Join Filter: 2
145. 4.968 34.776 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=0.54..3.73 rows=1 width=157) (actual time=0.006..0.007 rows=1 loops=4,968)

146. 0.000 24.840 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=0.41..2.87 rows=1 width=141) (actual time=0.005..0.005 rows=1 loops=4,968)

147. 4.968 19.872 ↑ 1.0 1 4,968

Nested Loop (cost=0.27..2.01 rows=1 width=109) (actual time=0.003..0.004 rows=1 loops=4,968)

148. 9.936 9.936 ↑ 1.0 1 4,968

Index Scan using activity_type_pkey on activity_type at_1 (cost=0.14..1.15 rows=1 width=93) (actual time=0.001..0.002 rows=1 loops=4,968)

  • Index Cond: (id = activity_type_6.id)
149. 4.968 4.968 ↑ 1.0 1 4,968

Index Only Scan using activity_type_pkey on activity_type activity_type_8 (cost=0.14..0.77 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=4,968)

  • Index Cond: (id = at_1.id)
  • Heap Fetches: 4968
150. 4.968 4.968 ↑ 1.0 1 4,968

Index Only Scan using activity_type_pkey on activity_type activity_type_9 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=4,968)

  • Index Cond: (id = activity_type_8.id)
  • Heap Fetches: 4968
151. 4.968 4.968 ↑ 1.0 1 4,968

Index Only Scan using activity_type_pkey on activity_type activity_type_10 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=4,968)

  • Index Cond: (id = activity_type_8.id)
  • Heap Fetches: 4968
152. 4.968 4.968 ↑ 2.5 2 4,968

Seq Scan on touch_point_group touch_point_group_2 (cost=0.00..1.06 rows=5 width=16) (actual time=0.001..0.001 rows=2 loops=4,968)

  • Filter: (state <> 'DELETED'::text)
153. 14.904 14.904 ↑ 1.0 5 4,968

Group (cost=7.33..7.38 rows=5 width=52) (actual time=0.001..0.003 rows=5 loops=4,968)

  • Group Key: touch_point_group_3.id, (array_length(COALESCE(array_agg(activity_type_11.id), '{}'::uuid[]), 1))
154. 0.000 0.000 ↑ 1.0 5 4,968

Sort (cost=7.33..7.35 rows=5 width=34) (actual time=0.000..0.000 rows=5 loops=4,968)

  • Sort Key: touch_point_group_3.id, (array_length(COALESCE(array_agg(activity_type_11.id), '{}'::uuid[]), 1))
  • Sort Method: quicksort Memory: 25kB
155. 0.006 0.034 ↑ 1.0 5 1

Nested Loop Left Join (cost=1.21..7.27 rows=5 width=34) (actual time=0.016..0.034 rows=5 loops=1)

156. 0.003 0.003 ↑ 1.0 5 1

Seq Scan on touch_point_group touch_point_group_3 (cost=0.00..1.06 rows=5 width=30) (actual time=0.002..0.003 rows=5 loops=1)

  • Filter: (state <> 'DELETED'::text)
157. 0.010 0.025 ↑ 1.0 1 5

Aggregate (cost=1.21..1.22 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=5)

158. 0.015 0.015 ↑ 2.5 2 5

Seq Scan on activity_type activity_type_11 (cost=0.00..1.20 rows=5 width=16) (actual time=0.002..0.003 rows=2 loops=5)

  • Filter: ((touch_point_group_id = touch_point_group_3.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
159. 29.808 39.744 ↑ 1.0 1 4,968

Aggregate (cost=1.65..1.66 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=4,968)

160. 9.936 9.936 ↑ 1.0 1 4,968

Seq Scan on activity_type_rule activity_type_rule_1 (cost=0.00..1.15 rows=1 width=53) (actual time=0.001..0.002 rows=1 loops=4,968)

  • Filter: (activity_type_id = at_1.id)
  • Rows Removed by Filter: 12
161. 9.936 14.904 ↑ 1.0 1 4,968

Aggregate (cost=9.51..9.52 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=4,968)

162. 0.000 4.968 ↓ 0.0 0 4,968

Bitmap Heap Scan on activity_type_dispatch_type activity_type_dispatch_type_1 (cost=4.16..9.50 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=4,968)

  • Recheck Cond: (activity_type_id = at_1.id)
163. 4.968 4.968 ↓ 0.0 0 4,968

Bitmap Index Scan on pk_activity_type_dispatch_type (cost=0.00..4.16 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=4,968)

  • Index Cond: (activity_type_id = at_1.id)
164. 14.904 99.360 ↑ 1.0 1 4,968

Aggregate (cost=29.42..29.43 rows=1 width=32) (actual time=0.020..0.020 rows=1 loops=4,968)

165. 4.968 84.456 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=19.81..29.41 rows=1 width=94) (actual time=0.015..0.017 rows=1 loops=4,968)

166. 0.000 64.584 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=16.68..26.25 rows=1 width=62) (actual time=0.011..0.013 rows=1 loops=4,968)

167. 4.968 24.840 ↑ 1.0 1 4,968

Nested Loop (cost=0.27..9.49 rows=1 width=46) (actual time=0.004..0.005 rows=1 loops=4,968)

168. 9.936 9.936 ↑ 1.0 1 4,968

Seq Scan on activity_type_assignment activity_type_assignment_1 (cost=0.00..1.16 rows=1 width=33) (actual time=0.001..0.002 rows=1 loops=4,968)

  • Filter: (activity_type_id = at_1.id)
  • Rows Removed by Filter: 12
169. 9.936 9.936 ↑ 1.0 1 4,968

Index Scan using idx_organizational_unit_materialized_path_btree_idx on organizational_unit organizational_unit_1 (cost=0.27..8.29 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=4,968)

  • Index Cond: (id = activity_type_assignment_1.organizational_unit_id)
  • Filter: (state <> 'DELETED'::text)
170. 4.968 39.744 ↑ 1.0 1 4,968

Nested Loop Left Join (cost=16.41..16.75 rows=1 width=48) (actual time=0.007..0.008 rows=1 loops=4,968)

171. 4.968 29.808 ↑ 1.0 1 4,968

Nested Loop (cost=0.53..0.84 rows=1 width=164) (actual time=0.005..0.006 rows=1 loops=4,968)

172. 4.968 19.872 ↑ 1.0 1 4,968

Nested Loop (cost=0.40..0.64 rows=1 width=145) (actual time=0.003..0.004 rows=1 loops=4,968)

173. 9.936 9.936 ↑ 1.0 1 4,968

Index Scan using pk_organizational_unit on organizational_unit ou_1 (cost=0.27..0.46 rows=1 width=161) (actual time=0.002..0.002 rows=1 loops=4,968)

  • Index Cond: (id = organizational_unit_1.id)
  • Filter: (state <> 'DELETED'::text)
174. 4.968 4.968 ↑ 1.0 1 4,968

Index Scan using pk_organizational_hierarchy on organizational_hierarchy organizational_hierarchy_1 (cost=0.12..0.17 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=4,968)

  • Index Cond: (id = ou_1.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
175. 4.968 4.968 ↑ 1.0 1 4,968

Index Scan using pk_organizational_unit_type on organizational_unit_type organizational_unit_type_1 (cost=0.13..0.18 rows=1 width=35) (actual time=0.001..0.001 rows=1 loops=4,968)

  • Index Cond: (id = ou_1.organizational_unit_type_id)
  • Filter: (state = 'ACTIVE'::text)
176. 4.968 4.968 ↑ 1.0 1 4,968

Aggregate (cost=15.88..15.89 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=4,968)

177. 0.000 0.000 ↓ 0.0 0 4,968

Seq Scan on organizational_unit_tag organizational_unit_tag_1 (cost=0.00..15.88 rows=2 width=32) (actual time=0.000..0.000 rows=0 loops=4,968)

  • Filter: (organizational_unit_id = ou_1.id)
178. 4.968 14.904 ↑ 1.0 1 4,968

Aggregate (cost=3.13..3.14 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=4,968)

179. 4.554 9.936 ↓ 0.0 0 4,968

Nested Loop (cost=0.00..3.12 rows=1 width=71) (actual time=0.002..0.002 rows=0 loops=4,968)

  • Join Filter: (consent_item_1.consent_type_id = consent_type_1.id)
  • Rows Removed by Join Filter: 0
180. 0.000 4.968 ↓ 0.0 0 4,968

Nested Loop (cost=0.00..2.08 rows=1 width=45) (actual time=0.001..0.001 rows=0 loops=4,968)

  • Join Filter: (activity_type_assignment_consent_item_1.consent_item_id = consent_item_1.id)
181. 4.968 4.968 ↓ 0.0 0 4,968

Seq Scan on activity_type_assignment_consent_item activity_type_assignment_consent_item_1 (cost=0.00..1.01 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,968)

  • Filter: (activity_type_assignment_id = activity_type_assignment_1.id)
  • Rows Removed by Filter: 1
182. 0.414 0.414 ↑ 3.0 1 414

Seq Scan on consent_item consent_item_1 (cost=0.00..1.03 rows=3 width=45) (actual time=0.001..0.001 rows=1 loops=414)

183. 0.414 0.414 ↑ 1.0 2 414

Seq Scan on consent_type consent_type_1 (cost=0.00..1.02 rows=2 width=42) (actual time=0.001..0.001 rows=2 loops=414)

184. 4.968 9.936 ↑ 1.0 1 4,968

Aggregate (cost=33.30..33.31 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=4,968)

185. 0.000 4.968 ↓ 0.0 0 4,968

Nested Loop Left Join (cost=12.05..33.29 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=4,968)

186. 4.968 4.968 ↓ 0.0 0 4,968

Nested Loop (cost=11.46..26.17 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=4,968)

187. 0.000 0.000 ↓ 0.0 0 4,968

Hash Join (cost=11.32..25.11 rows=3 width=36) (actual time=0.000..0.000 rows=0 loops=4,968)

  • Hash Cond: (comment_type_6.id = activity_type_comment_type_1.comment_type_id)
188. 0.000 0.000 ↓ 0.0 0 4,968

Seq Scan on comment_type comment_type_6 (cost=0.00..13.00 rows=300 width=16) (actual time=0.000..0.000 rows=0 loops=4,968)

189. 0.000 0.000 ↓ 0.0 0

Hash (cost=11.28..11.28 rows=3 width=20) (never executed)

190. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on activity_type_comment_type activity_type_comment_type_1 (cost=4.17..11.28 rows=3 width=20) (never executed)

  • Recheck Cond: (activity_type_id = at_1.id)
191. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pk_activity_type_comment_type (cost=0.00..4.17 rows=3 width=0) (never executed)

  • Index Cond: (activity_type_id = at_1.id)
192. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type comment_type_5 (cost=0.15..0.31 rows=1 width=16) (never executed)

  • Index Cond: (id = comment_type_6.id)
  • Filter: (state = 'ACTIVE'::text)
193. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.59..7.11 rows=1 width=48) (never executed)

194. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.44..6.79 rows=1 width=192) (never executed)

195. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..6.48 rows=1 width=160) (never executed)

196. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type act_com_type_1 (cost=0.15..6.17 rows=1 width=144) (never executed)

  • Index Cond: (id = comment_type_5.id)
  • Filter: (state <> 'DELETED'::text)
197. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_7 (cost=0.15..0.31 rows=1 width=16) (never executed)

  • Index Cond: (id = act_com_type_1.id)
  • Heap Fetches: 0
198. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_8 (cost=0.15..0.31 rows=1 width=48) (never executed)

  • Index Cond: (id = comment_type_7.id)
  • Heap Fetches: 0
199. 0.000 0.000 ↓ 0.0 0

Index Only Scan using comment_type_pkey on comment_type comment_type_9 (cost=0.15..0.31 rows=1 width=48) (never executed)

  • Index Cond: (id = comment_type_7.id)
  • Heap Fetches: 0
200. 0.000 0.000 ↑ 2.2 6 4,968

Materialize (cost=0.00..1.19 rows=13 width=16) (actual time=0.000..0.000 rows=6 loops=4,968)

201. 0.005 0.005 ↑ 1.1 12 1

Seq Scan on activity_type activity_type_7 (cost=0.00..1.13 rows=13 width=16) (actual time=0.002..0.005 rows=12 loops=1)

202.          

SubPlan (forNested Loop Left Join)

203. 0.966 2.484 ↓ 0.0 0 414

Hash Join (cost=1.21..2.46 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=414)

  • Hash Cond: (template_2.id = template_topic_2.template_id)
204. 0.276 0.276 ↑ 2.5 4 138

Seq Scan on template template_2 (cost=0.00..1.21 rows=10 width=16) (actual time=0.001..0.002 rows=4 loops=138)

  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 6
205. 0.414 1.242 ↑ 1.0 2 414

Hash (cost=1.19..1.19 rows=2 width=16) (actual time=0.003..0.003 rows=2 loops=414)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
206. 0.828 0.828 ↑ 1.0 2 414

Seq Scan on template_topic template_topic_2 (cost=0.00..1.19 rows=2 width=16) (actual time=0.002..0.002 rows=2 loops=414)

  • Filter: (t_1.id = topic_id)
  • Rows Removed by Filter: 13
207. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.34..2.54 rows=9 width=16) (never executed)

  • Hash Cond: (template_topic_3.template_id = template_3.id)
208. 0.000 0.000 ↓ 0.0 0

Seq Scan on template_topic template_topic_3 (cost=0.00..1.15 rows=15 width=32) (never executed)

209. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.21..1.21 rows=10 width=16) (never executed)

210. 0.000 0.000 ↓ 0.0 0

Seq Scan on template template_3 (cost=0.00..1.21 rows=10 width=16) (never executed)

  • Filter: ((state)::text = 'ACTIVE'::text)
211. 0.168 5.328 ↑ 1.0 1 24

Aggregate (cost=266.61..266.62 rows=1 width=32) (actual time=0.222..0.222 rows=1 loops=24)

212. 0.120 5.160 ↑ 1.0 3 24

Nested Loop (cost=83.40..266.60 rows=3 width=52) (actual time=0.201..0.215 rows=3 loops=24)

  • Join Filter: (activity_type_12.id = activity_type_13.id)
  • Rows Removed by Join Filter: 39
213. 0.048 0.048 ↑ 1.0 13 24

Seq Scan on activity_type activity_type_13 (cost=0.00..1.13 rows=13 width=16) (actual time=0.001..0.002 rows=13 loops=24)

214. 0.192 4.992 ↑ 1.0 3 312

Materialize (cost=83.40..264.90 rows=3 width=84) (actual time=0.006..0.016 rows=3 loops=312)

215. 0.054 4.800 ↑ 1.0 3 24

Nested Loop Left Join (cost=83.40..264.88 rows=3 width=84) (actual time=0.077..0.200 rows=3 loops=24)

216. 0.120 0.456 ↑ 1.0 3 24

Merge Join (cost=1.65..5.80 rows=3 width=52) (actual time=0.014..0.019 rows=3 loops=24)

  • Merge Cond: (activity_type_12.id = media_activity_type.activity_type_id)
217. 0.144 0.240 ↑ 1.0 12 24

Sort (cost=1.38..1.41 rows=12 width=36) (actual time=0.009..0.010 rows=12 loops=24)

  • Sort Key: activity_type_12.id
  • Sort Method: quicksort Memory: 26kB
218. 0.096 0.096 ↓ 1.1 13 24

Seq Scan on activity_type activity_type_12 (cost=0.00..1.16 rows=12 width=36) (actual time=0.001..0.004 rows=13 loops=24)

  • Filter: (state <> 'DELETED'::text)
219. 0.096 0.096 ↑ 1.0 3 24

Index Only Scan using media_activity_type_pkey on media_activity_type (cost=0.27..4.33 rows=3 width=16) (actual time=0.003..0.004 rows=3 loops=24)

  • Index Cond: (media_id = vm.id)
  • Heap Fetches: 0
220. 0.156 4.290 ↑ 1.0 1 78

Nested Loop Left Join (cost=81.75..86.35 rows=1 width=48) (actual time=0.051..0.055 rows=1 loops=78)

221. 0.078 3.900 ↑ 1.0 1 78

Nested Loop Left Join (cost=48.46..53.02 rows=1 width=269) (actual time=0.046..0.050 rows=1 loops=78)

222. 0.078 2.184 ↑ 1.0 1 78

Nested Loop Left Join (cost=19.04..23.58 rows=1 width=237) (actual time=0.024..0.028 rows=1 loops=78)

223. 0.000 1.872 ↑ 1.0 1 78

Nested Loop Left Join (cost=9.53..14.03 rows=1 width=205) (actual time=0.020..0.024 rows=1 loops=78)

224. 0.156 1.092 ↑ 1.0 1 78

Nested Loop Left Join (cost=7.87..12.35 rows=1 width=173) (actual time=0.010..0.014 rows=1 loops=78)

  • Join Filter: (touch_point_group_4.id = touch_point_group_5.id)
  • Rows Removed by Join Filter: 4
225. 0.078 0.702 ↑ 1.0 1 78

Nested Loop Left Join (cost=0.54..4.85 rows=1 width=157) (actual time=0.009..0.009 rows=1 loops=78)

  • Join Filter: (touch_point_group_4.id = at_2.touch_point_group_id)
226. 0.078 0.546 ↑ 1.0 1 78

Nested Loop Left Join (cost=0.54..3.73 rows=1 width=157) (actual time=0.006..0.007 rows=1 loops=78)

227. 0.000 0.390 ↑ 1.0 1 78

Nested Loop Left Join (cost=0.41..2.87 rows=1 width=141) (actual time=0.005..0.005 rows=1 loops=78)

228. 0.078 0.312 ↑ 1.0 1 78

Nested Loop (cost=0.27..2.01 rows=1 width=109) (actual time=0.003..0.004 rows=1 loops=78)

229. 0.156 0.156 ↑ 1.0 1 78

Index Scan using activity_type_pkey on activity_type at_2 (cost=0.14..1.15 rows=1 width=93) (actual time=0.001..0.002 rows=1 loops=78)

  • Index Cond: (id = activity_type_12.id)
230. 0.078 0.078 ↑ 1.0 1 78

Index Only Scan using activity_type_pkey on activity_type activity_type_14 (cost=0.14..0.77 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=78)

  • Index Cond: (id = at_2.id)
  • Heap Fetches: 78
231. 0.078 0.078 ↑ 1.0 1 78

Index Only Scan using activity_type_pkey on activity_type activity_type_15 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=78)

  • Index Cond: (id = activity_type_14.id)
  • Heap Fetches: 78
232. 0.078 0.078 ↑ 1.0 1 78

Index Only Scan using activity_type_pkey on activity_type activity_type_16 (cost=0.14..0.77 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=78)

  • Index Cond: (id = activity_type_14.id)
  • Heap Fetches: 78
233. 0.078 0.078 ↑ 5.0 1 78

Seq Scan on touch_point_group touch_point_group_4 (cost=0.00..1.06 rows=5 width=16) (actual time=0.001..0.001 rows=1 loops=78)

  • Filter: (state <> 'DELETED'::text)
234. 0.156 0.234 ↑ 1.0 5 78

Group (cost=7.33..7.38 rows=5 width=52) (actual time=0.001..0.003 rows=5 loops=78)

  • Group Key: touch_point_group_5.id, (array_length(COALESCE(array_agg(activity_type_17.id), '{}'::uuid[]), 1))
235. 0.050 0.078 ↑ 1.0 5 78

Sort (cost=7.33..7.35 rows=5 width=34) (actual time=0.001..0.001 rows=5 loops=78)

  • Sort Key: touch_point_group_5.id, (array_length(COALESCE(array_agg(activity_type_17.id), '{}'::uuid[]), 1))
  • Sort Method: quicksort Memory: 25kB
236. 0.005 0.028 ↑ 1.0 5 1

Nested Loop Left Join (cost=1.21..7.27 rows=5 width=34) (actual time=0.013..0.028 rows=5 loops=1)

237. 0.003 0.003 ↑ 1.0 5 1

Seq Scan on touch_point_group touch_point_group_5 (cost=0.00..1.06 rows=5 width=30) (actual time=0.002..0.003 rows=5 loops=1)

  • Filter: (state <> 'DELETED'::text)
238. 0.005 0.020 ↑ 1.0 1 5

Aggregate (cost=1.21..1.22 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=5)

239. 0.015 0.015 ↑ 2.5 2 5

Seq Scan on activity_type activity_type_17 (cost=0.00..1.20 rows=5 width=16) (actual time=0.002..0.003 rows=2 loops=5)

  • Filter: ((touch_point_group_id = touch_point_group_5.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
240. 0.624 0.780 ↑ 1.0 1 78

Aggregate (cost=1.65..1.66 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=78)

241. 0.156 0.156 ↑ 1.0 1 78

Seq Scan on activity_type_rule activity_type_rule_2 (cost=0.00..1.15 rows=1 width=53) (actual time=0.001..0.002 rows=1 loops=78)

  • Filter: (activity_type_id = at_2.id)
  • Rows Removed by Filter: 12
242. 0.156 0.234 ↑ 1.0 1 78

Aggregate (cost=9.51..9.52 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=78)

243. 0.000 0.078 ↓ 0.0 0 78

Bitmap Heap Scan on activity_type_dispatch_type activity_type_dispatch_type_2 (cost=4.16..9.50 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=78)

  • Recheck Cond: (activity_type_id = at_2.id)
244. 0.078 0.078 ↓ 0.0 0 78

Bitmap Index Scan on pk_activity_type_dispatch_type (cost=0.00..4.16 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=78)

  • Index Cond: (activity_type_id = at_2.id)
245. 0.234 1.638 ↑ 1.0 1 78

Aggregate (cost=29.42..29.43 rows=1 width=32) (actual time=0.021..0.021 rows=1 loops=78)

246. 0.078 1.404 ↑ 1.0 1 78

Nested Loop Left Join (cost=19.81..29.41 rows=1 width=94) (actual time=0.016..0.018 rows=1 loops=78)

247. 0.078 1.092 ↑ 1.0 1 78

Nested Loop Left Join (cost=16.68..26.25 rows=1 width=62) (actual time=0.012..0.014 rows=1 loops=78)

248. 0.078 0.390 ↑ 1.0 1 78

Nested Loop (cost=0.27..9.49 rows=1 width=46) (actual time=0.004..0.005 rows=1 loops=78)

249. 0.156 0.156 ↑ 1.0 1 78

Seq Scan on activity_type_assignment activity_type_assignment_2 (cost=0.00..1.16 rows=1 width=33) (actual time=0.001..0.002 rows=1 loops=78)

  • Filter: (activity_type_id = at_2.id)
  • Rows Removed by Filter: 12
250. 0.156 0.156 ↑ 1.0 1 78

Index Scan using idx_organizational_unit_materialized_path_btree_idx on organizational_unit organizational_unit_2 (cost=0.27..8.29 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=78)

  • Index Cond: (id = activity_type_assignment_2.organizational_unit_id)
  • Filter: (state <> 'DELETED'::text)
251. 0.078 0.624 ↑ 1.0 1 78

Nested Loop Left Join (cost=16.41..16.75 rows=1 width=48) (actual time=0.007..0.008 rows=1 loops=78)

252. 0.078 0.468 ↑ 1.0 1 78

Nested Loop (cost=0.53..0.84 rows=1 width=164) (actual time=0.006..0.006 rows=1 loops=78)

253. 0.078 0.312 ↑ 1.0 1 78

Nested Loop (cost=0.40..0.64 rows=1 width=145) (actual time=0.004..0.004 rows=1 loops=78)

254. 0.156 0.156 ↑ 1.0 1 78

Index Scan using pk_organizational_unit on organizational_unit ou_2 (cost=0.27..0.46 rows=1 width=161) (actual time=0.002..0.002 rows=1 loops=78)

  • Index Cond: (id = organizational_unit_2.id)
  • Filter: (state <> 'DELETED'::text)
255. 0.078 0.078 ↑ 1.0 1 78

Index Scan using pk_organizational_hierarchy on organizational_hierarchy organizational_hierarchy_2 (cost=0.12..0.17 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=78)

  • Index Cond: (id = ou_2.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
256. 0.078 0.078 ↑ 1.0 1 78

Index Scan using pk_organizational_unit_type on organizational_unit_type organizational_unit_type_2 (cost=0.13..0.18 rows=1 width=35) (actual time=0.001..0.001 rows=1 loops=78)

  • Index Cond: (id = ou_2.organizational_unit_type_id)
  • Filter: (state = 'ACTIVE'::text)
257. 0.078 0.078 ↑ 1.0 1 78

Aggregate (cost=15.88..15.89 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=78)

258. 0.000 0.000 ↓ 0.0 0 78

Seq Scan on organizational_unit_tag organizational_unit_tag_2 (cost=0.00..15.88 rows=2 width=32) (actual time=0.000..0.000 rows=0 loops=78)

  • Filter: (organizational_unit_id = ou_2.id)
259. 0.156 0.234 ↑ 1.0 1 78

Aggregate (cost=3.13..3.14 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=78)

260. 0.000 0.078 ↓ 0.0 0 78

Nested Loop (cost=0.00..3.12 rows=1 width=71) (actual time=0.001..0.001 rows=0 loops=78)

  • Join Filter: (consent_item_2.consent_type_id = consent_type_2.id)
261. 0.000 0.078 ↓ 0.0 0 78

Nested Loop (cost=0.00..2.08 rows=1 width=45) (actual time=0.001..0.001 rows=0 loops=78)

  • Join Filter: (activity_type_assignment_consent_item_2.consent_item_id = consent_item_2.id)
262. 0.078 0.078 ↓ 0.0 0 78

Seq Scan on activity_type_assignment_consent_item activity_type_assignment_consent_item_2 (cost=0.00..1.01 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=78)

  • Filter: (activity_type_assignment_id = activity_type_assignment_2.id)
  • Rows Removed by Filter: 1
263. 0.000 0.000 ↓ 0.0 0

Seq Scan on consent_item consent_item_2 (cost=0.00..1.03 rows=3 width=45) (never executed)

264. 0.000 0.000 ↓ 0.0 0

Seq Scan on consent_type consent_type_2 (cost=0.00..1.02 rows=2 width=42) (never executed)

265. 0.156 0.234 ↑ 1.0 1 78

Aggregate (cost=33.30..33.31 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=78)

266. 0.000 0.078 ↓ 0.0 0 78

Nested Loop Left Join (cost=12.05..33.29 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=78)

267. 0.078 0.078 ↓ 0.0 0 78

Nested Loop (cost=11.46..26.17 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=78)

268. 0.000 0.000 ↓ 0.0 0 78

Hash Join (cost=11.32..25.11 rows=3 width=36) (actual time=0.000..0.000 rows=0 loops=78)

  • Hash Cond: (comment_type_11.id = activity_type_comment_type_2.comment_type_id)
269. 0.000 0.000 ↓ 0.0 0 78

Seq Scan on comment_type comment_type_11 (cost=0.00..13.00 rows=300 width=16) (actual time=0.000..0.000 rows=0 loops=78)

270. 0.000 0.000 ↓ 0.0 0

Hash (cost=11.28..11.28 rows=3 width=20) (never executed)

271. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on activity_type_comment_type activity_type_comment_type_2 (cost=4.17..11.28 rows=3 width=20) (never executed)

  • Recheck Cond: (activity_type_id = at_2.id)
272. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pk_activity_type_comment_type (cost=0.00..4.17 rows=3 width=0) (never executed)

  • Index Cond: (activity_type_id = at_2.id)
273. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type comment_type_10 (cost=0.15..0.31 rows=1 width=16) (never executed)

  • Index Cond: (id = comment_type_11.id)
  • Filter: (state = 'ACTIVE'::text)
274. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.59..7.11 rows=1 width=48) (never executed)

275. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.44..6.79 rows=1 width=192) (never executed)

276. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..6.48 rows=1 width=160) (never executed)

277. 0.000 0.000 ↓ 0.0 0

Index Scan using comment_type_pkey on comment_type act_com_type_2 (cost=0.15..6.17 rows=1 width=144) (never executed)

  • Index Cond: (id = comment_type_10.id)