explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UR92

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 868.699 ↑ 20.9 10 1

Sort (cost=1,357,702.50..1,357,703.02 rows=209 width=224) (actual time=868.697..868.699 rows=10 loops=1)

  • Sort Key: (min(pn.device_delivered_date_min)) DESC
  • Sort Method: quicksort Memory: 44kB
2.          

CTE get_event

3. 0.001 0.181 ↑ 1.0 1 1

Append (cost=0.56..3.58 rows=1 width=737) (actual time=0.180..0.181 rows=1 loops=1)

4. 0.180 0.180 ↑ 1.0 1 1

Index Scan using events_org_part_default_evn_seq_vrange_uidx on events_org_part_default e (cost=0.56..3.58 rows=1 width=737) (actual time=0.179..0.180 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (event_uuid = 'f20cf6ff-64e4-4a07-a655-2c276bc37ba9'::uuid))
  • Filter: (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone)
  • Rows Removed by Filter: 1
5.          

CTE get_response_choices

6. 0.002 0.355 ↑ 20,000.0 1 1

Append (cost=0.42..1,008.53 rows=20,000 width=128) (actual time=0.323..0.355 rows=1 loops=1)

7. 0.007 0.351 ↑ 10,000.0 1 1

Nested Loop (cost=0.42..355.99 rows=10,000 width=128) (actual time=0.322..0.351 rows=1 loops=1)

8. 0.007 0.186 ↑ 1.0 1 1

Nested Loop (cost=0.42..3.47 rows=1 width=986) (actual time=0.158..0.186 rows=1 loops=1)

9. 0.003 0.003 ↑ 1.0 1 1

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

  • Filter: (choices IS NULL)
10. 0.176 0.176 ↑ 1.0 1 1

Index Scan using forms_org_seq_vrange_uidx on forms f (cost=0.42..3.44 rows=1 width=1,021) (actual time=0.150..0.176 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (form_uuid = e_1.form_uuid))
  • Filter: (valid_range @> e_1.created)
  • Rows Removed by Filter: 2
11. 0.097 0.158 ↑ 10,000.0 1 1

ProjectSet (cost=0.00..52.52 rows=10,000 width=64) (actual time=0.157..0.158 rows=1 loops=1)

12. 0.060 0.061 ↑ 100.0 1 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.060..0.061 rows=1 loops=1)

13. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1)

14. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.00..352.54 rows=10,000 width=128) (actual time=0.002..0.002 rows=0 loops=1)

15. 0.002 0.002 ↓ 0.0 0 1

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

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

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

17. 0.000 0.000 ↓ 0.0 0

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

18. 0.000 0.000 ↓ 0.0 0

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

19.          

CTE get_filtered_response_choices

20. 0.020 0.056 ↑ 10,000.0 1 1

Hash Join (cost=603.36..1,167.11 rows=10,000 width=128) (actual time=0.055..0.056 rows=1 loops=1)

  • Hash Cond: (rc.text_response = rc2.text_response)
21. 0.002 0.002 ↑ 20,000.0 1 1

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

22. 0.012 0.034 ↑ 127.0 1 1

