explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wtq0

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 31.059 ↓ 1.5 3 1

Sort (cost=5,468.13..5,468.14 rows=2 width=464) (actual time=31.024..31.059 rows=3 loops=1)

  • Sort Key: get_person_uuids.last_response, (min(pn.device_delivered_date_min))
  • Sort Method: quicksort Memory: 31kB
2.          

CTE get_event

3. 0.036 0.115 ↑ 1.0 1 1

Append (cost=4.31..17.67 rows=1 width=758) (actual time=0.061..0.115 rows=1 loops=1)

4. 0.051 0.079 ↑ 1.0 1 1

Bitmap Heap Scan on events_org_part_1 e (cost=4.31..17.66 rows=1 width=758) (actual time=0.044..0.079 rows=1 loops=1)

  • Recheck Cond: (event_uuid = '4ab89cc0-f0b0-44ad-b371-5457fd772eab'::uuid)
  • Filter: ((valid_range @> '2020-09-04 10:12:18-07'::timestamp with time zone) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Heap Blocks: exact=1
5. 0.028 0.028 ↑ 4.0 1 1

Bitmap Index Scan on events_org_part_1_event_uuid_idx (cost=0.00..4.31 rows=4 width=0) (actual time=0.019..0.028 rows=1 loops=1)

  • Index Cond: (event_uuid = '4ab89cc0-f0b0-44ad-b371-5457fd772eab'::uuid)
6.          

CTE get_response_choices

7. 0.238 1.054 ↑ 2,222.2 9 1

Append (cost=0.14..1,013.25 rows=20,000 width=128) (actual time=0.302..1.054 rows=9 loops=1)

8. 0.019 0.061 ↓ 0.0 0 1

Nested Loop (cost=0.14..360.71 rows=10,000 width=128) (actual time=0.053..0.061 rows=0 loops=1)

9. 0.022 0.042 ↓ 0.0 0 1

Nested Loop (cost=0.14..8.19 rows=1 width=1,318) (actual time=0.033..0.042 rows=0 loops=1)

10. 0.020 0.020 ↓ 0.0 0 1

CTE Scan on get_event e_1 (cost=0.00..0.02 rows=1 width=24) (actual time=0.011..0.020 rows=0 loops=1)

  • Filter: (choices IS NULL)
  • Rows Removed by Filter: 1
11. 0.000 0.000 ↓ 0.0 0

Index Scan using forms_valid_range_gist on forms f (cost=0.14..8.16 rows=1 width=1,354) (never executed)

  • Index Cond: (valid_range @> e_1.created)
  • Filter: ((organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (e_1.form_uuid = form_uuid))
12. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..52.52 rows=10,000 width=64) (never executed)

13. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..0.52 rows=100 width=32) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=0) (never executed)

15. 0.286 0.755 ↑ 1,111.1 9 1

Nested Loop (cost=0.00..352.54 rows=10,000 width=128) (actual time=0.210..0.755 rows=9 loops=1)

16. 0.029 0.029 ↑ 1.0 1 1

CTE Scan on get_event e_2 (cost=0.00..0.02 rows=1 width=32) (actual time=0.012..0.029 rows=1 loops=1)

  • Filter: (choices IS NOT NULL)
17. 0.319 0.440 ↑ 1,111.1 9 1

ProjectSet (cost=0.00..52.52 rows=10,000 width=64) (actual time=0.146..0.440 rows=9 loops=1)

18. 0.094 0.121 ↑ 33.3 3 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.065..0.121 rows=3 loops=1)

19. 0.027 0.027 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.010..0.027 rows=1 loops=1)

20.          

CTE get_filtered_response_choices

21. 0.081 0.081 ↑ 2,222.2 9 1

CTE Scan on get_response_choices rc (cost=0.00..400.00 rows=20,000 width=128) (actual time=0.008..0.081 rows=9 loops=1)

22.          

CTE get_person_device_notifications

23. 0.102 10.331 ↓ 3.0 6 1

Unique (cost=1,225.99..1,226.10 rows=2 width=344) (actual time=10.194..10.331 rows=6 loops=1)

24. 0.119 10.229 ↓ 3.0 6 1

