explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QFCs

Settings
# exclusive inclusive rows x rows loops node
1. 2.375 480.732 ↑ 1.0 1 1

Result (cost=120,290.50..120,290.51 rows=1 width=32) (actual time=480.732..480.732 rows=1 loops=1)

2.          

CTE matches

3. 0.007 0.111 ↓ 3.4 24 1

Nested Loop (cost=6.12..17.80 rows=7 width=46) (actual time=0.076..0.111 rows=24 loops=1)

  • Join Filter: (media.id = media_1.id)
4. 0.013 0.080 ↓ 3.4 24 1

Hash Join (cost=5.97..14.52 rows=7 width=62) (actual time=0.070..0.080 rows=24 loops=1)

  • Hash Cond: (user_media_offline.media_id = media.id)
5. 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
6. 0.010 0.051 ↓ 2.0 46 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
7. 0.041 0.041 ↓ 2.0 46 1

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

  • Filter: ((state = 'ACTIVE'::text) AND (lifecycle_status = 'ACTIVE'::text))
  • Rows Removed by Filter: 48
8. 0.024 0.024 ↑ 1.0 1 24

Index Only Scan using media_pkey on media media_1 (cost=0.14..0.46 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: (id = user_media_offline.media_id)
  • Heap Fetches: 0
9.          

CTE view

10. 0.042 0.162 ↓ 3.4 24 1

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

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

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

12.          

Initplan (forResult)

13. 131.793 478.357 ↑ 1.0 1 1

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

14. 0.045 346.564 ↓ 3.4 24 1

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

15. 0.175 0.175 ↓ 3.4 24 1

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

16. 6.048 346.344 ↑ 1.0 1 24

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

17. 4.584 340.296 ↑ 1.0 1 24

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

18. 0.048 335.712 ↑ 1.0 1 24

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

19. 0.048 329.880 ↑ 1.0 1 24

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

20. 0.072 37.992 ↑ 1.0 1 24

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

21. 0.024 0.792 ↑ 1.0 1 24

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

22. 0.072 0.264 ↑ 1.0 1 24

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

23. 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)
24. 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))
25. 0.072 0.504 ↑ 1.0 1 24

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

26. 0.096 0.432 ↑ 2.0 1 24

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

  • Sort Key: media_version.version DESC
  • Sort Method: quicksort Memory: 25kB
27. 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
28. 0.288 37.128 ↑ 1.0 1 24

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

29. 0.114 36.840 ↑ 1.5 2 24

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

30. 0.096 0.312 ↑ 1.5 2 24

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

  • Hash Cond: (topic.id = media_topic.topic_id)
31. 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)
32. 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
33. 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
34. 0.255 36.414 ↑ 1.0 1 51

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

35. 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)
36. 1.224 35.649 ↑ 1.0 1 51

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

37. 0.765 34.425 ↓ 1.7 12 51

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

  • Join Filter: (activity_type.id = activity_type_1.id)
  • Rows Removed by Join Filter: 66
38. 0.357 33.660 ↓ 1.7 12 51

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

39. 0.346 0.867 ↓ 1.7 12 51

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

  • Hash Cond: (topic_activity_type.activity_type_id = activity_type.id)
40. 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
41. 0.004 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
42. 0.007 0.007 ↓ 1.1 13 1

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

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

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

44. 1.224 29.988 ↑ 1.0 1 612

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

45. 0.000 15.912 ↑ 1.0 1 612

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

46. 0.612 14.076 ↑ 1.0 1 612

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

47. 0.612 7.956 ↑ 1.0 1 612

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

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

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

  • Join Filter: (touch_point_group.id = at.touch_point_group_id)
  • Rows Removed by Join Filter: 2
49. 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)

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

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

52. 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)
53. 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
54. 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
55. 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
56. 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)
57. 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))
58. 0.584 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
59. 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)

60. 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)
61. 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)

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

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

64. 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
65. 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)

66. 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)
67. 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)
68. 1.836 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)

69. 0.000 11.016 ↑ 1.0 1 612

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

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

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

72. 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
73. 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)
74. 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)

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

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

77. 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)
78. 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)
79. 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)
80. 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)

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

83. 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
84. 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)
85. 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
86. 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)

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

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

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

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

91. 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)
92. 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)

93. 0.000 0.000 ↓ 0.0 0

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

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

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

98. 0.000 0.000 ↓ 0.0 0

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

99. 0.000 0.000 ↓ 0.0 0

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

100. 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)
101. 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
102. 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
103. 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
104. 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)

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