Hash (cost=601.77..601.77 rows=127 width=32) (actual time=0.034..0.034 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.008 0.022 ↑ 127.0 1 1

HashAggregate (cost=600.50..601.77 rows=127 width=32) (actual time=0.022..0.022 rows=1 loops=1)

  • Group Key: rc2.text_response
24. 0.014 0.014 ↑ 200.0 1 1

CTE Scan on get_response_choices rc2 (cost=0.00..600.00 rows=200 width=32) (actual time=0.014..0.014 rows=1 loops=1)

  • Filter: ((lower(translated_response) = 'acknowledge'::text) OR (lower(text_response) = 'acknowledge'::text))
25.          

CTE get_person_device_notifications

26. 6.662 592.647 ↓ 4,303.5 8,607 1

Unique (cost=1,080.60..1,080.71 rows=2 width=344) (actual time=583.887..592.647 rows=8,607 loops=1)

27. 22.013 585.985 ↓ 4,303.5 8,607 1

Sort (cost=1,080.60..1,080.61 rows=2 width=344) (actual time=583.884..585.985 rows=8,607 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 <= '2019-09-04 17:12:18+00'::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 <= '2019-09-04 17:12:18+00'::timestamp with time zone) THEN device_ntfn.failed_date ELSE NULL::timestamp with time zone END), (CASE WHEN (device_ntfn.delivered_date <= '2019-09-04 17:12:18+00'::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 <= '2019-09-04 17:12:18+00'::timestamp with time zone)) THEN device_response.received ELSE NULL::timestamp with time zone END), (CASE WHEN ((device_response.received <= '2019-09-04 17:12:18+00'::timestamp with time zone) AND ((device_response.response)::text <> 'XMATTERS_REMOVE'::text)) THEN 'RESPONDED'::text WHEN (device_ntfn.delivered_date <= '2019-09-04 17:12:18+00'::timestamp with time zone) THEN 'DELIVERED'::text WHEN (device_ntfn.failed_date <= '2019-09-04 17:12:18+00'::timestamp with time zone) THEN 'FAILED'::text WHEN (live_ntfn.pending_date <= '2019-09-04 17:12:18+00'::timestamp with time zone) THEN 'PENDING'::text ELSE ''::text END), (CASE WHEN (live_ntfn.pending_date <= '2019-09-04 17:12:18+00'::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 <= '2019-09-04 17:12:18+00'::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: 2671kB
28. 1.675 563.972 ↓ 4,303.5 8,607 1

Append (cost=1.90..1,080.59 rows=2 width=344) (actual time=11.114..563.972 rows=8,607 loops=1)

29. 19.995 462.150 ↓ 8,566.0 8,566 1

Nested Loop Left Join (cost=1.90..775.31 rows=1 width=319) (actual time=11.111..462.150 rows=8,566 loops=1)

30.          

Initplan (forNested Loop Left Join)

31. 0.004 0.005 ↑ 1.0 1 1

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

32. 0.001 0.001 ↑ 1.0 1 1

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

33. 0.005 0.006 ↑ 1.0 1 1

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

34. 0.001 0.001 ↑ 1.0 1 1

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

35. 0.004 0.005 ↑ 1.0 1 1

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

36. 0.001 0.001 ↑ 1.0 1 1

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

37. 0.004 0.005 ↑ 1.0 1 1

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

38. 0.001 0.001 ↑ 1.0 1 1

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

39. 0.026 0.029 ↑ 1.0 1 1

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

40. 0.003 0.003 ↑ 1.0 1 1

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

41. 0.005 0.006 ↑ 1.0 1 1

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

42. 0.001 0.001 ↑ 1.0 1 1

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

43. 6.220 173.055 ↓ 8,385.0 8,385 1

Nested Loop (cost=1.13..69.71 rows=1 width=128) (actual time=10.604..173.055 rows=8,385 loops=1)

44. 8.877 116.525 ↓ 8,385.0 8,385 1

Nested Loop (cost=0.72..66.41 rows=1 width=72) (actual time=10.479..116.525 rows=8,385 loops=1)

45. 1.654 32.183 ↓ 8,385.0 8,385 1

Nested Loop (cost=0.31..62.96 rows=1 width=24) (actual time=10.349..32.183 rows=8,385 loops=1)

46. 0.010 0.195 ↑ 1.0 1 1

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

  • Group Key: get_event.event_uuid
47. 0.185 0.185 ↑ 1.0 1 1

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

48. 1.405 30.334 ↓ 8,385.0 8,385 1

Append (cost=0.29..62.91 rows=1 width=40) (actual time=10.149..30.334 rows=8,385 loops=1)

49. 28.929 28.929 ↓ 8,385.0 8,385 1

Index Scan using notifications_summary_org_part_454_event_uuid_idx on notifications_summary_org_part_454 live_ntfn (cost=0.29..62.91 rows=1 width=40) (actual time=10.146..28.929 rows=8,385 loops=1)

  • Index Cond: (event_uuid = get_event.event_uuid)
  • Filter: ((created_date >= $13) AND (pending_date <= '2019-09-04 17:12:18+00'::timestamp with time zone) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (category = 'LIVE'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $12)))
  • Rows Removed by Filter: 12077
50. 0.000 75.465 ↑ 1.0 1 8,385

Append (cost=0.41..3.45 rows=1 width=64) (actual time=0.009..0.009 rows=1 loops=8,385)

51. 75.465 75.465 ↑ 1.0 1 8,385

Index Scan using notifications_summary_org_part_454_pkey on notifications_summary_org_part_454 device_ntfn (cost=0.41..3.44 rows=1 width=64) (actual time=0.009..0.009 rows=1 loops=8,385)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (notification_uuid = live_ntfn.parent_ntfn_uuid))
  • Filter: ((created_date >= $9) AND (category = 'DEVICE'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $8)))
52. 0.000 50.310 ↑ 1.0 1 8,385

Append (cost=0.41..3.29 rows=1 width=72) (actual time=0.006..0.006 rows=1 loops=8,385)

53. 50.310 50.310 ↑ 1.0 1 8,385

Index Scan using notifications_summary_org_part_454_pkey on notifications_summary_org_part_454 person_ntfn (cost=0.41..3.28 rows=1 width=72) (actual time=0.005..0.006 rows=1 loops=8,385)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (notification_uuid = device_ntfn.parent_ntfn_uuid))
  • Filter: ((created_date >= $11) AND (category = 'PERSON'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $10)))
54. 234.780 234.780 ↓ 0.0 0 8,385

Index Scan using responses_notification_uuid_idx on responses device_response (cost=0.56..3.58 rows=1 width=63) (actual time=0.027..0.028 rows=0 loops=8,385)

  • Index Cond: (notification_uuid = device_ntfn.notification_uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid))