Sort (cost=1,225.99..1,226.00 rows=2 width=344) (actual time=10.179..10.229 rows=6 loops=1)

  • Sort Key: person_ntfn.recipient_uuid, person_ntfn.notification_uuid, person_ntfn.event_uuid, person_ntfn.parent_ntfn_uuid, (CASE WHEN (person_ntfn.delinked_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN person_ntfn.delinked_date ELSE NULL::timestamp with time zone END), device_ntfn.recipient_uuid, device_ntfn.notification_uuid, (CASE WHEN (device_ntfn.failed_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN device_ntfn.failed_date ELSE NULL::timestamp with time zone END), (CASE WHEN (device_ntfn.delivered_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN device_ntfn.delivered_date ELSE NULL::timestamp with time zone END), (CASE WHEN (((device_response.response)::text <> 'XMATTERS_REMOVE'::text) AND (device_response.received <= '2020-09-04 10:12:18-07'::timestamp with time zone)) THEN device_response.received ELSE NULL::timestamp with time zone END), (CASE WHEN ((device_response.received <= '2020-09-04 10:12:18-07'::timestamp with time zone) AND ((device_response.response)::text <> 'XMATTERS_REMOVE'::text)) THEN 'RESPONDED'::text WHEN (device_ntfn.delivered_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN 'DELIVERED'::text WHEN (device_ntfn.failed_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN 'FAILED'::text WHEN (live_ntfn.pending_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN 'PENDING'::text ELSE ''::text END), (CASE WHEN (live_ntfn.pending_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN live_ntfn.pending_date ELSE NULL::timestamp with time zone END), device_response.response_uuid, ((SubPlan 4)), (CASE WHEN (device_response.received <= '2020-09-04 10:12:18-07'::timestamp with time zone) THEN device_response.received ELSE NULL::timestamp with time zone END), device_response.recipient_type, (NULL::uuid), (NULL::character varying), (NULL::timestamp with time zone), (NULL::character varying)
  • Sort Method: quicksort Memory: 26kB
25. 0.102 10.110 ↓ 3.0 6 1

Append (cost=20.42..1,225.98 rows=2 width=344) (actual time=4.832..10.110 rows=6 loops=1)

26. 0.000 5.595 ↓ 5.0 5 1

Nested Loop (cost=20.42..733.43 rows=1 width=318) (actual time=4.815..5.595 rows=5 loops=1)

27.          

Initplan (forNested Loop)

28. 0.050 0.080 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.058..0.080 rows=1 loops=1)

29. 0.030 0.030 ↑ 1.0 1 1

CTE Scan on get_event e_3 (cost=0.00..0.02 rows=1 width=8) (actual time=0.011..0.030 rows=1 loops=1)

30. 0.038 0.063 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.044..0.063 rows=1 loops=1)

31. 0.025 0.025 ↑ 1.0 1 1

CTE Scan on get_event e_4 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.025 rows=1 loops=1)

32. 0.051 0.082 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.063..0.082 rows=1 loops=1)

33. 0.031 0.031 ↑ 1.0 1 1

CTE Scan on get_event e_5 (cost=0.00..0.02 rows=1 width=8) (actual time=0.012..0.031 rows=1 loops=1)

34. 0.043 0.074 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.056..0.074 rows=1 loops=1)

35. 0.031 0.031 ↑ 1.0 1 1

CTE Scan on get_event e_6 (cost=0.00..0.02 rows=1 width=8) (actual time=0.012..0.031 rows=1 loops=1)

36. 0.039 0.065 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.048..0.065 rows=1 loops=1)

37. 0.026 0.026 ↑ 1.0 1 1

CTE Scan on get_event e_7 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.026 rows=1 loops=1)

38. 0.033 0.059 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.042..0.059 rows=1 loops=1)

39. 0.026 0.026 ↑ 1.0 1 1

CTE Scan on get_event e_8 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.026 rows=1 loops=1)

40. 0.843 3.392 ↓ 5.0 5 1

Hash Right Join (cost=19.95..23.11 rows=1 width=111) (actual time=3.211..3.392 rows=5 loops=1)

  • Hash Cond: (device_response.notification_uuid = device_ntfn.notification_uuid)
41. 0.916 0.916 ↓ 1.1 66 1

Seq Scan on responses device_response (cost=0.00..2.93 rows=59 width=55) (actual time=0.038..0.916 rows=66 loops=1)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-09-04 10:12:18-07'::timestamp with time zone) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 2
42. 0.102 1.633 ↓ 5.0 5 1

Hash (cost=19.93..19.93 rows=1 width=72) (actual time=1.624..1.633 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
43. 0.220 1.531 ↓ 5.0 5 1

Nested Loop (cost=4.53..19.93 rows=1 width=72) (actual time=0.685..1.531 rows=5 loops=1)

44. 0.127 0.721 ↓ 5.0 5 1

Nested Loop (cost=4.26..11.62 rows=1 width=24) (actual time=0.424..0.721 rows=5 loops=1)

45. 0.040 0.191 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=0.171..0.191 rows=1 loops=1)

  • Group Key: get_event.event_uuid
46. 0.151 0.151 ↑ 1.0 1 1

CTE Scan on get_event (cost=0.00..0.02 rows=1 width=16) (actual time=0.080..0.151 rows=1 loops=1)

47. 0.118 0.403 ↓ 5.0 5 1

Append (cost=4.24..11.57 rows=1 width=40) (actual time=0.226..0.403 rows=5 loops=1)

48. 0.258 0.285 ↓ 5.0 5 1

Bitmap Heap Scan on notifications_summary_org_part_default live_ntfn (cost=4.24..11.57 rows=1 width=40) (actual time=0.206..0.285 rows=5 loops=1)

  • Recheck Cond: (event_uuid = get_event.event_uuid)
  • Filter: ((created_date >= $13) AND (pending_date <= '2020-09-04 10:12:18-07'::timestamp with time zone) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (category = 'LIVE'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $12)))
  • Rows Removed by Filter: 22
  • Heap Blocks: exact=1
49. 0.027 0.027 ↓ 2.2 27 1

Bitmap Index Scan on notifications_summary_org_part_default_event_uuid_idx (cost=0.00..4.24 rows=12 width=0) (actual time=0.017..0.027 rows=27 loops=1)

  • Index Cond: (event_uuid = get_event.event_uuid)
50. 0.215 0.590 ↑ 1.0 1 5

Append (cost=0.27..8.31 rows=1 width=64) (actual time=0.085..0.118 rows=1 loops=5)

51. 0.375 0.375 ↑ 1.0 1 5

Index Scan using notifications_summary_org_part_default_pkey on notifications_summary_org_part_default device_ntfn (cost=0.27..8.30 rows=1 width=64) (actual time=0.062..0.075 rows=1 loops=5)

  • Index Cond: ((organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (notification_uuid = live_ntfn.parent_ntfn_uuid))
  • Filter: ((created_date >= $9) AND (category = 'DEVICE'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $8)))
