explain.depesz.com

PostgreSQL's explain analyze made readable

Result: le0R

Settings
# exclusive inclusive rows x rows loops node
1. 1.026 1,117.782 ↑ 20.9 10 1

Sort (cost=1,355,810.28..1,355,810.80 rows=209 width=256) (actual time=1,117.781..1,117.782 rows=10 loops=1)

  • Sort Key: get_person_uuids.last_response DESC NULLS LAST, (min(pn.device_delivered_date_min)) DESC
  • Sort Method: quicksort Memory: 44kB
2.          

CTE get_event

3. 0.002 0.195 ↑ 1.0 1 1

Append (cost=0.56..3.58 rows=1 width=737) (actual time=0.194..0.195 rows=1 loops=1)

4. 0.193 0.193 ↑ 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.192..0.193 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.003 0.727 ↑ 20,000.0 1 1

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

7. 0.012 0.721 ↑ 10,000.0 1 1

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

8. 0.013 0.372 ↑ 1.0 1 1

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

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

  • Filter: (choices IS NULL)
10. 0.355 0.355 ↑ 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.310..0.355 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.183 0.337 ↑ 10,000.0 1 1

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

12. 0.153 0.154 ↑ 100.0 1 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.153..0.154 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.001 0.003 ↓ 0.0 0 1

Nested Loop (cost=0.00..352.54 rows=10,000 width=128) (actual time=0.003..0.003 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.039 0.105 ↑ 10,000.0 1 1

Hash Join (cost=603.36..1,167.11 rows=10,000 width=128) (actual time=0.104..0.105 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.013 0.064 ↑ 127.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.017 0.051 ↑ 127.0 1 1

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

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

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

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

CTE get_person_device_notifications

26. 7.806 792.813 ↓ 4,303.5 8,607 1

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

27. 33.351 785.007 ↓ 4,303.5 8,607 1

Sort (cost=1,080.60..1,080.61 rows=2 width=344) (actual time=782.506..785.007 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.964 751.656 ↓ 4,303.5 8,607 1

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

29. 39.735 628.189 ↓ 8,566.0 8,566 1

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

30.          

Initplan (forNested Loop Left Join)

31. 0.006 0.017 ↑ 1.0 1 1

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

32. 0.011 0.011 ↑ 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.011 rows=1 loops=1)

33. 0.006 0.007 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.006..0.007 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.005 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.000 0.000 ↑ 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.000 rows=1 loops=1)

37. 0.031 0.032 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.032..0.032 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.037 0.041 ↑ 1.0 1 1

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

40. 0.004 0.004 ↑ 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.004 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.664 235.452 ↓ 8,385.0 8,385 1

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

44. 7.141 161.708 ↓ 8,385.0 8,385 1

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

45. 1.809 45.562 ↓ 8,385.0 8,385 1

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

46. 0.006 0.206 ↑ 1.0 1 1

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

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

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

48. 1.441 43.547 ↓ 8,385.0 8,385 1

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

49. 42.106 42.106 ↓ 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=13.693..42.106 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. 8.385 109.005 ↑ 1.0 1 8,385

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

51. 100.620 100.620 ↑ 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.012..0.012 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. 8.385 67.080 ↑ 1.0 1 8,385

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

53. 58.695 58.695 ↑ 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.007..0.007 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. 318.630 318.630 ↓ 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.038..0.038 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. 8.566 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. 25.698 25.698 ↓ 0.0 0 8,566

CTE Scan on get_response_choices (cost=0.00..700.00 rows=200 width=32) (actual time=0.003..0.003 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.044 121.503 ↓ 41.0 41 1

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

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

Initplan (forHash Join)

60. 0.008 0.009 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.009..0.009 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.000..0.001 rows=1 loops=1)

62. 0.006 0.007 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.007..0.007 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.020 0.132 ↑ 1,000.0 1 1

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

  • Group Key: COALESCE(rc_1.translated_response, rc_1.text_response)
65. 0.112 0.112 ↑ 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.111..0.112 rows=1 loops=1)

66. 0.196 121.311 ↓ 41.0 41 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
67. 1.810 121.115 ↓ 41.0 41 1

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

68. 1.057 18.730 ↓ 3,725.0 3,725 1

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

69. 0.006 0.008 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=16) (actual time=0.007..0.008 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.001..0.002 rows=1 loops=1)

71. 0.612 17.665 ↓ 3,725.0 3,725 1

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

72. 17.053 17.053 ↓ 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.050..17.053 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. 100.575 100.575 ↓ 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.027..0.027 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.791 74.916 ↓ 6.0 6 1

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

  • Group Key: team_ntfns.team_ntfn_uuid, team_ntfns.team_parent_ntfn_uuid