55.          

SubPlan (forNested Loop Left Join)

56. 17.132 34.264 ↓ 0.0 0 8,566

HashAggregate (cost=700.50..701.77 rows=127 width=32) (actual time=0.004..0.004 rows=0 loops=8,566)

  • Group Key: get_response_choices.text_response
57. 17.132 17.132 ↓ 0.0 0 8,566

CTE Scan on get_response_choices (cost=0.00..700.00 rows=200 width=32) (actual time=0.002..0.002 rows=0 loops=8,566)

  • Filter: ((lower((device_response.response)::text) = lower(text_response)) OR (lower((device_response.response)::text) = lower(translated_response)))
  • Rows Removed by Filter: 1
58. 0.033 100.147 ↓ 41.0 41 1

Hash Join (cost=291.47..305.25 rows=1 width=303) (actual time=100.126..100.147 rows=41 loops=1)

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

Initplan (forHash Join)

60. 0.007 0.008 ↑ 1.0 1 1

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

61. 0.001 0.001 ↑ 1.0 1 1

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

62. 0.005 0.006 ↑ 1.0 1 1

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

63. 0.001 0.001 ↑ 1.0 1 1

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

64. 0.019 0.082 ↑ 1,000.0 1 1

HashAggregate (cost=225.00..235.00 rows=1,000 width=64) (actual time=0.077..0.082 rows=1 loops=1)

  • Group Key: COALESCE(rc_1.translated_response, rc_1.text_response)
65. 0.063 0.063 ↑ 10,000.0 1 1

CTE Scan on get_filtered_response_choices rc_1 (cost=0.00..200.00 rows=10,000 width=64) (actual time=0.062..0.063 rows=1 loops=1)

66. 0.102 100.018 ↓ 41.0 41 1

Hash (cost=66.39..66.39 rows=1 width=119) (actual time=100.018..100.018 rows=41 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
67. 5.007 99.916 ↓ 41.0 41 1

Nested Loop (cost=0.87..66.39 rows=1 width=119) (actual time=2.043..99.916 rows=41 loops=1)

68. 0.909 16.684 ↓ 3,725.0 3,725 1

Nested Loop (cost=0.31..62.80 rows=1 width=72) (actual time=0.068..16.684 rows=3,725 loops=1)

69. 0.007 0.009 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=0.007..0.009 rows=1 loops=1)

  • Group Key: get_event_1.event_uuid
70. 0.002 0.002 ↑ 1.0 1 1

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

71. 0.607 15.766 ↓ 3,725.0 3,725 1

Append (cost=0.29..62.75 rows=1 width=72) (actual time=0.057..15.766 rows=3,725 loops=1)

72. 15.159 15.159 ↓ 3,725.0 3,725 1

Index Scan using notifications_summary_org_part_454_event_uuid_idx on notifications_summary_org_part_454 person_resp_ntfn (cost=0.29..62.75 rows=1 width=72) (actual time=0.055..15.159 rows=3,725 loops=1)

  • Index Cond: (event_uuid = get_event_1.event_uuid)
  • Filter: ((created_date >= $15) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (category = 'PERSON'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $14)))
  • Rows Removed by Filter: 16737
73. 78.225 78.225 ↓ 0.0 0 3,725

Index Scan using responses_notification_uuid_idx on responses pr (cost=0.56..3.58 rows=1 width=63) (actual time=0.021..0.021 rows=0 loops=3,725)

  • Index Cond: (notification_uuid = person_resp_ntfn.notification_uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND ((recipient_type)::text = 'PERSON'::text))
74.          

CTE get_teams

75. 0.800 60.110 ↓ 6.0 6 1

GroupAggregate (cost=7.14..7.17 rows=1 width=56) (actual time=59.064..60.110 rows=6 loops=1)

  • Group Key: team_ntfns.team_ntfn_uuid, team_ntfns.team_parent_ntfn_uuid
76. 2.095 59.310 ↓ 3,725.0 3,725 1

Sort (cost=7.14..7.14 rows=1 width=56) (actual time=59.045..59.310 rows=3,725 loops=1)

  • Sort Key: team_ntfns.team_ntfn_uuid, team_ntfns.team_parent_ntfn_uuid
  • Sort Method: quicksort Memory: 460kB
77. 0.509 57.215 ↓ 3,725.0 3,725 1

Subquery Scan on team_ntfns (cost=7.09..7.13 rows=1 width=56) (actual time=53.631..57.215 rows=3,725 loops=1)

78. 2.424 56.706 ↓ 3,725.0 3,725 1

GroupAggregate (cost=7.09..7.12 rows=1 width=72) (actual time=53.629..56.706 rows=3,725 loops=1)

  • Group Key: en.person_ntfn_uuid, en.team_ntfn_uuid, en.team_parent_ntfn_uuid
79. 3.218 54.282 ↓ 3,725.0 3,725 1