52. 0.160 0.490 ↑ 1.0 1 5

Append (cost=0.27..8.31 rows=1 width=72) (actual time=0.073..0.098 rows=1 loops=5)

53. 0.330 0.330 ↑ 1.0 1 5

Index Scan using notifications_summary_org_part_default_pkey on notifications_summary_org_part_default person_ntfn (cost=0.27..8.30 rows=1 width=72) (actual time=0.056..0.066 rows=1 loops=5)

  • Index Cond: ((organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (notification_uuid = device_ntfn.parent_ntfn_uuid))
  • Filter: ((created_date >= $11) AND (category = 'PERSON'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $10)))
54.          

SubPlan (forNested Loop)

55. 0.095 1.485 ↓ 0.0 0 5

HashAggregate (cost=700.50..701.77 rows=127 width=32) (actual time=0.294..0.297 rows=0 loops=5)

  • Group Key: get_response_choices.text_response
56. 1.390 1.390 ↑ 200.0 1 5

CTE Scan on get_response_choices (cost=0.00..700.00 rows=200 width=32) (actual time=0.265..0.278 rows=1 loops=5)

  • Filter: ((lower((device_response.response)::text) = lower(text_response)) OR (lower((device_response.response)::text) = lower(translated_response)))
  • Rows Removed by Filter: 8
57. 0.000 4.413 ↑ 1.0 1 1

Hash Join (cost=464.93..492.53 rows=1 width=295) (actual time=4.383..4.413 rows=1 loops=1)

  • Hash Cond: (COALESCE(rc_1.translated_response, rc_1.text_response) = (pr.response)::text)
58.          

Initplan (forHash Join)

59. 0.032 0.056 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.040..0.056 rows=1 loops=1)

60. 0.024 0.024 ↑ 1.0 1 1

CTE Scan on get_event e_9 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.024 rows=1 loops=1)

61. 0.031 0.055 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.039..0.055 rows=1 loops=1)

62. 0.024 0.024 ↑ 1.0 1 1

CTE Scan on get_event e_10 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.024 rows=1 loops=1)

63. 0.120 0.359 ↑ 666.7 3 1

HashAggregate (cost=450.00..470.00 rows=2,000 width=64) (actual time=0.319..0.359 rows=3 loops=1)

  • Group Key: COALESCE(rc_1.translated_response, rc_1.text_response)
64. 0.239 0.239 ↑ 2,222.2 9 1

CTE Scan on get_filtered_response_choices rc_1 (cost=0.00..400.00 rows=20,000 width=64) (actual time=0.025..0.239 rows=9 loops=1)

65. 0.036 3.996 ↓ 2.0 2 1

Hash (cost=14.85..14.85 rows=1 width=111) (actual time=3.987..3.996 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
66. 1.511 3.960 ↓ 2.0 2 1

Nested Loop (cost=4.26..14.85 rows=1 width=111) (actual time=0.513..3.960 rows=2 loops=1)

  • Join Filter: (person_resp_ntfn.notification_uuid = pr.notification_uuid)
  • Rows Removed by Join Filter: 168
67. 0.168 0.649 ↓ 10.0 10 1

Nested Loop (cost=4.26..11.59 rows=1 width=72) (actual time=0.242..0.649 rows=10 loops=1)

68. 0.032 0.056 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=0.040..0.056 rows=1 loops=1)

  • Group Key: get_event_1.event_uuid
69. 0.024 0.024 ↑ 1.0 1 1

CTE Scan on get_event get_event_1 (cost=0.00..0.02 rows=1 width=16) (actual time=0.008..0.024 rows=1 loops=1)

70. 0.167 0.425 ↓ 10.0 10 1

Append (cost=4.24..11.54 rows=1 width=72) (actual time=0.179..0.425 rows=10 loops=1)

71. 0.237 0.258 ↓ 10.0 10 1

Bitmap Heap Scan on notifications_summary_org_part_default person_resp_ntfn (cost=4.24..11.54 rows=1 width=72) (actual time=0.159..0.258 rows=10 loops=1)

  • Recheck Cond: (event_uuid = get_event_1.event_uuid)
  • Filter: ((created_date >= $15) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (category = 'PERSON'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $14)))
  • Rows Removed by Filter: 17
  • Heap Blocks: exact=1
72. 0.021 0.021 ↓ 2.2 27 1

Bitmap Index Scan on notifications_summary_org_part_default_event_uuid_idx (cost=0.00..4.24 rows=12 width=0) (actual time=0.012..0.021 rows=27 loops=1)

  • Index Cond: (event_uuid = get_event_1.event_uuid)
73. 1.800 1.800 ↓ 1.2 17 10

Seq Scan on responses pr (cost=0.00..3.08 rows=14 width=55) (actual time=0.011..0.180 rows=17 loops=10)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-09-04 10:12:18-07'::timestamp with time zone) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND ((recipient_type)::text = 'PERSON'::text))
  • Rows Removed by Filter: 51
74.          

CTE get_teams

75. 0.069 2.352 ↓ 3.0 3 1

GroupAggregate (cost=13.56..13.58 rows=1 width=56) (actual time=2.294..2.352 rows=3 loops=1)

  • Group Key: team_ntfns.team_ntfn_uuid, team_ntfns.team_parent_ntfn_uuid
76. 0.072 2.283 ↓ 3.0 3 1