76. 2.247 74.125 ↓ 3,725.0 3,725 1

Sort (cost=7.14..7.14 rows=1 width=56) (actual time=73.879..74.125 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.521 71.878 ↓ 3,725.0 3,725 1

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

78. 2.423 71.357 ↓ 3,725.0 3,725 1

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

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

Sort (cost=7.09..7.09 rows=1 width=80) (actual time=68.215..68.934 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.555 65.248 ↓ 3,725.0 3,725 1

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

81. 4.197 64.693 ↓ 3,725.0 3,725 1

GroupAggregate (cost=7.03..7.07 rows=1 width=128) (actual time=59.594..64.693 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.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)

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.005 0.007 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.007..0.007 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.002..0.002 rows=1 loops=1)

87. 10.069 60.481 ↓ 8,607.0 8,607 1

Sort (cost=6.96..6.97 rows=1 width=96) (actual time=59.573..60.481 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. 2.793 50.412 ↓ 8,607.0 8,607 1

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

89. 4.584 4.584 ↓ 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.003..4.584 rows=8,607 loops=1)

90. 8.607 43.035 ↑ 1.0 1 8,607

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

91. 34.428 34.428 ↑ 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.004..0.004 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 75.154 ↑ 1.8 6 1

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

94. 0.000 75.100 ↓ 6.0 6 1

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

95.          

Initplan (forNested Loop)

96. 0.008 0.009 ↑ 1.0 1 1

Aggregate (cost=0.02..0.04 rows=1 width=8) (actual time=0.009..0.009 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.013 0.016 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=0.016..0.016 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.023 74.949 ↓ 6.0 6 1

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

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

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

102. 0.006 0.138 ↑ 1.0 1 6

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

103. 0.132 0.132 ↑ 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.022..0.022 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.047 ↓ 0.0 0 1

Nested Loop (cost=0.48..34.85 rows=1 width=74) (actual time=0.047..0.047 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.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)

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.000..0.001 rows=1 loops=1)

110. 0.006 0.006 ↑ 1.7 6 1

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

111. 0.000 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.036 0.036 ↓ 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.006..0.006 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 75.264 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.93..3.99 rows=1 width=168) (actual time=75.264..75.264 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 75.262 ↓ 0.0 0 1

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

  • Group Key: team_group.notification_uuid, team_group.recipient_uuid
119. 0.001 75.260 ↓ 0.0 0 1

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

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

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

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

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

122. 0.071 75.235 ↓ 0.0 0 1

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

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

CTE Scan on get_team_groups tg_2 (cost=0.00..0.25 rows=1 width=52) (actual time=75.164..75.164 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.298 122.899 ↓ 1,338.0 1,338 1

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

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

HashAggregate (cost=225.00..235.00 rows=1,000 width=64) (actual time=0.024..0.029 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.006..0.007 rows=1 loops=1)

130. 2.337 121.572 ↓ 1,338.0 1,338 1

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

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

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

132. 26.624 53.823 ↓ 1,164.0 1,164 1

GroupAggregate (cost=0.05..0.20 rows=1 width=136) (actual time=25.848..53.823 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. 8.222 27.199 ↓ 4,303.5 8,607 1

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

  • Sort Key: en_1.person_uuid
  • Sort Method: quicksort Memory: 1592kB
134. 18.977 18.977 ↓ 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.004..18.977 rows=8,607 loops=1)

135. 0.000 5.820 ↑ 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.004..0.005 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 57.036 ↑ 1.0 1 1,164

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

138. 3.492 55.872 ↑ 1.0 1 1,164

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

  • Sort Key: r.received DESC
  • Sort Method: quicksort Memory: 25kB
139. 52.380 52.380 ↑ 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.029..0.045 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.007 125.553 ↓ 10.0 10 1

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

142. 0.582 125.546 ↓ 10.0 10 1

Sort (cost=0.03..0.04 rows=1 width=200) (actual time=125.544..125.546 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. 124.964 124.964 ↓ 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=121.716..124.964 rows=1,338 loops=1)

144.          

CTE get_person_and_roles

145. 0.078 79.842 ↑ 2,322.7 9 1

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

146. 0.050 56.580 ↑ 2,322.7 9 1

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

147. 0.046 0.050 ↓ 10.0 10 1

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

  • Group Key: get_person_uuids_1.person_uuid
148. 0.004 0.004 ↓ 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=0.001..0.004 rows=10 loops=1)

149. 0.040 56.480 ↑ 1.0 1 10

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

150. 56.440 56.440 ↑ 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.573..5.644 rows=1 loops=10)

  • Index Cond: ((organization_uuid = 'fe857c89-72ec-4b77-ab22-96bd295ece2c'::uuid) AND (person_uuid = get_person_uuids_1.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
151. 0.603 23.184 ↑ 1.0 1 9

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

152. 0.234 22.581 ↑ 200.0 1 9

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

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

Bitmap Heap Scan on roles role (cost=1.96..35.14 rows=8 width=58) (actual time=0.053..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
154. 0.270 0.270 ↓ 1.5 35 9

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
156. 0.081 21.519 ↑ 200.0 1 9

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

157. 21.213 21.213 ↑ 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.354..2.357 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
158. 0.063 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)

159. 0.162 0.162 ↑ 100.0 1 9

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

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

161.          

CTE get_person_notifications

162. 0.033 957.550 ↓ 5.0 10 1

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

163. 1.923 957.517 ↓ 5.0 10 1

GroupAggregate (cost=185.41..280.51 rows=2 width=272) (actual time=956.012..957.517 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
164. 0.215 955.594 ↑ 64.7 28 1

Sort (cost=185.41..189.93 rows=1,811 width=326) (actual time=955.587..955.594 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
165. 0.201 955.379 ↑ 64.7 28 1

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

166. 1.564 911.582 ↓ 28.0 28 1

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

  • Hash Cond: (get_person_device_notifications.person_uuid = get_person_uuids_2.person_uuid)
167. 784.431 784.431 ↓ 4,303.5 8,607 1

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

168. 0.019 125.587 ↓ 10.0 10 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
169. 125.568 125.568 ↓ 10.0 10 1

CTE Scan on get_person_uuids get_person_uuids_2 (cost=0.00..0.02 rows=1 width=16) (actual time=125.553..125.568 rows=10 loops=1)

170. 0.084 43.596 ↑ 1.0 1 28

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

171. 43.512 43.512 ↑ 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.835..1.554 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
172.          

Initplan (forSort)

173. 0.095 0.340 ↑ 1.0 1 1

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

174. 0.245 0.245 ↓ 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.245 rows=1,338 loops=1)

175. 0.002 0.002 ↑ 1.0 1 1

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

176. 0.545 1,116.414 ↑ 20.9 10 1

Hash Right Join (cost=1,416.75..1,918.44 rows=209 width=256) (actual time=1,051.546..1,116.414 rows=10 loops=1)

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

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

178. 0.046 1,035.987 ↓ 5.0 10 1

Hash (cost=1,416.72..1,416.72 rows=2 width=264) (actual time=1,035.987..1,035.987 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
179. 0.026 1,035.941 ↓ 5.0 10 1

Merge Left Join (cost=354.40..1,416.72 rows=2 width=264) (actual time=1,033.528..1,035.941 rows=10 loops=1)

  • Merge Cond: (pn.person_uuid = get_person_uuids.person_uuid)
180. 0.015 1,035.862 ↓ 5.0 10 1

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

181. 0.023 960.567 ↓ 5.0 10 1

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

182. 0.028 960.384 ↓ 5.0 10 1

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

183. 1.416 959.176 ↓ 5.0 10 1

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

  • Group Key: pn.person_uuid, pn.event_uuid
184. 0.120 957.760 ↓ 5.0 10 1

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

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

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

186.          

SubPlan (forGroupAggregate)

187. 0.000 0.000 ↓ 0.0 0

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

188. 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
189. 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)))
190. 1.040 1.180 ↑ 1.0 1 10

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

191. 0.060 0.140 ↑ 3,333.3 3 10

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

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

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

194. 0.110 0.160 ↑ 1.0 1 10

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

195. 0.030 0.050 ↑ 10,000.0 1 10

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

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

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

198. 0.010 75.280 ↑ 1.0 1 10

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

199. 75.270 75.270 ↓ 0.0 0 10

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

  • Filter: (team_ntfn_uuids && (array_agg(pn.team_uuid)))
200. 0.044 0.053 ↓ 10.0 10 1

Sort (cost=0.03..0.04 rows=1 width=48) (actual time=0.050..0.053 rows=10 loops=1)

  • Sort Key: get_person_uuids.person_uuid
  • Sort Method: quicksort Memory: 25kB
201. 0.009 0.009 ↓ 10.0 10 1

CTE Scan on get_person_uuids (cost=0.00..0.02 rows=1 width=48) (actual time=0.005..0.009 rows=10 loops=1)

Planning time : 1,163.234 ms
Execution time : 1,131.594 ms