explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PaqJ

Settings
# exclusive inclusive rows x rows loops node
1. 2.530 477.382 ↑ 1.0 1 1

Result (cost=120,287.21..120,287.22 rows=1 width=32) (actual time=477.382..477.382 rows=1 loops=1)

2.          

CTE matches

3. 0.011 0.083 ↓ 3.4 24 1

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

  • Hash Cond: (user_media_offline.media_id = media.id)
4. 0.016 0.016 ↑ 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.012..0.016 rows=27 loops=1)

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

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

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

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

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

CTE view

8. 0.036 0.126 ↓ 3.4 24 1

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

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

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

10.          

Initplan (forResult)

11. 133.362 474.852 ↑ 1.0 1 1

Aggregate (cost=120,272.43..120,272.44 rows=1 width=32) (actual time=474.851..474.852 rows=1 loops=1)

12. 0.021 341.490 ↓ 3.4 24 1

Nested Loop Left Join (cost=17,176.37..120,272.41 rows=7 width=80) (actual time=42.855..341.490 rows=24 loops=1)

13. 0.141 0.141 ↓ 3.4 24 1

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

14. 5.832 341.328 ↑ 1.0 1 24

Nested Loop Left Join (cost=17,176.37..17,181.74 rows=1 width=48) (actual time=14.219..14.222 rows=1 loops=24)

15. 4.392 335.496 ↑ 1.0 1 24

Nested Loop Left Join (cost=17,105.69..17,110.54 rows=1 width=342) (actual time=13.976..13.979 rows=1 loops=24)

16. 0.024 331.104 ↑ 1.0 1 24

Nested Loop Left Join (cost=16,895.48..16,900.29 rows=1 width=310) (actual time=13.793..13.796 rows=1 loops=24)

17. 0.024 325.776 ↑ 1.0 1 24

Nested Loop Left Join (cost=16,628.86..16,633.65 rows=1 width=278) (actual time=13.572..13.574 rows=1 loops=24)

18. 0.048 37.008 ↑ 1.0 1 24

Nested Loop Left Join (cost=1,854.62..1,859.38 rows=1 width=246) (actual time=1.540..1.542 rows=1 loops=24)

19. 0.024 0.720 ↑ 1.0 1 24

Nested Loop Left Join (cost=6.23..10.95 rows=1 width=214) (actual time=0.029..0.030 rows=1 loops=24)

20. 0.024 0.216 ↑ 1.0 1 24

Nested Loop Left Join (cost=0.42..5.12 rows=1 width=194) (actual time=0.008..0.009 rows=1 loops=24)

21. 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)
22. 0.096 0.096 ↑ 1.0 1 24

Index Scan using user_media_offline_pkey on user_media_offline user_media_offline_1 (cost=0.28..1.45 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=24)

  • Index Cond: ((user_id = '3b634574-260d-4d74-880d-075c1be5a8cf'::uuid) AND (media_id = vm.id))
23. 0.024 0.480 ↑ 1.0 1 24

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

24. 0.120 0.456 ↑ 2.0 1 24

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

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

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

  • Filter: (media_id = vm.id)
  • Rows Removed by Filter: 142
26. 0.288 36.240 ↑ 1.0 1 24

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

27. 0.093 35.952 ↑ 1.5 2 24

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

28. 0.120 0.312 ↑ 1.5 2 24

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

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

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

  • Filter: (state <> 'DELETED'::text)
30. 0.048 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
31. 0.072 0.072 ↑ 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.003 rows=2 loops=24)

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

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

33. 0.102 0.102 ↑ 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.002 rows=1 loops=51)

  • Index Cond: (id = topic.id)
  • Filter: (state <> 'DELETED'::text)
34. 1.173 34.884 ↑ 1.0 1 51

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

35. 0.816 33.711 ↓ 1.7 12 51

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

  • Join Filter: (activity_type.id = activity_type_1.id)
  • Rows Removed by Join Filter: 66
36. 0.204 32.895 ↓ 1.7 12 51

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

37. 0.346 0.867 ↓ 1.7 12 51

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

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

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

  • Filter: (topic_id = t.id)
  • Rows Removed by Filter: 116
39. 0.003 0.011 ↓ 1.1 13 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
40. 0.008 0.008 ↓ 1.1 13 1

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

  • Filter: (state <> 'DELETED'::text)