Sort (cost=7.09..7.09 rows=1 width=80) (actual time=53.613..54.282 rows=3,725 loops=1)

  • Sort Key: en.person_ntfn_uuid, en.team_ntfn_uuid, en.team_parent_ntfn_uuid
  • Sort Method: quicksort Memory: 620kB
80. 0.542 51.064 ↓ 3,725.0 3,725 1

Subquery Scan on en (cost=7.03..7.08 rows=1 width=80) (actual time=45.747..51.064 rows=3,725 loops=1)

81. 3.906 50.522 ↓ 3,725.0 3,725 1

GroupAggregate (cost=7.03..7.07 rows=1 width=128) (actual time=45.745..50.522 rows=3,725 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.006 0.007 ↑ 1.0 1 1

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

84. 0.001 0.001 ↑ 1.0 1 1

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

85. 0.004 0.006 ↑ 1.0 1 1

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

86. 0.002 0.002 ↑ 1.0 1 1

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

87. 7.377 46.603 ↓ 8,607.0 8,607 1

Sort (cost=6.96..6.97 rows=1 width=96) (actual time=45.722..46.603 rows=8,607 loops=1)

  • Sort Key: n.person_uuid, n.person_ntfn_uuid, team_ntfn.notification_uuid, team_ntfn.parent_ntfn_uuid
  • Sort Method: quicksort Memory: 1595kB
88. 1.722 39.226 ↓ 8,607.0 8,607 1

Nested Loop (cost=0.41..6.96 rows=1 width=96) (actual time=0.062..39.226 rows=8,607 loops=1)

89. 3.076 3.076 ↓ 4,303.5 8,607 1

CTE Scan on get_person_device_notifications n (cost=0.00..0.04 rows=2 width=80) (actual time=0.002..3.076 rows=8,607 loops=1)

90. 8.607 34.428 ↑ 1.0 1 8,607

Append (cost=0.41..3.45 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=8,607)

91. 25.821 25.821 ↑ 1.0 1 8,607

Index Scan using notifications_summary_org_part_454_pkey on notifications_summary_org_part_454 team_ntfn (cost=0.41..3.44 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=8,607)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (notification_uuid = n.team_uuid))
  • Filter: ((created_date >= $24) AND (category = 'TEAM'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $23)))
92.          

CTE get_team_groups

93. 0.007 60.351 ↑ 1.8 6 1

Recursive Union (cost=0.50..352.23 rows=11 width=74) (actual time=60.233..60.351 rows=6 loops=1)

94. 0.000 60.300 ↓ 6.0 6 1

Nested Loop (cost=0.50..3.56 rows=1 width=74) (actual time=60.229..60.300 rows=6 loops=1)

95.          

Initplan (forNested Loop)

96. 0.009 0.010 ↑ 1.0 1 1

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

97. 0.001 0.001 ↑ 1.0 1 1

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

98. 0.022 0.025 ↑ 1.0 1 1

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

99. 0.003 0.003 ↑ 1.0 1 1

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

100. 0.013 60.140 ↓ 6.0 6 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=60.138..60.140 rows=6 loops=1)

  • Group Key: get_teams.team_ntfn_uuid
101. 60.127 60.127 ↓ 6.0 6 1

CTE Scan on get_teams (cost=0.00..0.02 rows=1 width=16) (actual time=59.068..60.127 rows=6 loops=1)

102. 0.006 0.150 ↑ 1.0 1 6

Append (cost=0.41..3.45 rows=1 width=54) (actual time=0.024..0.025 rows=1 loops=6)

103. 0.144 0.144 ↑ 1.0 1 6

Index Scan using notifications_summary_org_part_454_pkey on notifications_summary_org_part_454 team_ntfn_1 (cost=0.41..3.44 rows=1 width=54) (actual time=0.023..0.024 rows=1 loops=6)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (notification_uuid = get_teams.team_ntfn_uuid))
  • Filter: ((created_date >= $29) AND (category = 'TEAM'::text) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $28)))
104. 0.000 0.044 ↓ 0.0 0 1

Nested Loop (cost=0.48..34.85 rows=1 width=74) (actual time=0.044..0.044 rows=0 loops=1)

105.          

Initplan (forNested Loop)

106. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=0.02..0.04 rows=1 width=8) (never executed)

107. 0.000 0.000 ↓ 0.0 0

CTE Scan on get_event e_15 (cost=0.00..0.02 rows=1 width=8) (never executed)

108. 0.003 0.004 ↑ 1.0 1 1

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

109. 0.001 0.001 ↑ 1.0 1 1

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

110. 0.005 0.005 ↑ 1.7 6 1

WorkTable Scan on get_team_groups tg_1 (cost=0.00..0.20 rows=10 width=36) (actual time=0.004..0.005 rows=6 loops=1)

111. 0.006 0.036 ↓ 0.0 0 6

Append (cost=0.41..3.45 rows=1 width=54) (actual time=0.006..0.006 rows=0 loops=6)