Sort (cost=13.56..13.56 rows=1 width=56) (actual time=2.254..2.283 rows=3 loops=1)

  • Sort Key: team_ntfns.team_ntfn_uuid, team_ntfns.team_parent_ntfn_uuid
  • Sort Method: quicksort Memory: 25kB
77. 0.064 2.211 ↓ 3.0 3 1

Subquery Scan on team_ntfns (cost=13.50..13.55 rows=1 width=56) (actual time=2.111..2.211 rows=3 loops=1)

78. 0.069 2.147 ↓ 3.0 3 1

GroupAggregate (cost=13.50..13.54 rows=1 width=72) (actual time=2.089..2.147 rows=3 loops=1)

  • Group Key: en.person_ntfn_uuid, en.team_ntfn_uuid, en.team_parent_ntfn_uuid
79. 0.073 2.078 ↓ 3.0 3 1

Sort (cost=13.50..13.51 rows=1 width=80) (actual time=2.048..2.078 rows=3 loops=1)

  • Sort Key: en.person_ntfn_uuid, en.team_ntfn_uuid, en.team_parent_ntfn_uuid
  • Sort Method: quicksort Memory: 25kB
80. 0.064 2.005 ↓ 3.0 3 1

Subquery Scan on en (cost=13.45..13.49 rows=1 width=80) (actual time=1.877..2.005 rows=3 loops=1)

81. 0.000 1.941 ↓ 3.0 3 1

GroupAggregate (cost=13.45..13.48 rows=1 width=128) (actual time=1.854..1.941 rows=3 loops=1)

  • Group Key: n.person_uuid, n.person_ntfn_uuid, team_ntfn.notification_uuid, team_ntfn.parent_ntfn_uuid
82.          

Initplan (forGroupAggregate)

83. 0.038 0.063 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.046..0.063 rows=1 loops=1)

84. 0.025 0.025 ↑ 1.0 1 1

CTE Scan on get_event e_11 (cost=0.00..0.02 rows=1 width=8) (actual time=0.009..0.025 rows=1 loops=1)

85. 0.037 0.070 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.053..0.070 rows=1 loops=1)

86. 0.033 0.033 ↑ 1.0 1 1

CTE Scan on get_event e_12 (cost=0.00..0.02 rows=1 width=8) (actual time=0.016..0.033 rows=1 loops=1)

87. 0.125 1.833 ↓ 5.0 5 1

Sort (cost=13.38..13.39 rows=1 width=96) (actual time=1.790..1.833 rows=5 loops=1)

  • Sort Key: n.person_uuid, n.person_ntfn_uuid, team_ntfn.notification_uuid, team_ntfn.parent_ntfn_uuid
  • Sort Method: quicksort Memory: 25kB
88. 0.636 1.708 ↓ 5.0 5 1

Nested Loop (cost=0.00..13.37 rows=1 width=96) (actual time=0.570..1.708 rows=5 loops=1)

  • Join Filter: (n.team_uuid = team_ntfn.notification_uuid)
  • Rows Removed by Join Filter: 49
89. 0.156 0.505 ↓ 9.0 9 1

Append (cost=0.00..13.31 rows=1 width=32) (actual time=0.261..0.505 rows=9 loops=1)

90. 0.349 0.349 ↓ 9.0 9 1

Seq Scan on notifications_summary_org_part_default team_ntfn (cost=0.00..13.30 rows=1 width=32) (actual time=0.243..0.349 rows=9 loops=1)

  • Filter: ((created_date >= $22) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (category = 'TEAM'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $21)))
  • Rows Removed by Filter: 260
91. 0.567 0.567 ↓ 3.0 6 9

CTE Scan on get_person_device_notifications n (cost=0.00..0.04 rows=2 width=80) (actual time=0.008..0.063 rows=6 loops=9)

92.          

CTE get_team_groups

93. 0.116 5.593 ↑ 1.8 6 1

Recursive Union (cost=0.36..145.64 rows=11 width=74) (actual time=2.664..5.593 rows=6 loops=1)

94. 0.000 2.859 ↓ 3.0 3 1

Nested Loop (cost=0.36..8.42 rows=1 width=74) (actual time=2.641..2.859 rows=3 loops=1)

95.          

Initplan (forNested Loop)

96. 0.030 0.053 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.038..0.053 rows=1 loops=1)

97. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event e_13 (cost=0.00..0.02 rows=1 width=8) (actual time=0.007..0.023 rows=1 loops=1)

98. 0.029 0.053 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.037..0.053 rows=1 loops=1)

99. 0.024 0.024 ↑ 1.0 1 1

CTE Scan on get_event e_14 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.024 rows=1 loops=1)

100. 0.069 2.488 ↓ 3.0 3 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=2.458..2.488 rows=3 loops=1)

  • Group Key: get_teams.team_ntfn_uuid
101. 2.419 2.419 ↓ 3.0 3 1

CTE Scan on get_teams (cost=0.00..0.02 rows=1 width=16) (actual time=2.319..2.419 rows=3 loops=1)

102. 0.084 0.273 ↑ 1.0 1 3

Append (cost=0.27..8.31 rows=1 width=54) (actual time=0.067..0.091 rows=1 loops=3)

103. 0.189 0.189 ↑ 1.0 1 3

Index Scan using notifications_summary_org_part_default_pkey on notifications_summary_org_part_default team_ntfn_1 (cost=0.27..8.30 rows=1 width=54) (actual time=0.053..0.063 rows=1 loops=3)

  • Index Cond: ((organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (notification_uuid = get_teams.team_ntfn_uuid))
  • Filter: ((created_date >= $26) AND (category = 'TEAM'::text) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $25)))