106.          

SubPlan (forNested Loop Left Join)

107. 0.148 0.408 ↑ 1.0 1 51

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

  • Hash Cond: (template.id = template_topic.template_id)
108. 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
109. 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
110. 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
111. 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)
112. 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)

113. 0.000 0.000 ↓ 0.0 0

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

114. 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)
115. 1.920 291.840 ↑ 1.0 1 24

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

116. 0.075 289.920 ↑ 1.3 3 24

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

117. 0.128 0.528 ↑ 1.3 3 24

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

  • Hash Cond: (key_message.id = key_message_1.id)
118. 0.088 0.088 ↑ 1.0 13 22

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

  • Filter: (state <> 'DELETED'::text)
119. 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
120. 0.100 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)
121. 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)

122. 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
123. 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
124. 0.483 289.317 ↑ 1.0 1 69

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

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

126. 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)
127. 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
128. 1.725 288.489 ↑ 1.0 1 69

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

129. 0.276 286.764 ↑ 1.0 6 69

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

130. 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)
131. 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)
132. 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
133. 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
134. 1.656 285.246 ↑ 1.0 1 414

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

135. 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)
136. 9.108 280.278 ↑ 1.0 1 414

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

137. 6.210 271.170 ↓ 1.7 12 414

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

  • Join Filter: (activity_type_6.id = activity_type_7.id)
  • Rows Removed by Join Filter: 66
138. 4.968 264.960 ↓ 1.7 12 414

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

139. 2.475 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)
140. 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
141. 0.005 0.009 ↓ 1.1 13 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
142. 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)
143. 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)

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

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

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

147. 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
148. 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.009..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
149. 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)

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

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

152. 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)
153. 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
154. 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
155. 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
156. 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)
157. 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))
158. 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
159. 0.002 0.034 ↑ 1.0 5 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

183. 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
184. 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)
185. 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
186. 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)

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

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

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

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

191. 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)
192. 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)

193. 0.000 0.000 ↓ 0.0 0

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

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

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

198. 0.000 0.000 ↓ 0.0 0

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

199. 0.000 0.000 ↓ 0.0 0

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

200. 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)
201. 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
202. 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
203. 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
204. 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)

205. 0.004 0.004 ↑ 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.004 rows=12 loops=1)

206.          

SubPlan (forNested Loop Left Join)

207. 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)
208. 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.002..0.002 rows=4 loops=138)

  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 6
209. 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
210. 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
211. 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)
212. 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)

213. 0.000 0.000 ↓ 0.0 0

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

214. 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)
215. 0.192 5.784 ↑ 1.0 1 24

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

216. 0.240 5.592 ↑ 1.0 3 24

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

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

218. 0.072 5.304 ↑ 1.0 3 312

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

219. 0.096 5.232 ↑ 1.0 3 24

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

220. 0.120 0.456 ↑ 1.0 3 24

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

  • Merge Cond: (activity_type_12.id = media_activity_type.activity_type_id)
221. 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
222. 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)
223. 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
224. 0.156 4.680 ↑ 1.0 1 78

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

225. 0.078 4.290 ↑ 1.0 1 78

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

226. 0.156 2.418 ↑ 1.0 1 78

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

227. 0.078 2.028 ↑ 1.0 1 78

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

228. 0.156 1.170 ↑ 1.0 1 78

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

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

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

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

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

231. 0.078 0.468 ↑ 1.0 1 78

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

232. 0.078 0.312 ↑ 1.0 1 78

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

233. 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)
234. 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
235. 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
236. 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
237. 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)
238. 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))
239. 0.051 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
240. 0.004 0.027 ↑ 1.0 5 1

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

241. 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)
242. 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)

243. 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
244. 0.624 0.780 ↑ 1.0 1 78

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

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

247. 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)
248. 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)
249. 0.312 1.794 ↑ 1.0 1 78

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

250. 0.078 1.482 ↑ 1.0 1 78

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

251. 0.078 1.170 ↑ 1.0 1 78

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

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

253. 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
254. 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)
255. 0.078 0.702 ↑ 1.0 1 78

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

256. 0.156 0.546 ↑ 1.0 1 78

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

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

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

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

264. 0.078 0.156 ↓ 0.0 0 78

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

  • Join Filter: (consent_item_2.consent_type_id = consent_type_2.id)
265. 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)
266. 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
267. 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)

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

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

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

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

272. 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)
273. 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)

274. 0.000 0.000 ↓ 0.0 0

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

275. 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)
276. 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)