112. 0.030 0.030 ↓ 0.0 0 6

Index Scan using notifications_summary_org_part_454_pkey on notifications_summary_org_part_454 n_1 (cost=0.41..3.44 rows=1 width=54) (actual time=0.005..0.005 rows=0 loops=6)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (notification_uuid = tg_1.parent_ntfn_uuid))
  • Filter: ((created_date >= $31) AND (category = ANY ('{TEAM,GROUP}'::text[])) AND (created_date <= LEAST('2019-09-04 17:12:18+00'::timestamp with time zone, $30)))
  • Rows Removed by Filter: 1
113.          

CTE get_targeted_groups

114. 0.002 60.447 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.93..3.99 rows=1 width=168) (actual time=60.447..60.447 rows=0 loops=1)

115.          

Initplan (forNested Loop Left Join)

116. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=0.02..0.03 rows=1 width=8) (never executed)

117. 0.000 0.000 ↓ 0.0 0

CTE Scan on get_event e_17 (cost=0.00..0.02 rows=1 width=8) (never executed)

118. 0.002 60.445 ↓ 0.0 0 1

HashAggregate (cost=0.34..0.35 rows=1 width=88) (actual time=60.445..60.445 rows=0 loops=1)

  • Group Key: team_group.notification_uuid, team_group.recipient_uuid
119. 0.002 60.443 ↓ 0.0 0 1

Nested Loop (cost=0.26..0.33 rows=1 width=72) (actual time=60.443..60.443 rows=0 loops=1)

  • Join Filter: (team_group.root_uuid = team.team_ntfn_uuid)
120. 0.001 60.441 ↓ 0.0 0 1

Subquery Scan on team_group (cost=0.26..0.29 rows=1 width=48) (actual time=60.441..60.441 rows=0 loops=1)

  • Filter: (team_group.""row"" = 1)
121. 0.022 60.440 ↓ 0.0 0 1

WindowAgg (cost=0.26..0.28 rows=1 width=60) (actual time=60.440..60.440 rows=0 loops=1)

122. 0.057 60.418 ↓ 0.0 0 1

Sort (cost=0.26..0.26 rows=1 width=52) (actual time=60.418..60.418 rows=0 loops=1)

  • Sort Key: tg_2.root_uuid, tg_2.group_level DESC
  • Sort Method: quicksort Memory: 25kB
123. 60.361 60.361 ↓ 0.0 0 1

CTE Scan on get_team_groups tg_2 (cost=0.00..0.25 rows=1 width=52) (actual time=60.361..60.361 rows=0 loops=1)

  • Filter: (category = 'GROUP'::text)
  • Rows Removed by Filter: 6
124. 0.000 0.000 ↓ 0.0 0

CTE Scan on get_teams team (cost=0.00..0.02 rows=1 width=40) (never executed)

125. 0.000 0.000 ↓ 0.0 0

Index Scan using groups_org_seq_vrange_uidx on groups g (cost=0.56..3.58 rows=1 width=64) (never executed)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (group_uuid = team_group.recipient_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> $35))
126.          

CTE get_total_person_uuids

127. 1.075 94.791 ↓ 1,338.0 1,338 1

Hash Join (cost=272.27..286.06 rows=1 width=184) (actual time=93.757..94.791 rows=1,338 loops=1)

  • Hash Cond: (COALESCE(rc_2.translated_response, rc_2.text_response) = (resp.response)::text)
128. 0.023 0.030 ↑ 1,000.0 1 1

HashAggregate (cost=225.00..235.00 rows=1,000 width=64) (actual time=0.025..0.030 rows=1 loops=1)

  • Group Key: COALESCE(rc_2.translated_response, rc_2.text_response)
129. 0.007 0.007 ↑ 10,000.0 1 1

CTE Scan on get_filtered_response_choices rc_2 (cost=0.00..200.00 rows=10,000 width=64) (actual time=0.007..0.007 rows=1 loops=1)

130. 1.439 93.686 ↓ 1,338.0 1,338 1