104. 0.901 2.618 ↓ 2.0 2 2

Nested Loop (cost=0.07..13.70 rows=1 width=74) (actual time=0.797..1.309 rows=2 loops=2)

  • Join Filter: (n_1.notification_uuid = tg_1.parent_ntfn_uuid)
  • Rows Removed by Join Filter: 40
105.          

Initplan (forNested Loop)

106. 0.030 0.053 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.038..0.053 rows=1 loops=1)

107. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event e_15 (cost=0.00..0.02 rows=1 width=8) (actual time=0.007..0.023 rows=1 loops=1)

108. 0.029 0.052 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.037..0.052 rows=1 loops=1)

109. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event e_16 (cost=0.00..0.02 rows=1 width=8) (actual time=0.007..0.023 rows=1 loops=1)

110. 0.404 0.828 ↓ 14.0 14 2

Append (cost=0.00..13.31 rows=1 width=54) (actual time=0.105..0.414 rows=14 loops=2)

111. 0.424 0.424 ↓ 14.0 14 2

Seq Scan on notifications_summary_org_part_default n_1 (cost=0.00..13.30 rows=1 width=54) (actual time=0.091..0.212 rows=14 loops=2)

  • Filter: ((created_date >= $28) AND (category = ANY ('{TEAM,GROUP}'::text[])) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (created_date <= LEAST('2020-09-04 10:12:18-07'::timestamp with time zone, $27)))
  • Rows Removed by Filter: 255
112. 0.784 0.784 ↑ 3.3 3 28

WorkTable Scan on get_team_groups tg_1 (cost=0.00..0.20 rows=10 width=36) (actual time=0.007..0.028 rows=3 loops=28)

113.          

CTE get_targeted_groups

114. 0.210 6.780 ↓ 2.0 2 1

Nested Loop Left Join (cost=0.37..2.94 rows=1 width=129) (actual time=6.325..6.780 rows=2 loops=1)

  • Join Filter: (g.group_uuid = team_group.recipient_uuid)
  • Rows Removed by Join Filter: 26
115.          

Initplan (forNested Loop Left Join)

116. 0.016 0.052 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.038..0.052 rows=1 loops=1)

117. 0.036 0.036 ↑ 1.0 1 1

CTE Scan on get_event e_17 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.036 rows=1 loops=1)

118. 0.067 6.202 ↓ 2.0 2 1

HashAggregate (cost=0.34..0.35 rows=1 width=88) (actual time=6.179..6.202 rows=2 loops=1)

  • Group Key: team_group.notification_uuid, team_group.recipient_uuid
119. 0.142 6.135 ↓ 3.0 3 1

Nested Loop (cost=0.26..0.33 rows=1 width=72) (actual time=5.839..6.135 rows=3 loops=1)

  • Join Filter: (team_group.root_uuid = team.team_ntfn_uuid)
  • Rows Removed by Join Filter: 6
120. 0.063 5.900 ↓ 3.0 3 1

Subquery Scan on team_group (cost=0.26..0.29 rows=1 width=48) (actual time=5.800..5.900 rows=3 loops=1)

  • Filter: (team_group."row" = 1)
121. 0.073 5.837 ↓ 3.0 3 1

WindowAgg (cost=0.26..0.28 rows=1 width=60) (actual time=5.777..5.837 rows=3 loops=1)

122. 0.081 5.764 ↓ 3.0 3 1

Sort (cost=0.26..0.26 rows=1 width=52) (actual time=5.734..5.764 rows=3 loops=1)

  • Sort Key: tg_2.root_uuid, tg_2.group_level DESC
  • Sort Method: quicksort Memory: 25kB
123. 5.683 5.683 ↓ 3.0 3 1

CTE Scan on get_team_groups tg_2 (cost=0.00..0.25 rows=1 width=52) (actual time=3.339..5.683 rows=3 loops=1)

  • Filter: (category = 'GROUP'::text)
  • Rows Removed by Filter: 3
124. 0.093 0.093 ↓ 3.0 3 3

CTE Scan on get_teams team (cost=0.00..0.02 rows=1 width=40) (actual time=0.007..0.031 rows=3 loops=3)

125. 0.316 0.316 ↓ 14.0 14 2

Seq Scan on groups g (cost=0.00..2.52 rows=1 width=25) (actual time=0.044..0.158 rows=14 loops=2)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> $31) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 23
126.          

CTE get_total_person_uuids

127. 0.114 2.846 ↓ 1.5 3 1

Hash Left Join (cost=498.84..507.04 rows=2 width=97) (actual time=2.293..2.846 rows=3 loops=1)

  • Hash Cond: ((SubPlan 24) = resp.notification_uuid)
128. 0.115 0.448 ↓ 1.5 3 1

GroupAggregate (cost=0.05..0.11 rows=2 width=88) (actual time=0.321..0.448 rows=3 loops=1)

  • Group Key: en_1.person_uuid
129. 0.105 0.333 ↓ 3.0 6 1

Sort (cost=0.05..0.06 rows=2 width=56) (actual time=0.280..0.333 rows=6 loops=1)

  • Sort Key: en_1.person_uuid
  • Sort Method: quicksort Memory: 25kB
130. 0.228 0.228 ↓ 3.0 6 1

CTE Scan on get_person_device_notifications en_1 (cost=0.00..0.04 rows=2 width=56) (actual time=0.008..0.228 rows=6 loops=1)

131. 0.177 1.624 ↑ 1.4 22 1