41. 0.612 31.824 ↑ 1.0 1 612

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

42. 0.612 29.376 ↑ 1.0 1 612

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

43. 0.612 15.912 ↑ 1.0 1 612

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

44. 0.000 13.464 ↑ 1.0 1 612

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

45. 0.612 7.956 ↑ 1.0 1 612

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

  • Join Filter: (touch_point_group.id = touch_point_group_1.id)
  • Rows Removed by Join Filter: 4
46. 0.612 5.508 ↑ 1.0 1 612

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

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

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

48. 0.000 3.060 ↑ 1.0 1 612

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

49. 0.612 2.448 ↑ 1.0 1 612

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

50. 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.001..0.002 rows=1 loops=612)

  • Index Cond: (id = activity_type.id)
51. 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
52. 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
53. 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
54. 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)
55. 1.836 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))
56. 0.000 0.000 ↑ 1.0 5 612

Sort (cost=7.33..7.35 rows=5 width=34) (actual time=0.000..0.000 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
57. 0.005 0.033 ↑ 1.0 5 1

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

58. 0.003 0.003 ↑ 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.002..0.003 rows=5 loops=1)

  • Filter: (state <> 'DELETED'::text)
59. 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)

60. 0.015 0.015 ↑ 2.5 2 5

Seq Scan on activity_type activity_type_5 (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_1.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
61. 4.284 5.508 ↑ 1.0 1 612

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

62. 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
63. 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)

64. 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)
65. 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)
66. 2.448 12.852 ↑ 1.0 1 612

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

67. 0.612 10.404 ↑ 1.0 1 612

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

68. 0.000 7.956 ↑ 1.0 1 612

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

69. 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)

70. 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
71. 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)
72. 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)

73. 0.612 3.672 ↑ 1.0 1 612

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

74. 0.612 2.448 ↑ 1.0 1 612

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

75. 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)
76. 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)
77. 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)
78. 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)

79. 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)
80. 0.612 1.836 ↑ 1.0 1 612

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

81. 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
82. 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)
83. 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
84. 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)

85. 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)

86. 1.224 1.836 ↑ 1.0 1 612

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

87. 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)

88. 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)

89. 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)
90. 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)

91. 0.000 0.000 ↓ 0.0 0

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

92. 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)
93. 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)
94. 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)
95. 0.000 0.000 ↓ 0.0 0

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

96. 0.000 0.000 ↓ 0.0 0

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

97. 0.000 0.000 ↓ 0.0 0

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

98. 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)
99. 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
100. 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
101. 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
102. 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)

103. 0.004 0.004 ↑ 1.1 12 1

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

104.          

SubPlan (forNested Loop Left Join)

105. 0.097 0.357 ↑ 1.0 1 51

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

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

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

  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 6
107. 0.102 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
108. 0.102 0.102 ↓ 1.5 3 51

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

  • Filter: (t.id = topic_id)
  • Rows Removed by Filter: 12
109. 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)
110. 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)

111. 0.000 0.000 ↓ 0.0 0

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

112. 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)
113. 1.440 288.744 ↑ 1.0 1 24

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

114. 0.084 287.304 ↑ 1.3 3 24

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

115. 0.102 0.456 ↑ 1.3 3 24

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

  • Hash Cond: (key_message.id = key_message_1.id)
116. 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)
117. 0.048 0.288 ↑ 1.3 3 24

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

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

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

  • Hash Cond: (key_message_1.id = media_key_message.key_message_id)
119. 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)

120. 0.024 0.120 ↑ 1.3 3 24

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
121. 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
122. 0.414 286.764 ↑ 1.0 1 69

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

123. 0.000 0.276 ↑ 1.0 1 69

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

124. 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)
125. 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
126. 1.449 286.074 ↑ 1.0 1 69

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

127. 0.207 284.625 ↑ 1.0 6 69

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

128. 0.414 1.242 ↑ 1.0 6 69

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

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

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

  • Filter: (state <> 'DELETED'::text)
130. 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
131. 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
132. 1.656 283.176 ↑ 1.0 1 414

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

133. 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)
134. 8.694 278.208 ↑ 1.0 1 414

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

135. 6.210 269.514 ↓ 1.7 12 414

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

  • Join Filter: (activity_type_6.id = activity_type_7.id)
  • Rows Removed by Join Filter: 66