Hash (cost=47.25..47.25 rows=1 width=152) (actual time=93.686..93.686 rows=1,338 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 339kB
131. 45.213 92.247 ↓ 1,338.0 1,338 1

Nested Loop (cost=44.06..47.25 rows=1 width=152) (actual time=21.414..92.247 rows=1,338 loops=1)

132. 21.067 43.542 ↓ 1,164.0 1,164 1

GroupAggregate (cost=0.05..0.20 rows=1 width=136) (actual time=21.303..43.542 rows=1,164 loops=1)

  • Group Key: en_1.person_uuid
  • Filter: (CASE WHEN ((array_agg(en_1.device_delivery_status) FILTER (WHERE (en_1.device_delivery_status IS NOT NULL)) @> '{RESPONDED}'::text[]) OR (min(en_1.person_response_received) IS NOT NULL)) THEN 'RESPONDED'::text WHEN (array_agg(en_1.device_delivery_status) FILTER (WHERE (en_1.device_delivery_status IS NOT NULL)) @> '{DELIVERED}'::text[]) THEN 'DELIVERED'::text WHEN (array_agg(en_1.device_delivery_status) FILTER (WHERE (en_1.device_delivery_status IS NOT NULL)) @> '{PENDING}'::text[]) THEN 'PENDING'::text WHEN ((array_agg(en_1.device_delivery_status) FILTER (WHERE (en_1.device_delivery_status IS NOT NULL)) @> '{FAILED}'::text[]) AND (min(en_1.person_delinked_date) IS NOT NULL)) THEN 'FAILED'::text ELSE 'PENDING'::text END = 'RESPONDED'::text)
  • Rows Removed by Filter: 2561
133. 6.696 22.475 ↓ 4,303.5 8,607 1

Sort (cost=0.05..0.06 rows=2 width=104) (actual time=21.190..22.475 rows=8,607 loops=1)

  • Sort Key: en_1.person_uuid
  • Sort Method: quicksort Memory: 1592kB
134. 15.779 15.779 ↓ 4,303.5 8,607 1

CTE Scan on get_person_device_notifications en_1 (cost=0.00..0.04 rows=2 width=104) (actual time=0.005..15.779 rows=8,607 loops=1)

135. 0.000 3.492 ↑ 1.0 1 1,164

Index Scan using responses_notification_uuid_idx on responses resp (cost=44.01..47.03 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=1,164)

  • Index Cond: (notification_uuid = (SubPlan 24))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid))
136.          

SubPlan (forIndex Scan)

137. 1.164 43.068 ↑ 1.0 1 1,164

Limit (cost=43.45..43.45 rows=1 width=24) (actual time=0.037..0.037 rows=1 loops=1,164)

138. 2.328 41.904 ↑ 1.0 1 1,164

Sort (cost=43.45..43.45 rows=1 width=24) (actual time=0.036..0.036 rows=1 loops=1,164)

  • Sort Key: r.received DESC
  • Sort Method: quicksort Memory: 25kB
139. 39.576 39.576 ↑ 1.0 1 1,164

Index Scan using responses_notification_uuid_idx on responses r (cost=0.56..43.44 rows=1 width=24) (actual time=0.022..0.034 rows=1 loops=1,164)

  • Index Cond: (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))))))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone) AND ((response)::text <> 'XMATTERS_REMOVE'::text) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid))
140.          

CTE get_person_uuids

141. 0.006 97.030 ↓ 10.0 10 1

Limit (cost=0.03..0.04 rows=1 width=200) (actual time=97.026..97.030 rows=10 loops=1)

142. 0.510 97.024 ↓ 10.0 10 1

Sort (cost=0.03..0.04 rows=1 width=200) (actual time=97.023..97.024 rows=10 loops=1)

  • Sort Key: en_agg.last_response DESC NULLS LAST, en_agg.delivered_date_min DESC
  • Sort Method: top-N heapsort Memory: 33kB
143. 96.514 96.514 ↓ 1,338.0 1,338 1

CTE Scan on get_total_person_uuids en_agg (cost=0.00..0.02 rows=1 width=200) (actual time=93.760..96.514 rows=1,338 loops=1)

144.          

CTE get_person_and_roles

145. 0.116 82.360 ↑ 2,322.7 9 1

Nested Loop Left Join (cost=65.41..1,351,586.04 rows=20,904 width=421) (actual time=16.121..82.360 rows=9 loops=1)

  • Join Filter: (site.site_uuid = p.site_uuid)
  • Rows Removed by Join Filter: 531
146. 0.074 79.616 ↑ 2,322.7 9 1

Nested Loop Left Join (cost=65.13..1,349,693.76 rows=20,904 width=408) (actual time=13.706..79.616 rows=9 loops=1)

147. 0.044 55.629 ↑ 2,322.7 9 1

Nested Loop (cost=0.59..9.72 rows=20,904 width=397) (actual time=10.869..55.629 rows=9 loops=1)

148. 0.031 0.035 ↓ 10.0 10 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=0.013..0.035 rows=10 loops=1)

  • Group Key: get_person_uuids.person_uuid
149. 0.004 0.004 ↓ 10.0 10 1

CTE Scan on get_person_uuids (cost=0.00..0.02 rows=1 width=16) (actual time=0.001..0.004 rows=10 loops=1)

150. 0.040 55.550 ↑ 1.0 1 10

Append (cost=0.57..9.67 rows=1 width=397) (actual time=5.488..5.555 rows=1 loops=10)

151. 55.510 55.510 ↑ 1.0 1 10

Index Scan using persons_org_part_default_organization_uuid_person_uuid_sequ_idx on persons_org_part_default p (cost=0.57..9.67 rows=1 width=397) (actual time=5.485..5.551 rows=1 loops=10)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (person_uuid = get_person_uuids.person_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone))
  • Rows Removed by Filter: 288