Hash (cost=498.42..498.42 rows=30 width=25) (actual time=1.616..1.624 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
132. 0.677 1.447 ↑ 1.4 22 1

Hash Join (cost=495.00..498.42 rows=30 width=25) (actual time=0.264..1.447 rows=22 loops=1)

  • Hash Cond: ((resp.response)::text = COALESCE(rc_2.translated_response, rc_2.text_response))
133. 0.535 0.535 ↓ 1.1 66 1

Seq Scan on responses resp (cost=0.00..2.93 rows=59 width=25) (actual time=0.012..0.535 rows=66 loops=1)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-09-04 10:12:18-07'::timestamp with time zone) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 2
134. 0.037 0.235 ↑ 666.7 3 1

Hash (cost=470.00..470.00 rows=2,000 width=64) (actual time=0.227..0.235 rows=3 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
135. 0.116 0.198 ↑ 666.7 3 1

HashAggregate (cost=450.00..470.00 rows=2,000 width=64) (actual time=0.158..0.198 rows=3 loops=1)

  • Group Key: COALESCE(rc_2.translated_response, rc_2.text_response)
136. 0.082 0.082 ↑ 2,222.2 9 1

CTE Scan on get_filtered_response_choices rc_2 (cost=0.00..400.00 rows=20,000 width=64) (actual time=0.008..0.082 rows=9 loops=1)

137.          

SubPlan (forHash Left Join)

138. 0.225 0.660 ↑ 1.0 1 5

Limit (cost=4.05..4.05 rows=1 width=24) (actual time=0.097..0.132 rows=1 loops=5)

139. 0.125 0.435 ↑ 7.0 1 5

Sort (cost=4.05..4.07 rows=7 width=24) (actual time=0.078..0.087 rows=1 loops=5)

  • Sort Key: r.received DESC
  • Sort Method: quicksort Memory: 25kB
140. 0.310 0.310 ↑ 7.0 1 5

Seq Scan on responses r (cost=0.00..4.02 rows=7 width=24) (actual time=0.045..0.062 rows=1 loops=5)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-09-04 10:12:18-07'::timestamp with time zone) AND ((response)::text <> 'XMATTERS_REMOVE'::text) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid) AND (notification_uuid = ANY (((array_agg(DISTINCT en_1.device_ntfn_uuid) FILTER (WHERE (en_1.device_ntfn_uuid IS NOT NULL))) || (array_agg(DISTINCT en_1.person_ntfn_uuid) FILTER (WHERE (en_1.person_ntfn_uuid IS NOT NULL)))))))
  • Rows Removed by Filter: 67
141.          

CTE get_total_person_count

142. 0.036 0.080 ↑ 1.0 1 1

Aggregate (cost=0.04..0.06 rows=1 width=8) (actual time=0.064..0.080 rows=1 loops=1)

143. 0.044 0.044 ↓ 1.5 3 1

CTE Scan on get_total_person_uuids (cost=0.00..0.04 rows=2 width=0) (actual time=0.007..0.044 rows=3 loops=1)

144.          

CTE get_person_uuids

145. 0.062 3.059 ↓ 1.5 3 1

Limit (cost=0.05..0.06 rows=2 width=120) (actual time=2.967..3.059 rows=3 loops=1)

146. 0.084 2.997 ↓ 1.5 3 1

Sort (cost=0.05..0.06 rows=2 width=120) (actual time=2.951..2.997 rows=3 loops=1)

  • Sort Key: en_agg.last_response, en_agg.delivered_date_min
  • Sort Method: quicksort Memory: 25kB
147. 2.913 2.913 ↓ 1.5 3 1

CTE Scan on get_total_person_uuids en_agg (cost=0.00..0.04 rows=2 width=120) (actual time=2.310..2.913 rows=3 loops=1)

148.          

CTE get_person_and_roles

149. 0.018 3.162 ↓ 3.0 3 1

Nested Loop Left Join (cost=18.16..23.18 rows=1 width=104) (actual time=1.380..3.162 rows=3 loops=1)

  • Join Filter: (site.site_uuid = p.site_uuid)
  • Rows Removed by Join Filter: 3
150.          

Initplan (forNested Loop Left Join)

151. 0.029 0.052 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.037..0.052 rows=1 loops=1)

152. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event e_18 (cost=0.00..0.02 rows=1 width=8) (actual time=0.007..0.023 rows=1 loops=1)

153. 0.031 0.055 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.039..0.055 rows=1 loops=1)

154. 0.024 0.024 ↑ 1.0 1 1

CTE Scan on get_event e_19 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.024 rows=1 loops=1)

155. 0.096 2.881 ↓ 3.0 3 1

Nested Loop Left Join (cost=18.09..22.07 rows=1 width=91) (actual time=1.274..2.881 rows=3 loops=1)

156. 0.654 1.378 ↓ 3.0 3 1

Nested Loop Semi Join (cost=0.00..3.95 rows=1 width=78) (actual time=0.475..1.378 rows=3 loops=1)

  • Join Filter: (p.person_uuid = get_person_uuids_1.person_uuid)
  • Rows Removed by Join Filter: 48
157. 0.238 0.238 ↓ 18.0 18 1

Seq Scan on persons p (cost=0.00..3.88 rows=1 width=78) (actual time=0.072..0.238 rows=18 loops=1)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> $38) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 41
158. 0.486 0.486 ↓ 1.5 3 18

CTE Scan on get_person_uuids get_person_uuids_1 (cost=0.00..0.04 rows=2 width=16) (actual time=0.007..0.027 rows=3 loops=18)