136. 2.898 263.304 ↓ 1.7 12 414

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

137. 2.476 7.038 ↓ 1.7 12 414

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

  • Hash Cond: (topic_activity_type_1.activity_type_id = activity_type_6.id)
138. 4.554 4.554 ↓ 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.011 rows=12 loops=414)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
140. 0.004 0.004 ↓ 1.1 13 1

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

  • Filter: (state <> 'DELETED'::text)
141. 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)

142. 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)

143. 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)

144. 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)

145. 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
146. 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
147. 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)

148. 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)

149. 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)

150. 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)
151. 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
152. 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
153. 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
154. 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)
155. 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))
156. 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
157. 0.001 0.029 ↑ 1.0 5 1

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

158. 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)
159. 0.015 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)

160. 0.010 0.010 ↑ 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.002 rows=2 loops=5)

  • Filter: ((touch_point_group_id = touch_point_group_3.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
161. 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)

162. 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
163. 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)

164. 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)
165. 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)
166. 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)

167. 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)

168. 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.012..0.013 rows=1 loops=4,968)

169. 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)

170. 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
171. 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)
172. 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)

173. 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)

174. 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)

175. 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)
176. 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)
177. 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)
178. 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)

179. 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)
180. 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)

181. 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
182. 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)
183. 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
184. 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)

185. 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)

186. 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)

187. 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)

188. 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)

189. 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)
190. 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)

191. 0.000 0.000 ↓ 0.0 0

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

192. 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)
193. 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)
194. 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)
195. 0.000 0.000 ↓ 0.0 0

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

196. 0.000 0.000 ↓ 0.0 0

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

197. 0.000 0.000 ↓ 0.0 0

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

198. 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)
199. 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
200. 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
201. 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
202. 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)

203. 0.003 0.003 ↑ 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.003 rows=12 loops=1)

204.          

SubPlan (forNested Loop Left Join)

205. 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)
206. 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
207. 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
208. 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
209. 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)
210. 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)

211. 0.000 0.000 ↓ 0.0 0

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

212. 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)
213. 0.168 5.304 ↑ 1.0 1 24

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

214. 0.096 5.136 ↑ 1.0 3 24

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

  • Join Filter: (activity_type_12.id = activity_type_13.id)
  • Rows Removed by Join Filter: 39
215. 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)

216. 0.216 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)

217. 0.030 4.776 ↑ 1.0 3 24

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

218. 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)
219. 0.168 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
220. 0.072 0.072 ↓ 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.003 rows=13 loops=24)

  • Filter: (state <> 'DELETED'::text)
221. 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
222. 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)

223. 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)

224. 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)

225. 0.156 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)

226. 0.078 1.014 ↑ 1.0 1 78

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

  • Join Filter: (touch_point_group_4.id = touch_point_group_5.id)
  • Rows Removed by Join Filter: 4
227. 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)
228. 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)

229. 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)

230. 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)

231. 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)
232. 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
233. 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
234. 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
235. 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)
236. 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))
237. 0.053 0.078 ↑ 1.0 5 78

Sort (cost=7.33..7.35 rows=5 width=34) (actual time=0.000..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
238. 0.003 0.025 ↑ 1.0 5 1

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

239. 0.002 0.002 ↑ 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.001..0.002 rows=5 loops=1)

  • Filter: (state <> 'DELETED'::text)
240. 0.010 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)

241. 0.010 0.010 ↑ 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.002 rows=2 loops=5)

  • Filter: ((touch_point_group_id = touch_point_group_5.id) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 11
242. 0.546 0.702 ↑ 1.0 1 78

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

243. 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
244. 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)

245. 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)
246. 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)
247. 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)

248. 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)

249. 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)

250. 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)

251. 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
252. 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)
253. 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)

254. 0.078 0.468 ↑ 1.0 1 78

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

255. 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)

256. 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)
257. 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)
258. 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)
259. 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)

260. 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)
261. 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)

262. 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)
263. 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)
264. 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
265. 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)

266. 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)

267. 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)

268. 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)

269. 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)

270. 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)
271. 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)

272. 0.000 0.000 ↓ 0.0 0

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

273. 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)
274. 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)
275. 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)
276. 0.000 0.000 ↓ 0.0 0

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

277. 0.000 0.000 ↓ 0.0 0

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