152. 0.630 23.913 ↑ 1.0 1 9

Aggregate (cost=64.54..64.55 rows=1 width=32) (actual time=2.657..2.657 rows=1 loops=9)

153. 0.243 23.283 ↑ 200.0 1 9

Hash Right Join (cost=22.31..55.53 rows=200 width=58) (actual time=2.576..2.587 rows=1 loops=9)

  • Hash Cond: (role.role_uuid = (((jsonb_array_elements_text(pr_1.roles)))::uuid))
154. 0.522 0.756 ↓ 2.9 23 9

Bitmap Heap Scan on roles role (cost=1.96..35.14 rows=8 width=58) (actual time=0.048..0.084 rows=23 loops=9)

  • Recheck Cond: (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid)
  • Filter: upper_inf(valid_range)
  • Rows Removed by Filter: 12
  • Heap Blocks: exact=54
155. 0.234 0.234 ↓ 1.5 35 9

Bitmap Index Scan on roles_organization_uuid_idx (cost=0.00..1.96 rows=23 width=0) (actual time=0.026..0.026 rows=35 loops=9)

  • Index Cond: (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid)
156. 0.081 22.284 ↑ 200.0 1 9

Hash (cost=17.84..17.84 rows=200 width=16) (actual time=2.476..2.476 rows=1 loops=9)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
157. 0.063 22.203 ↑ 200.0 1 9

Nested Loop Left Join (cost=0.56..17.84 rows=200 width=16) (actual time=2.463..2.467 rows=1 loops=9)

158. 21.915 21.915 ↑ 2.0 1 9

Index Scan using person_roles_org_seq_vrange_uidx on person_roles pr_1 (cost=0.56..9.31 rows=2 width=34) (actual time=2.432..2.435 rows=1 loops=9)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (person_uuid = p.person_uuid))
  • Filter: upper_inf(valid_range)
  • Rows Removed by Filter: 142
159. 0.054 0.225 ↑ 100.0 1 9

Result (cost=0.00..2.27 rows=100 width=16) (actual time=0.023..0.025 rows=1 loops=9)

160. 0.171 0.171 ↑ 100.0 1 9

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.018..0.019 rows=1 loops=9)

161. 0.000 0.000 ↑ 1.0 1 9

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=9)

162. 0.076 2.628 ↓ 10.0 60 9

Materialize (cost=0.28..10.93 rows=6 width=29) (actual time=0.265..0.292 rows=60 loops=9)

163. 2.552 2.552 ↓ 10.0 60 1

Index Scan using sites_org_valid_range_gist on sites site (cost=0.28..10.90 rows=6 width=29) (actual time=2.370..2.552 rows=60 loops=1)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone))
  • Filter: (is_visible IS TRUE)
164.          

CTE get_person_notifications

165. 0.017 722.167 ↓ 5.0 10 1

Subquery Scan on p_1 (cost=185.41..280.56 rows=2 width=304) (actual time=720.783..722.167 rows=10 loops=1)

166. 1.794 722.150 ↓ 5.0 10 1