159. 0.141 1.407 ↑ 1.0 1 3

Aggregate (cost=18.09..18.10 rows=1 width=32) (actual time=0.459..0.469 rows=1 loops=3)

160. 0.108 1.266 ↑ 100.0 1 3

Hash Left Join (cost=5.00..13.59 rows=100 width=57) (actual time=0.318..0.422 rows=1 loops=3)

  • Hash Cond: ((((jsonb_array_elements_text(pr_1.roles)))::uuid) = role.role_uuid)
161. 0.144 0.630 ↑ 100.0 1 3

Nested Loop Left Join (cost=0.00..7.49 rows=100 width=16) (actual time=0.124..0.210 rows=1 loops=3)

162. 0.090 0.090 ↑ 1.0 1 3

Seq Scan on person_roles pr_1 (cost=0.00..3.23 rows=1 width=50) (actual time=0.016..0.030 rows=1 loops=3)

  • Filter: (upper_inf(valid_range) AND (person_uuid = p.person_uuid) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 69
163. 0.108 0.396 ↑ 100.0 1 3

Result (cost=0.00..2.27 rows=100 width=16) (actual time=0.084..0.132 rows=1 loops=3)

164. 0.138 0.288 ↑ 100.0 1 3

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.068..0.096 rows=1 loops=3)

165. 0.150 0.150 ↑ 1.0 1 3

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.040..0.050 rows=1 loops=3)

166. 0.266 0.528 ↑ 1.3 26 1

Hash (cost=4.56..4.56 rows=35 width=57) (actual time=0.521..0.528 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
167. 0.262 0.262 ↑ 1.3 26 1

Seq Scan on roles role (cost=0.00..4.56 rows=35 width=57) (actual time=0.013..0.262 rows=26 loops=1)

  • Filter: (upper_inf(valid_range) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 78
168. 0.156 0.156 ↓ 2.0 2 3

Seq Scan on sites site (cost=0.00..1.03 rows=1 width=29) (actual time=0.033..0.052 rows=2 loops=3)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> $39) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
169.          

CTE get_person_notifications

170. 0.189 17.743 ↓ 2.0 4 1

Subquery Scan on p_1 (cost=5.66..5.85 rows=2 width=304) (actual time=16.767..17.743 rows=4 loops=1)

171. 0.739 17.554 ↓ 2.0 4 1

GroupAggregate (cost=5.66..5.80 rows=2 width=272) (actual time=16.748..17.554 rows=4 loops=1)

  • Group Key: get_person_device_notifications.person_uuid, get_person_device_notifications.person_ntfn_uuid, get_person_device_notifications.person_delinked_date, get_person_device_notifications.team_uuid, get_person_device_notifications.event_uuid, get_person_device_notifications.person_response_value, get_person_device_notifications.person_response_received, get_person_device_notifications.person_response_recipient_type
172.          

Initplan (forGroupAggregate)

173. 0.080 0.103 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.087..0.103 rows=1 loops=1)

174. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event e_20 (cost=0.00..0.02 rows=1 width=8) (actual time=0.008..0.023 rows=1 loops=1)

175. 0.227 16.712 ↓ 3.0 6 1

Sort (cost=5.63..5.64 rows=2 width=325) (actual time=16.558..16.712 rows=6 loops=1)

  • Sort Key: get_person_device_notifications.person_uuid, get_person_device_notifications.person_ntfn_uuid, get_person_device_notifications.person_delinked_date, get_person_device_notifications.team_uuid, get_person_device_notifications.event_uuid, get_person_device_notifications.person_response_value, get_person_device_notifications.person_response_received, get_person_device_notifications.person_response_recipient_type
  • Sort Method: quicksort Memory: 26kB
176. 0.239 16.485 ↓ 3.0 6 1

Nested Loop Semi Join (cost=0.00..5.62 rows=2 width=325) (actual time=13.595..16.485 rows=6 loops=1)

  • Join Filter: (get_person_device_notifications.person_uuid = get_person_uuids_2.person_uuid)
  • Rows Removed by Join Filter: 9
177. 1.141 13.036 ↓ 3.0 6 1

Nested Loop Left Join (cost=0.00..5.51 rows=2 width=325) (actual time=10.585..13.036 rows=6 loops=1)

  • Join Filter: (d.recipient_uuid = get_person_device_notifications.device_uuid)
  • Rows Removed by Join Filter: 115
178. 10.269 10.269 ↓ 3.0 6 1

CTE Scan on get_person_device_notifications (cost=0.00..0.04 rows=2 width=280) (actual time=10.211..10.269 rows=6 loops=1)

179. 1.286 1.626 ↓ 20.0 20 6

Materialize (cost=0.00..5.44 rows=1 width=61) (actual time=0.030..0.271 rows=20 loops=6)

180. 0.340 0.340 ↓ 20.0 20 1

Seq Scan on devices d (cost=0.00..5.44 rows=1 width=61) (actual time=0.127..0.340 rows=20 loops=1)

  • Filter: ((is_visible IS TRUE) AND (valid_range @> $44) AND (organization_uuid = '539525d4-1fe5-4075-abf2-8b92eae0e96b'::uuid))
  • Rows Removed by Filter: 76
181. 3.210 3.210 ↑ 1.0 2 6

CTE Scan on get_person_uuids get_person_uuids_2 (cost=0.00..0.04 rows=2 width=16) (actual time=0.504..0.535 rows=2 loops=6)

182.          

Initplan (forSort)

183. 0.108 0.108 ↑ 1.0 1 1