GroupAggregate (cost=185.41..280.51 rows=2 width=272) (actual time=720.772..722.150 rows=10 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
167. 0.184 720.356 ↑ 64.7 28 1

Sort (cost=185.41..189.93 rows=1,811 width=326) (actual time=720.351..720.356 rows=28 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: 32kB
168. 0.097 720.172 ↑ 64.7 28 1

Nested Loop Left Join (cost=0.59..87.41 rows=1,811 width=326) (actual time=682.850..720.172 rows=28 loops=1)

169. 1.466 684.011 ↓ 28.0 28 1

Hash Semi Join (cost=0.03..0.09 rows=1 width=280) (actual time=681.408..684.011 rows=28 loops=1)

  • Hash Cond: (get_person_device_notifications.person_uuid = get_person_uuids_1.person_uuid)
170. 585.487 585.487 ↓ 4,303.5 8,607 1

CTE Scan on get_person_device_notifications (cost=0.00..0.04 rows=2 width=280) (actual time=583.892..585.487 rows=8,607 loops=1)

171. 0.014 97.058 ↓ 10.0 10 1

Hash (cost=0.02..0.02 rows=1 width=16) (actual time=97.058..97.058 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
172. 97.044 97.044 ↓ 10.0 10 1

CTE Scan on get_person_uuids get_person_uuids_1 (cost=0.00..0.02 rows=1 width=16) (actual time=97.029..97.044 rows=10 loops=1)

173. 0.056 36.064 ↑ 1.0 1 28

Append (cost=0.56..87.31 rows=1 width=62) (actual time=0.646..1.288 rows=1 loops=28)

174. 36.008 36.008 ↑ 1.0 1 28

Index Scan using devices_org_part_default_recipient_uuid_idx on devices_org_part_default d (cost=0.56..87.30 rows=1 width=62) (actual time=0.644..1.286 rows=1 loops=28)

  • Index Cond: (recipient_uuid = get_person_device_notifications.device_uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-04 17:12:18+00'::timestamp with time zone) AND (organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid))
  • Rows Removed by Filter: 139
175.          

Initplan (forSort)

176. 0.099 0.421 ↑ 1.0 1 1

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

177. 0.322 0.322 ↓ 1,338.0 1,338 1

CTE Scan on get_total_person_uuids (cost=0.00..0.02 rows=1 width=0) (actual time=0.002..0.322 rows=1,338 loops=1)

178. 0.003 0.003 ↑ 1.0 1 1

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

179. 0.577 868.535 ↑ 20.9 10 1

Hash Right Join (cost=1,416.69..1,918.39 rows=209 width=224) (actual time=802.149..868.535 rows=10 loops=1)

  • Hash Cond: (get_person_and_roles.person_uuid = pn.person_uuid)
180. 82.413 82.413 ↑ 2,322.7 9 1

CTE Scan on get_person_and_roles (cost=0.00..418.08 rows=20,904 width=16) (actual time=16.126..82.413 rows=9 loops=1)

181. 0.048 785.545 ↓ 5.0 10 1

Hash (cost=1,416.67..1,416.67 rows=2 width=232) (actual time=785.545..785.545 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
182. 0.014 785.497 ↓ 5.0 10 1

Nested Loop Left Join (cost=354.37..1,416.67 rows=2 width=232) (actual time=783.229..785.497 rows=10 loops=1)

183. 0.016 725.023 ↓ 5.0 10 1

Nested Loop Left Join (cost=354.34..1,416.55 rows=2 width=232) (actual time=722.771..725.023 rows=10 loops=1)

184. 0.017 724.867 ↓ 5.0 10 1

Nested Loop Left Join (cost=176.57..1,060.95 rows=2 width=232) (actual time=722.743..724.867 rows=10 loops=1)

185. 1.292 723.680 ↓ 5.0 10 1

GroupAggregate (cost=0.05..707.83 rows=2 width=248) (actual time=722.583..723.680 rows=10 loops=1)

  • Group Key: pn.person_uuid, pn.event_uuid
186. 0.131 722.388 ↓ 5.0 10 1

Sort (cost=0.05..0.06 rows=2 width=288) (actual time=722.384..722.388 rows=10 loops=1)

  • Sort Key: pn.person_uuid, pn.event_uuid
  • Sort Method: quicksort Memory: 44kB
187. 722.257 722.257 ↓ 5.0 10 1

CTE Scan on get_person_notifications pn (cost=0.00..0.04 rows=2 width=288) (actual time=720.798..722.257 rows=10 loops=1)

188.          

SubPlan (forGroupAggregate)

189. 0.000 0.000 ↓ 0.0 0

Unique (cost=353.32..353.82 rows=79 width=32) (never executed)

190. 0.000 0.000 ↓ 0.0 0

Sort (cost=353.32..353.57 rows=100 width=32) (never executed)

  • Sort Key: get_filtered_response_choices.text_response
191. 0.000 0.000 ↓ 0.0 0

CTE Scan on get_filtered_response_choices (cost=0.00..350.00 rows=100 width=32) (never executed)

  • Filter: ((lower((pn.person_response_value)::text) = lower(text_response)) OR (lower((pn.person_response_value)::text) = lower(translated_response)))
192. 1.040 1.170 ↑ 1.0 1 10

Aggregate (cost=176.52..176.53 rows=1 width=32) (actual time=0.116..0.117 rows=1 loops=10)

193. 0.050 0.130 ↑ 3,333.3 3 10

ProjectSet (cost=0.00..51.52 rows=10,000 width=32) (actual time=0.012..0.013 rows=3 loops=10)

194. 0.080 0.080 ↑ 100.0 1 10

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.007..0.008 rows=1 loops=10)

195. 0.000 0.000 ↑ 1.0 1 10

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=10)

196. 0.090 0.140 ↑ 1.0 1 10

Aggregate (cost=177.77..177.78 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=10)

197. 0.030 0.050 ↑ 10,000.0 1 10

ProjectSet (cost=0.00..52.77 rows=10,000 width=32) (actual time=0.004..0.005 rows=1 loops=10)

198. 0.020 0.020 ↑ 100.0 1 10

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.002..0.002 rows=1 loops=10)

199. 0.000 0.000 ↑ 1.0 1 10

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=10)

200. 0.010 60.460 ↑ 1.0 1 10

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=6.046..6.046 rows=1 loops=10)

201. 60.450 60.450 ↓ 0.0 0 10

CTE Scan on get_targeted_groups tg (cost=0.00..0.02 rows=1 width=120) (actual time=6.045..6.045 rows=0 loops=10)

  • Filter: (team_ntfn_uuids && (array_agg(pn.team_uuid)))
Planning time : 3,300.106 ms
Execution time : 880.897 ms