CTE Scan on get_total_person_count (cost=0.00..0.02 rows=1 width=8) (actual time=0.079..0.108 rows=1 loops=1)

184. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on get_event get_event_2 (cost=0.00..0.02 rows=1 width=16) (actual time=0.008..0.023 rows=1 loops=1)

185. 0.226 30.978 ↓ 1.5 3 1

Hash Left Join (cost=354.45..2,112.73 rows=2 width=464) (actual time=29.479..30.978 rows=3 loops=1)

  • Hash Cond: (pn.person_uuid = get_person_and_roles.person_uuid)
186. 0.097 27.483 ↓ 1.5 3 1

Merge Left Join (cost=354.42..2,112.65 rows=2 width=264) (actual time=26.041..27.483 rows=3 loops=1)

  • Merge Cond: (pn.person_uuid = get_person_uuids.person_uuid)
187. 0.127 27.257 ↓ 1.5 3 1

Nested Loop Left Join (cost=354.37..2,112.57 rows=2 width=232) (actual time=25.920..27.257 rows=3 loops=1)

188. 0.129 20.074 ↓ 1.5 3 1

Nested Loop Left Join (cost=354.34..2,112.45 rows=2 width=232) (actual time=19.003..20.074 rows=3 loops=1)

189. 0.146 19.549 ↓ 1.5 3 1

Nested Loop Left Join (cost=176.57..1,756.85 rows=2 width=232) (actual time=18.763..19.549 rows=3 loops=1)

190. 0.329 18.794 ↓ 1.5 3 1

GroupAggregate (cost=0.05..1,403.73 rows=2 width=248) (actual time=18.488..18.794 rows=3 loops=1)

  • Group Key: pn.person_uuid, pn.event_uuid
191. 0.213 18.364 ↓ 2.0 4 1

Sort (cost=0.05..0.06 rows=2 width=288) (actual time=18.302..18.364 rows=4 loops=1)

  • Sort Key: pn.person_uuid, pn.event_uuid
  • Sort Method: quicksort Memory: 29kB
192. 18.151 18.151 ↓ 2.0 4 1

CTE Scan on get_person_notifications pn (cost=0.00..0.04 rows=2 width=288) (actual time=16.788..18.151 rows=4 loops=1)

193.          

SubPlan (forGroupAggregate)

194. 0.047 0.101 ↑ 127.0 1 1

HashAggregate (cost=700.50..701.77 rows=127 width=32) (actual time=0.085..0.101 rows=1 loops=1)

  • Group Key: get_filtered_response_choices.text_response
195. 0.054 0.054 ↑ 66.7 3 1

CTE Scan on get_filtered_response_choices (cost=0.00..700.00 rows=200 width=32) (actual time=0.013..0.054 rows=3 loops=1)

  • Filter: ((lower((pn.person_response_value)::text) = lower(text_response)) OR (lower((pn.person_response_value)::text) = lower(translated_response)))
  • Rows Removed by Filter: 6
196. 0.255 0.609 ↑ 1.0 1 3

Aggregate (cost=176.52..176.53 rows=1 width=32) (actual time=0.192..0.203 rows=1 loops=3)

197. 0.159 0.354 ↑ 5,000.0 2 3

ProjectSet (cost=0.00..51.52 rows=10,000 width=32) (actual time=0.066..0.118 rows=2 loops=3)

198. 0.135 0.195 ↑ 100.0 1 3

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.041..0.065 rows=1 loops=3)

199. 0.060 0.060 ↑ 1.0 1 3

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.009..0.020 rows=1 loops=3)

200. 0.123 0.396 ↑ 1.0 1 3

Aggregate (cost=177.77..177.78 rows=1 width=32) (actual time=0.121..0.132 rows=1 loops=3)

201. 0.090 0.273 ↓ 0.0 0 3

ProjectSet (cost=0.00..52.77 rows=10,000 width=32) (actual time=0.064..0.091 rows=0 loops=3)

202. 0.120 0.183 ↓ 0.0 0 3

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.042..0.061 rows=0 loops=3)

203. 0.063 0.063 ↑ 1.0 1 3

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.009..0.021 rows=1 loops=3)

204. 0.183 7.056 ↑ 1.0 1 3

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=2.341..2.352 rows=1 loops=3)

205. 6.873 6.873 ↑ 1.0 1 3

CTE Scan on get_targeted_groups tg (cost=0.00..0.02 rows=1 width=120) (actual time=2.125..2.291 rows=1 loops=3)

  • Filter: (team_ntfn_uuids && (array_agg(pn.team_uuid)))
  • Rows Removed by Filter: 1
206. 0.064 0.129 ↓ 1.5 3 1

Sort (cost=0.05..0.06 rows=2 width=48) (actual time=0.096..0.129 rows=3 loops=1)

  • Sort Key: get_person_uuids.person_uuid
  • Sort Method: quicksort Memory: 25kB
207. 0.065 0.065 ↓ 1.5 3 1

CTE Scan on get_person_uuids (cost=0.00..0.04 rows=2 width=48) (actual time=0.008..0.065 rows=3 loops=1)

208. 0.042 3.269 ↓ 3.0 3 1

Hash (cost=0.02..0.02 rows=1 width=224) (actual time=3.261..3.269 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
209. 3.227 3.227 ↓ 3.0 3 1

CTE Scan on get_person_and_roles (cost=0.00..0.02 rows=1 width=224) (actual time=1.398..3.227 rows=3 loops=1)

Planning time : 5.604 ms
Execution time : 35.023 ms