explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cen

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=160,003,635,597.25..160,003,635,599.21 rows=1 width=647) (actual rows= loops=)

  • Group Key: chwlist.branch_uuid, chwlist.branch_name, chwlist.supervisor_uuid, chwlist.supervisor_name, chwlist.chw_uuid, chwlist.chw_name, chwlist.chw_phone, chwlist.interval_number, (date(chwlist.interval_start))
  • Functions: 840
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
2.          

CTE fp

3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,014,283.98..10,000,014,620.56 rows=200 width=56) (actual rows= loops=)

  • Group Key: "*SELECT* 1_2".reported_by, 0
4. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,014,283.98..10,000,014,331.63 rows=19,062 width=80) (actual rows= loops=)

  • Sort Key: "*SELECT* 1_2".reported_by
5. 0.000 0.000 ↓ 0.0

Result (cost=0.00..12,928.82 rows=19,062 width=80) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Append (cost=0.00..12,738.20 rows=19,062 width=76) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_2 (cost=0.00..330.82 rows=154 width=78) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_registration (cost=0.00..329.28 rows=154 width=256) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
9. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_2 (cost=80.67..802.06 rows=1,028 width=78) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_person_fp_registration (cost=80.67..791.78 rows=1,028 width=256) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
  • Filter: (patient_age_in_years >= 15)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_useview_person_fp_registration_reported_chw_patient_id (cost=0.00..80.42 rows=1,199 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
12. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=383.71..11,510.01 rows=17,880 width=76) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_postnatal_care useview_postnatal_care_2 (cost=383.71..11,331.21 rows=17,880 width=254) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_postnatal_reported (cost=0.00..379.24 rows=17,880 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
15. 0.000 0.000 ↓ 0.0

Sort (cost=150,003,620,976.69..150,003,620,976.69 rows=3 width=1,983) (actual rows= loops=)

  • Sort Key: chwlist.branch_uuid, chwlist.branch_name, chwlist.supervisor_uuid, chwlist.supervisor_name, chwlist.chw_uuid, chwlist.chw_name, chwlist.chw_phone, chwlist.interval_number, (date(chwlist.interval_start))
16. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=140,003,465,824.93..140,003,620,976.66 rows=3 width=1,983) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = fp_fu_ke.chw_uuid) AND (chwlist.interval_number = fp_fu_ke.interval_number))
17. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=130,003,451,561.44..130,003,603,951.98 rows=3 width=1,931) (actual rows= loops=)

  • Hash Cond: ((chwlist.chw_uuid = home_visits.chw_uuid) AND (chwlist.interval_number = home_visits.interval_number))
18. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=120,003,351,378.21..120,003,503,768.75 rows=3 width=1,923) (actual rows= loops=)

  • Hash Cond: ((chwlist.chw_uuid = infant_deaths.chw_uuid) AND (chwlist.interval_number = infant_deaths.interval_number))
19. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=120,003,351,064.29..120,003,503,454.81 rows=3 width=1,907) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = maternal_deaths.chw_uuid) AND (chwlist.interval_number = maternal_deaths.interval_number))
20. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=110,003,300,140.43..110,003,452,530.81 rows=3 width=1,899) (actual rows= loops=)

  • Hash Cond: ((chwlist.chw_uuid = fp.chw_uuid) AND (chwlist.interval_number = fp.interval_number))
21. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=110,003,300,133.43..110,003,452,523.63 rows=3 width=1,883) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = assessed.chw_uuid) AND (chwlist.interval_number = assessed.interval_number))
22. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=100,003,216,907.97..100,003,369,283.17 rows=3 width=1,843) (actual rows= loops=)

  • Hash Cond: ((chwlist.chw_area_uuid = population_all_time.chw_area_uuid) AND (chwlist.interval_number = population_all_time.interval_number))
23. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=100,003,156,292.28..100,003,308,667.46 rows=3 width=1,871) (actual rows= loops=)

  • Hash Cond: ((chwlist.chw_uuid = sync.chw_uuid) AND (chwlist.interval_number = sync.interval_number))
24. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=100,002,986,962.86..100,003,139,338.03 rows=3 width=1,863) (actual rows= loops=)

  • Hash Cond: ((contactview_metadata.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
25. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.43..150,073.36 rows=131,555 width=48) (actual rows= loops=)

  • Group Key: contactview_metadata.parent_uuid, 0
26. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_parent_uuid on contactview_metadata (cost=0.43..146,957.93 rows=239,984 width=40) (actual rows= loops=)

  • Filter: (type = 'clinic'::text)
27. 0.000 0.000 ↓ 0.0

Hash (cost=100,002,986,962.42..100,002,986,962.42 rows=1 width=1,819) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=100,002,976,349.29..100,002,986,962.42 rows=1 width=1,819) (actual rows= loops=)

  • Join Filter: (chwlist.interval_number = 0)
29. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=100,002,976,349.01..100,002,978,220.57 rows=1 width=1,815) (actual rows= loops=)

  • Hash Cond: ((useview_households_visited.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
30. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,036,354.04..10,000,038,166.08 rows=2,164 width=48) (actual rows= loops=)

  • Group Key: useview_households_visited.chw, 0
31. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,036,354.04..10,000,036,801.64 rows=179,040 width=76) (actual rows= loops=)

  • Sort Key: useview_households_visited.chw
32. 0.000 0.000 ↓ 0.0

Index Only Scan using households_date_visited_chw_hh on useview_households_visited (cost=0.57..12,777.37 rows=179,040 width=76) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
33. 0.000 0.000 ↓ 0.0

Hash (cost=90,002,939,994.96..90,002,939,994.96 rows=1 width=1,807) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=90,002,939,038.59..90,002,939,994.96 rows=1 width=1,807) (actual rows= loops=)

  • Hash Cond: ((survey.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
35. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,032,640.58..10,000,033,559.39 rows=2,146 width=64) (actual rows= loops=)

  • Group Key: survey.chw, 0
36. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,032,640.58..10,000,032,740.29 rows=39,882 width=88) (actual rows= loops=)

  • Sort Key: survey.chw
37. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_family_survey survey (cost=1,725.23..27,681.91 rows=39,882 width=88) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
38. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_family_survey_uuid_reported_chw (cost=0.00..1,715.26 rows=39,882 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
39. 0.000 0.000 ↓ 0.0

Hash (cost=80,002,906,397.99..80,002,906,397.99 rows=1 width=1,783) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,002,906,315.33..80,002,906,397.99 rows=1 width=1,783) (actual rows= loops=)

  • Hash Cond: ((population.chp_area_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
41. 0.000 0.000 ↓ 0.0

HashAggregate (cost=39,302.00..39,324.04 rows=2,204 width=152) (actual rows= loops=)

  • Group Key: population.chp_area_uuid, 0
42. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_population_demographics population (cost=360.92..33,202.21 rows=16,827 width=86) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
43. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_population_demographics_reported_idx (cost=0.00..356.71 rows=16,827 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
44. 0.000 0.000 ↓ 0.0

Hash (cost=80,002,867,013.32..80,002,867,013.32 rows=1 width=1,671) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,002,866,948.02..80,002,867,013.32 rows=1 width=1,671) (actual rows= loops=)

  • Hash Cond: ((meta.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
46. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,101.85..4,125.59 rows=2,374 width=48) (actual rows= loops=)

  • Group Key: meta.chw, 0
47. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata meta (cost=0.43..4,031.98 rows=9,317 width=76) (actual rows= loops=)

  • Index Cond: (formname = 'community_event'::text)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
48. 0.000 0.000 ↓ 0.0

Hash (cost=80,002,862,846.15..80,002,862,846.15 rows=1 width=1,663) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,002,862,787.40..80,002,862,846.15 rows=1 width=1,663) (actual rows= loops=)

  • Hash Cond: ((assess.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
50. 0.000 0.000 ↓ 0.0

HashAggregate (cost=78,766.00..78,787.36 rows=2,136 width=48) (actual rows= loops=)

  • Group Key: assess.chw, 0
51. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8,366.17..78,741.45 rows=3,273 width=77) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_assessment assess (cost=8,365.74..39,308.30 rows=14,103 width=81) (actual rows= loops=)

  • Recheck Cond: ((referral_follow_up = 'true'::text) AND (reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone) AND (patient_age_in_years < 5))
53. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=8,365.74..8,365.74 rows=14,103 width=0) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_assessment_referral_follow_up (cost=0.00..3,234.71 rows=174,705 width=0) (actual rows= loops=)

  • Index Cond: (referral_follow_up = 'true'::text)
55. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_assessment_reported_age_uuid (cost=0.00..5,123.73 rows=82,354 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone) AND (patient_age_in_years < 5))
56. 0.000 0.000 ↓ 0.0

Index Only Scan using useview_assessment_follow_up_source_date_uuid on useview_assessment_follow_up follow_up (cost=0.42..2.79 rows=1 width=45) (actual rows= loops=)

  • Index Cond: (form_source_id = assess.uuid)
  • Filter: ((date(date_trunc('day'::text, reported)) - date(date_trunc('day'::text, assess.reported))) <= 2)
57. 0.000 0.000 ↓ 0.0

Hash (cost=80,002,784,021.39..80,002,784,021.39 rows=1 width=1,655) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,002,772,551.59..80,002,784,021.39 rows=1 width=1,655) (actual rows= loops=)

  • Hash Cond: ((chwview_assessment.chw_uuid = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
59. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,051,679.88..10,000,063,090.85 rows=2,139 width=1,292) (actual rows= loops=)

  • Group Key: chwview_assessment.chw_uuid, 0
60. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,051,679.88..10,000,051,939.66 rows=103,910 width=352) (actual rows= loops=)

  • Sort Key: chwview_assessment.chw_uuid
61. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on chwview_assessment (cost=4,489.52..26,326.60 rows=103,910 width=352) (actual rows= loops=)

  • Recheck Cond: ((reported_day >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported_day < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
62. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on chwview_assessment_reported_chw_uuid (cost=0.00..4,463.54 rows=103,910 width=0) (actual rows= loops=)

  • Index Cond: ((reported_day >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported_day < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
63. 0.000 0.000 ↓ 0.0

Hash (cost=70,002,720,871.70..70,002,720,871.70 rows=1 width=403) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=70,002,720,758.18..70,002,720,871.70 rows=1 width=403) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = p.chw) AND (chwlist.interval_number = (0)))
65. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=50,002,679,032.51..50,002,679,139.03 rows=1 width=395) (actual rows= loops=)

  • Hash Cond: ((contactview_metadata_1.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
66. 0.000 0.000 ↓ 0.0

HashAggregate (cost=16,629.53..16,668.26 rows=3,873 width=48) (actual rows= loops=)

  • Group Key: contactview_metadata_1.parent_uuid, 0
67. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_type on contactview_metadata contactview_metadata_1 (cost=0.43..16,600.18 rows=3,913 width=76) (actual rows= loops=)

  • Index Cond: (type = 'clinic'::text)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
68. 0.000 0.000 ↓ 0.0

Hash (cost=50,002,662,402.97..50,002,662,402.97 rows=1 width=387) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=50,002,662,314.25..50,002,662,402.97 rows=1 width=387) (actual rows= loops=)

  • Hash Cond: ((pmb.chw_uuid = chwlist.chw_uuid) AND (pmb.interval_number = chwlist.interval_number))
70. 0.000 0.000 ↓ 0.0

HashAggregate (cost=30,002,641,593.11..30,002,641,630.07 rows=2,957 width=88) (actual rows= loops=)

  • Group Key: pmb.chw_uuid, pmb.interval_number
71.          

CTE u1s

72. 0.000 0.000 ↓ 0.0

HashAggregate (cost=33,507.90..33,563.99 rows=5,609 width=81) (actual rows= loops=)

  • Group Key: useview_population_demographics.family_uuid, useview_population_demographics.uuid, useview_population_demographics.date_of_birth, 0
73. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_population_demographics (cost=358.11..33,451.81 rows=5,609 width=81) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
  • Filter: ((date_part('years'::text, age(now(), (date_of_birth)::timestamp with time zone)))::integer <= 1)
74. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_population_demographics_reported_idx (cost=0.00..356.71 rows=16,827 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
75. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=30,002,511,940.23..30,002,606,846.28 rows=29,571 width=100) (actual rows= loops=)

  • Group Key: pmb.chw_uuid, pmb.baby_uuid, pmb.interval_number
76. 0.000 0.000 ↓ 0.0

Sort (cost=30,002,511,940.23..30,002,525,455.99 rows=5,406,305 width=183) (actual rows= loops=)

  • Sort Key: pmb.chw_uuid, pmb.baby_uuid, pmb.interval_number
77. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=20,000,191,677.92..20,000,466,012.42 rows=5,406,305 width=183) (actual rows= loops=)

  • Hash Cond: (pmb.baby_uuid = u1fu.patient_id)
78. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=20,000,190,458.45..20,000,385,724.97 rows=2,222,660 width=146) (actual rows= loops=)

  • Hash Cond: (pmb.mother_uuid = pv.patient_id)
79. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=20,000,179,596.89..20,000,254,155.45 rows=609,116 width=145) (actual rows= loops=)

  • Hash Cond: (pmb.mother_uuid = pc.patient_id)
80. 0.000 0.000 ↓ 0.0

Subquery Scan on pmb (cost=20,000,169,011.11..20,000,177,143.02 rows=295,706 width=108) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Group (cost=20,000,169,011.11..20,000,174,185.96 rows=295,706 width=176) (actual rows= loops=)

  • Group Key: pnc.chw, u1s.family_uuid, (string_agg(DISTINCT pd.uuid, ','::text)), pnc.patient_id, u1s.uuid, u1s.interval_number
82. 0.000 0.000 ↓ 0.0

Sort (cost=20,000,169,011.11..20,000,169,750.37 rows=295,706 width=172) (actual rows= loops=)

  • Sort Key: pnc.chw, u1s.family_uuid, (string_agg(DISTINCT pd.uuid, ','::text)), u1s.uuid, u1s.interval_number
83. 0.000 0.000 ↓ 0.0

Hash Join (cost=10,000,078,233.97..10,000,116,870.60 rows=295,706 width=172) (actual rows= loops=)

  • Hash Cond: (pd.family_uuid = u1s.family_uuid)
84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,000,078,051.68..10,000,106,310.90 rows=10,544 width=141) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,078,051.26..10,000,078,153.64 rows=5,119 width=69) (actual rows= loops=)

  • Group Key: pd.family_uuid
86. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,078,051.26..10,000,078,064.06 rows=5,119 width=73) (actual rows= loops=)

  • Sort Key: pd.family_uuid
87. 0.000 0.000 ↓ 0.0

Hash Join (cost=74,803.83..77,735.89 rows=5,119 width=73) (actual rows= loops=)

  • Hash Cond: (u1s_1.family_uuid = pd.family_uuid)
88. 0.000 0.000 ↓ 0.0

CTE Scan on u1s u1s_1 (cost=0.00..112.18 rows=5,609 width=32) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Hash (cost=70,313.10..70,313.10 rows=178,219 width=73) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Seq Scan on useview_population_demographics pd (cost=0.00..70,313.10 rows=178,219 width=73) (actual rows= loops=)

  • Filter: ((sex = 'female'::text) AND ((date_part('years'::text, age(now(), (date_of_birth)::timestamp with time zone)))::integer >= 15))
91. 0.000 0.000 ↓ 0.0

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pnc (cost=0.42..5.47 rows=2 width=72) (actual rows= loops=)

  • Index Cond: (patient_id = (string_agg(DISTINCT pd.uuid, ','::text)))
92. 0.000 0.000 ↓ 0.0

Hash (cost=112.18..112.18 rows=5,609 width=68) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

CTE Scan on u1s (cost=0.00..112.18 rows=5,609 width=68) (actual rows= loops=)

94. 0.000 0.000 ↓ 0.0

Hash (cost=7,164.68..7,164.68 rows=135,768 width=73) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Seq Scan on useview_postnatal_care pc (cost=0.00..7,164.68 rows=135,768 width=73) (actual rows= loops=)

96. 0.000 0.000 ↓ 0.0

Hash (cost=6,378.36..6,378.36 rows=177,936 width=73) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

Seq Scan on useview_pregnancy_visit pv (cost=0.00..6,378.36 rows=177,936 width=73) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Hash (cost=998.10..998.10 rows=17,710 width=74) (actual rows= loops=)

99. 0.000 0.000 ↓ 0.0

Seq Scan on useview_u1_follow_up u1fu (cost=0.00..998.10 rows=17,710 width=74) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,020,721.13..20,000,020,721.13 rows=1 width=339) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,020,662.27..20,000,020,721.13 rows=1 width=339) (actual rows= loops=)

  • Hash Cond: ((anc.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
102. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,504.36..10,525.76 rows=2,140 width=48) (actual rows= loops=)

  • Group Key: anc.chw, 0
103. 0.000 0.000 ↓ 0.0

Seq Scan on useview_pregnancy_visit anc (cost=0.00..10,381.92 rows=16,325 width=40) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
104. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,010,157.89..20,000,010,157.89 rows=1 width=331) (actual rows= loops=)

105. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,010,102.33..20,000,010,157.89 rows=1 width=331) (actual rows= loops=)

  • Hash Cond: ((pnc_1.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
106. 0.000 0.000 ↓ 0.0

HashAggregate (cost=7,366.09..7,386.29 rows=2,020 width=136) (actual rows= loops=)

  • Group Key: pnc_1.chw, 0
107. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_postnatal_care pnc_1 (cost=325.72..6,617.03 rows=6,375 width=101) (actual rows= loops=)

  • Recheck Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
108. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_postnatal_care_count_reported_uuid (cost=0.00..324.13 rows=6,375 width=0) (actual rows= loops=)

  • Index Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
109. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,002,736.22..20,000,002,736.22 rows=1 width=235) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,002,683.69..20,000,002,736.22 rows=1 width=235) (actual rows= loops=)

  • Hash Cond: ((useview_pregnancy.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
111. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,463.95..2,483.05 rows=1,910 width=56) (actual rows= loops=)

  • Group Key: useview_pregnancy.chw, 0
112. 0.000 0.000 ↓ 0.0

Index Scan using useview_pregnancy_reported on useview_pregnancy (cost=0.31..2,376.11 rows=4,392 width=78) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
113. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,000,219.72..20,000,000,219.72 rows=1 width=219) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Subquery Scan on chwlist (cost=20,000,000,219.23..20,000,000,219.72 rows=1 width=219) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=20,000,000,219.23..20,000,000,219.71 rows=1 width=219) (actual rows= loops=)

  • Hash Cond: (chp_1.uuid = chp_muting.chw)
116. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,000,199.87..20,000,000,200.07 rows=20 width=219) (actual rows= loops=)

  • Group Key: cmd.uuid, cmd.name, chp_1.supervisor_uuid, chp_1.area_uuid, cmeta.name, chp_1.uuid, chp_1.name, chp_1.phone, (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone)), (0)
117. 0.000 0.000 ↓ 0.0

Hash Join (cost=20,000,000,162.92..20,000,000,199.37 rows=20 width=219) (actual rows= loops=)

  • Hash Cond: ((row_number() OVER (?)) = (row_number() OVER (?)))
118. 0.000 0.000 ↓ 0.0

WindowAgg (cost=10,000,000,059.84..10,000,000,082.34 rows=1,000 width=24) (actual rows= loops=)

119. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,000,059.84..10,000,000,062.34 rows=1,000 width=8) (actual rows= loops=)

  • Sort Key: generate_series.generate_series
120. 0.000 0.000 ↓ 0.0

Function Scan on generate_series (cost=0.01..10.01 rows=1,000 width=8) (actual rows= loops=)

121. 0.000 0.000 ↓ 0.0

Hash (cost=10,000,000,103.03..10,000,000,103.03 rows=4 width=219) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,000,000,010.60..10,000,000,103.03 rows=4 width=219) (actual rows= loops=)

123. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.49..102.77 rows=1 width=207) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.06..95.02 rows=1 width=191) (actual rows= loops=)

125. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_type on contactview_metadata cmd (cost=0.43..4.45 rows=1 width=52) (actual rows= loops=)

  • Index Cond: (type = 'district_hospital'::text)
126. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on contactview_chp chp_1 (cost=9.64..88.82 rows=175 width=172) (actual rows= loops=)

  • Recheck Cond: (branch_uuid = cmd.uuid)
127. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on contactview_chp_branch_uuid (cost=0.00..9.59 rows=175 width=0) (actual rows= loops=)

  • Index Cond: (branch_uuid = cmd.uuid)
128. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_uuid on contactview_metadata cmeta (cost=0.43..7.75 rows=1 width=52) (actual rows= loops=)

  • Index Cond: (uuid = chp_1.supervisor_uuid)
129. 0.000 0.000 ↓ 0.0

WindowAgg (cost=10,000,000,000.11..10,000,000,000.18 rows=4 width=16) (actual rows= loops=)

130. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,000,000.11..10,000,000,000.12 rows=4 width=4) (actual rows= loops=)

  • Sort Key: generate_series_1.generate_series
131. 0.000 0.000 ↓ 0.0

Function Scan on generate_series generate_series_1 (cost=0.03..0.07 rows=4 width=4) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Hash (cost=11.94..11.94 rows=594 width=37) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Seq Scan on chp_muting (cost=0.00..11.94 rows=594 width=37) (actual rows= loops=)

134. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,041,725.67..20,000,041,727.67 rows=200 width=48) (actual rows= loops=)

  • Group Key: p.chw, 0
135. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=20,000,040,511.80..20,000,040,896.38 rows=110,572 width=76) (actual rows= loops=)

  • Hash Cond: (p.patient_id = useview_postnatal_care.patient_id)
  • Filter: (((max(useview_postnatal_care.reported)) IS NULL) OR ((@ ((CASE WHEN (max(useview_pregnancy_visit.new_edd) <> ''::text) THEN (max(useview_pregnancy_visit.new_edd))::date ELSE max(p.edd) END) - ((max(useview_postnatal_care.reported)))::date)) > 60))
136. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,031,487.33..20,000,031,850.66 rows=1,670 width=76) (actual rows= loops=)

  • Group Key: p.chw, p.patient_id
  • Filter: ((max(p.edd) >= date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone)) AND CASE WHEN (date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) = date_trunc('day'::text, now())) THEN (max(p.edd) <= '2019-10-29 00:00:00'::timestamp without time zone) ELSE (max(p.edd) <= '2019-11-02 00:00:00'::timestamp without time zone) END)
137. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=20,000,017,956.37..20,000,031,286.87 rows=10,023 width=78) (actual rows= loops=)

  • Merge Cond: (p.patient_id = useview_pregnancy_visit_1.patient_id)
138. 0.000 0.000 ↓ 0.0

Merge Join (cost=10,000,011,561.97..10,000,024,613.89 rows=12,742 width=78) (actual rows= loops=)

  • Merge Cond: (useview_pregnancy_visit.patient_id = p.patient_id)
  • Join Filter: (p.reported < useview_pregnancy_visit.reported)
139. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,011,561.56..10,000,011,834.41 rows=35,950 width=47) (actual rows= loops=)

140. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,011,561.56..10,000,011,697.98 rows=54,570 width=47) (actual rows= loops=)

  • Sort Key: useview_pregnancy_visit.patient_id, useview_pregnancy_visit.reported DESC
141. 0.000 0.000 ↓ 0.0

Seq Scan on useview_pregnancy_visit (cost=0.00..7,268.04 rows=54,570 width=47) (actual rows= loops=)

  • Filter: (((edd_updated IS TRUE) AND (reported > '2018-11-01 00:00:00'::timestamp without time zone)) OR (reported > '2019-02-01 00:00:00'::timestamp without time zone))
142. 0.000 0.000 ↓ 0.0

Index Scan using useview_pregnancy_patient_id on useview_pregnancy p (cost=0.41..11,700.62 rows=60,660 width=84) (actual rows= loops=)

143. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,006,394.39..10,000,006,461.74 rows=12,175 width=44) (actual rows= loops=)

144. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,006,394.39..10,000,006,428.07 rows=13,470 width=44) (actual rows= loops=)

  • Sort Key: useview_pregnancy_visit_1.patient_id, useview_pregnancy_visit_1.reported DESC
145. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_pregnancy_visit useview_pregnancy_visit_1 (cost=485.03..5,470.52 rows=13,470 width=44) (actual rows= loops=)

  • Filter: ((continue_follow_up IS FALSE) AND ((reported > '2018-11-01 00:00:00'::timestamp without time zone) OR (reported > '2019-02-01 00:00:00'::timestamp without time zone)))
146. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_pregnancy_visit_continue_follow_up (cost=0.00..481.67 rows=25,766 width=0) (actual rows= loops=)

  • Index Cond: (continue_follow_up = false)
147. 0.000 0.000 ↓ 0.0

Hash (cost=8,532.81..8,532.81 rows=39,333 width=44) (actual rows= loops=)

148. 0.000 0.000 ↓ 0.0

HashAggregate (cost=7,746.15..8,139.48 rows=39,333 width=44) (actual rows= loops=)

  • Group Key: useview_postnatal_care.patient_id
149. 0.000 0.000 ↓ 0.0

Seq Scan on useview_postnatal_care (cost=0.00..7,504.10 rows=48,409 width=44) (actual rows= loops=)

  • Filter: (follow_up_count = '1'::text)
150. 0.000 0.000 ↓ 0.0

Index Only Scan using contactview_chp_uuid on contactview_chp chp (cost=0.28..8,741.84 rows=1 width=40) (actual rows= loops=)

  • Index Cond: (uuid = chwlist.chw_uuid)
151.          

SubPlan (for Index Only Scan)

152. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.56..6,736.91 rows=20 width=0) (actual rows= loops=)

  • Join Filter: (meta_1.formname = "*VALUES*".column1)
153. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_chw on form_metadata meta_1 (cost=0.56..6,723.23 rows=303 width=15) (actual rows= loops=)

  • Index Cond: (chw = chp.uuid)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
154. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..0.05 rows=3 width=32) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

Values Scan on "*VALUES*" (cost=0.00..0.04 rows=3 width=32) (actual rows= loops=)

156. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.47..36,749.30 rows=47,868 width=36) (actual rows= loops=)

157. 0.000 0.000 ↓ 0.0

HashAggregate (cost=0.05..0.08 rows=3 width=32) (actual rows= loops=)

  • Group Key: "*VALUES*_1".column1
158. 0.000 0.000 ↓ 0.0

Values Scan on "*VALUES*_1" (cost=0.00..0.04 rows=3 width=32) (actual rows= loops=)

159. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata meta_2 (cost=0.43..12,090.18 rows=15,956 width=51) (actual rows= loops=)

  • Index Cond: (formname = "*VALUES*_1".column1)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
160. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.99..34.56 rows=12 width=0) (actual rows= loops=)

161. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.71..26.24 rows=1 width=1,401) (actual rows= loops=)

162. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.28..17.77 rows=1 width=36) (actual rows= loops=)

  • Join Filter: (chw.parent_uuid = cmd_1.parent_uuid)
163. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..16.89 rows=1 width=108) (actual rows= loops=)

164. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_uuid on contactview_metadata chw (cost=0.43..8.45 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (uuid = chp.uuid)
165. 0.000 0.000 ↓ 0.0

Index Only Scan using contactview_metadata_uuid on contactview_metadata chwarea (cost=0.43..8.45 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (uuid = chw.parent_uuid)
166. 0.000 0.000 ↓ 0.0

Index Scan using contactview_metadata_parent_uuid on contactview_metadata cmd_1 (cost=0.43..0.87 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (parent_uuid = chwarea.uuid)
  • Filter: ((type = 'clinic'::text) AND (reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
167. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx8 on pat_person (cost=0.42..8.46 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> '_id'::text) = chp.uuid)
  • Filter: (((doc ->> 'type'::text) = 'person'::text) AND ((doc ->> 'type'::text) = ANY ('{contact,clinic,district_hospital,health_center,person}'::text[])))
168. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx8 on pat_health_center (cost=0.28..8.31 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> '_id'::text) = (pat_person.doc #>> '{parent,_id}'::text[]))
  • Filter: (((doc ->> 'type'::text) = 'health_center'::text) AND ((doc ->> 'type'::text) = ANY ('{contact,clinic,district_hospital,health_center,person}'::text[])))
169. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.53..8,395.46 rows=1 width=0) (actual rows= loops=)

170. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.98..6,924.21 rows=690 width=73) (actual rows= loops=)

171. 0.000 0.000 ↓ 0.0

Append (cost=0.42..3,799.45 rows=690 width=37) (actual rows= loops=)

172. 0.000 0.000 ↓ 0.0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form_36 (cost=0.42..8.44 rows=1 width=1,032) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
173. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_postnatal_care form_37 (cost=0.00..3,720.18 rows=679 width=25) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
174. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_38 (cost=0.00..1.28 rows=1 width=432) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
175. 0.000 0.000 ↓ 0.0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_39 (cost=0.29..8.31 rows=1 width=654) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
176. 0.000 0.000 ↓ 0.0

Index Scan using pat_form_expr_idx9 on pat_form form_40 (cost=0.14..8.16 rows=1 width=638) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
177. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_41 (cost=0.28..8.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
178. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_42 (cost=0.43..8.46 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
179. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_43 (cost=0.00..1.02 rows=1 width=849) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
180. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx9 on pat_person form_44 (cost=0.42..8.45 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
181. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_45 (cost=0.28..8.30 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
182. 0.000 0.000 ↓ 0.0

Seq Scan on pat_usage_stats form_46 (cost=0.00..6.80 rows=1 width=1,075) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
183. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_47 (cost=0.28..8.31 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
184. 0.000 0.000 ↓ 0.0

Index Only Scan using form_metadata_uuid on form_metadata fm (cost=0.56..4.53 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (uuid = (form_36.doc ->> '_id'::text))
185. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_uuid on form_metadata meta_3 (cost=0.56..2.13 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (uuid = fm.uuid)
  • Filter: ((chw = chp.uuid) AND (reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
186. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.53..8,393.73 rows=125 width=36) (actual rows= loops=)

187. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.98..6,924.21 rows=690 width=73) (actual rows= loops=)

188. 0.000 0.000 ↓ 0.0

Append (cost=0.42..3,799.45 rows=690 width=37) (actual rows= loops=)

189. 0.000 0.000 ↓ 0.0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form_48 (cost=0.42..8.44 rows=1 width=1,032) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
190. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_postnatal_care form_49 (cost=0.00..3,720.18 rows=679 width=25) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
191. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_50 (cost=0.00..1.28 rows=1 width=432) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
192. 0.000 0.000 ↓ 0.0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_51 (cost=0.29..8.31 rows=1 width=654) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
193. 0.000 0.000 ↓ 0.0

Index Scan using pat_form_expr_idx9 on pat_form form_52 (cost=0.14..8.16 rows=1 width=638) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
194. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_53 (cost=0.28..8.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
195. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_54 (cost=0.43..8.46 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
196. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_55 (cost=0.00..1.02 rows=1 width=849) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
197. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx9 on pat_person form_56 (cost=0.42..8.45 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
198. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_57 (cost=0.28..8.30 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
199. 0.000 0.000 ↓ 0.0

Seq Scan on pat_usage_stats form_58 (cost=0.00..6.80 rows=1 width=1,075) (actual rows= loops=)

  • Filter: (((doc ->> 'form'::text) = 'postnatal_care'::text) AND ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text))
200. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_59 (cost=0.28..8.31 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'postnatal_care'::text)
  • Filter: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
201. 0.000 0.000 ↓ 0.0

Index Only Scan using form_metadata_uuid on form_metadata fm_1 (cost=0.56..4.53 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (uuid = (form_48.doc ->> '_id'::text))
202. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_uuid on form_metadata meta_4 (cost=0.56..2.13 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (uuid = fm_1.uuid)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
203. 0.000 0.000 ↓ 0.0

Hash (cost=169,292.89..169,292.89 rows=2,435 width=48) (actual rows= loops=)

204. 0.000 0.000 ↓ 0.0

Subquery Scan on sync (cost=169,219.84..169,292.89 rows=2,435 width=48) (actual rows= loops=)

205. 0.000 0.000 ↓ 0.0

HashAggregate (cost=169,219.84..169,268.54 rows=2,435 width=48) (actual rows= loops=)

  • Group Key: useview_chp_sync.chw_uuid, 0
206. 0.000 0.000 ↓ 0.0

Seq Scan on useview_chp_sync (cost=0.00..129,226.05 rows=5,332,505 width=48) (actual rows= loops=)

207. 0.000 0.000 ↓ 0.0

Hash (cost=60,582.62..60,582.62 rows=2,205 width=48) (actual rows= loops=)

208. 0.000 0.000 ↓ 0.0

Subquery Scan on population_all_time (cost=60,538.51..60,582.62 rows=2,205 width=48) (actual rows= loops=)

209. 0.000 0.000 ↓ 0.0

HashAggregate (cost=60,538.51..60,560.57 rows=2,205 width=48) (actual rows= loops=)

  • Group Key: population_1.chp_area_uuid, 0
210. 0.000 0.000 ↓ 0.0

Seq Scan on useview_population_demographics population_1 (cost=0.00..53,207.58 rows=977,458 width=76) (actual rows= loops=)

211. 0.000 0.000 ↓ 0.0

Materialize (cost=10,000,083,225.46..10,000,083,230.46 rows=200 width=80) (actual rows= loops=)

212. 0.000 0.000 ↓ 0.0

Subquery Scan on assessed (cost=10,000,083,225.46..10,000,083,229.46 rows=200 width=80) (actual rows= loops=)

213. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,000,083,225.46..10,000,083,227.46 rows=200 width=80) (actual rows= loops=)

  • Group Key: assess_u1fu_pnc_aggregated.chw, 0
214. 0.000 0.000 ↓ 0.0

Subquery Scan on assess_u1fu_pnc_aggregated (cost=10,000,082,655.04..10,000,083,210.46 rows=200 width=96) (actual rows= loops=)

215. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,082,655.04..10,000,083,208.46 rows=200 width=100) (actual rows= loops=)

216. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,082,655.04..10,000,082,931.75 rows=110,684 width=100) (actual rows= loops=)

  • Sort Key: useview_assessment.patient_id, useview_assessment.reported DESC
217. 0.000 0.000 ↓ 0.0

Append (cost=2,173.46..67,326.89 rows=110,684 width=100) (actual rows= loops=)

218. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_assessment (cost=2,173.46..53,092.61 rows=102,343 width=94) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
219. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_assessment_reported (cost=0.00..2,147.87 rows=102,343 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
220. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_u1_follow_up (cost=156.71..1,067.00 rows=2,381 width=161) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
221. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_u1_follow_up_reported_chw_uuid (cost=0.00..156.12 rows=2,381 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
222. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_postnatal_care useview_postnatal_care_1 (cost=380.73..11,507.03 rows=5,960 width=185) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
  • Filter: is_date((date_of_birth)::character varying)
223. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_postnatal_reported (cost=0.00..379.24 rows=17,880 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
224. 0.000 0.000 ↓ 0.0

Hash (cost=4.00..4.00 rows=200 width=52) (actual rows= loops=)

225. 0.000 0.000 ↓ 0.0

CTE Scan on fp (cost=0.00..4.00 rows=200 width=52) (actual rows= loops=)

226. 0.000 0.000 ↓ 0.0

Materialize (cost=10,000,050,923.86..10,000,050,923.91 rows=2 width=48) (actual rows= loops=)

227. 0.000 0.000 ↓ 0.0

Subquery Scan on maternal_deaths (cost=10,000,050,923.86..10,000,050,923.90 rows=2 width=48) (actual rows= loops=)

228. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,000,050,923.86..10,000,050,923.88 rows=2 width=48) (actual rows= loops=)

  • Group Key: "*SELECT* 1".chw_uuid, 0
229. 0.000 0.000 ↓ 0.0

Result (cost=10,000,008,007.04..10,000,050,923.85 rows=2 width=40) (actual rows= loops=)

230. 0.000 0.000 ↓ 0.0

Append (cost=10,000,008,007.04..10,000,050,923.83 rows=2 width=36) (actual rows= loops=)

231. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=10,000,008,007.04..10,000,008,007.19 rows=1 width=36) (actual rows= loops=)

  • Filter: (("*SELECT* 1".reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND ("*SELECT* 1".reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
232. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,008,007.04..10,000,008,007.06 rows=4 width=80) (actual rows= loops=)

233. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,008,007.04..10,000,008,007.05 rows=4 width=80) (actual rows= loops=)

  • Sort Key: pv_1.patient_id
234. 0.000 0.000 ↓ 0.0

Hash Join (cost=294.53..8,007.00 rows=4 width=80) (actual rows= loops=)

  • Hash Cond: (pv_1.patient_id = (form.doc #>> '{fields,inputs,contact,_id}'::text[]))
235. 0.000 0.000 ↓ 0.0

Seq Scan on useview_pregnancy_visit pv_1 (cost=0.00..6,823.20 rows=177,846 width=36) (actual rows= loops=)

  • Filter: (patient_id <> ''::text)
236. 0.000 0.000 ↓ 0.0

Hash (cost=294.52..294.52 rows=1 width=1,626) (actual rows= loops=)

237. 0.000 0.000 ↓ 0.0

Hash Join (cost=58.74..294.52 rows=1 width=1,626) (actual rows= loops=)

  • Hash Cond: ((form.doc ->> '_id'::text) = dr.uuid)
238. 0.000 0.000 ↓ 0.0

Append (cost=0.42..234.40 rows=653 width=1,582) (actual rows= loops=)

239. 0.000 0.000 ↓ 0.0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form (cost=0.42..8.44 rows=1 width=1,032) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
240. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_death_report form_1 (cost=0.00..155.63 rows=642 width=1,595) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
241. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_2 (cost=0.00..1.21 rows=1 width=432) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
242. 0.000 0.000 ↓ 0.0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_3 (cost=0.29..8.31 rows=1 width=654) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
243. 0.000 0.000 ↓ 0.0

Index Scan using pat_form_expr_idx9 on pat_form form_4 (cost=0.14..8.16 rows=1 width=638) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
244. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_5 (cost=0.28..8.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
245. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_6 (cost=0.43..8.45 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
246. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_7 (cost=0.00..1.01 rows=1 width=849) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
247. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx9 on pat_person form_8 (cost=0.42..8.44 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
248. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_9 (cost=0.28..8.29 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
249. 0.000 0.000 ↓ 0.0

Seq Scan on pat_usage_stats form_10 (cost=0.00..6.60 rows=1 width=1,075) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
250. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_11 (cost=0.28..8.30 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
251. 0.000 0.000 ↓ 0.0

Hash (cost=48.88..48.88 rows=755 width=80) (actual rows= loops=)

252. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata dr (cost=0.43..48.88 rows=755 width=80) (actual rows= loops=)

  • Index Cond: (formname = 'death_report'::text)
253. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=59.16..42,916.62 rows=1 width=36) (actual rows= loops=)

  • Filter: (("*SELECT* 2".reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND ("*SELECT* 2".reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
254. 0.000 0.000 ↓ 0.0

Unique (cost=59.16..42,916.59 rows=1 width=80) (actual rows= loops=)

255. 0.000 0.000 ↓ 0.0

Nested Loop (cost=59.16..42,916.59 rows=1 width=80) (actual rows= loops=)

  • Join Filter: ((form_12.doc #>> '{fields,inputs,contact,_id}'::text[]) = pc_1.patient_id)
256. 0.000 0.000 ↓ 0.0

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pc_1 (cost=0.42..41,830.84 rows=45,213 width=36) (actual rows= loops=)

  • Filter: ((patient_id <> ''::text) AND (date_part('year'::text, age((CURRENT_DATE)::timestamp with time zone, ((date_of_birth)::date)::timestamp with time zone)) >= '12'::double precision))
257. 0.000 0.000 ↓ 0.0

Materialize (cost=58.74..294.53 rows=1 width=1,626) (actual rows= loops=)

258. 0.000 0.000 ↓ 0.0

Hash Join (cost=58.74..294.52 rows=1 width=1,626) (actual rows= loops=)

  • Hash Cond: ((form_12.doc ->> '_id'::text) = dr_1.uuid)
259. 0.000 0.000 ↓ 0.0

Append (cost=0.42..234.40 rows=653 width=1,582) (actual rows= loops=)

260. 0.000 0.000 ↓ 0.0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form_12 (cost=0.42..8.44 rows=1 width=1,032) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
261. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_death_report form_13 (cost=0.00..155.63 rows=642 width=1,595) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
262. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_14 (cost=0.00..1.21 rows=1 width=432) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
263. 0.000 0.000 ↓ 0.0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_15 (cost=0.29..8.31 rows=1 width=654) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
264. 0.000 0.000 ↓ 0.0

Index Scan using pat_form_expr_idx9 on pat_form form_16 (cost=0.14..8.16 rows=1 width=638) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
265. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_17 (cost=0.28..8.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
266. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_18 (cost=0.43..8.45 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
267. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_19 (cost=0.00..1.01 rows=1 width=849) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
268. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx9 on pat_person form_20 (cost=0.42..8.44 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
269. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_21 (cost=0.28..8.29 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
270. 0.000 0.000 ↓ 0.0

Seq Scan on pat_usage_stats form_22 (cost=0.00..6.60 rows=1 width=1,075) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
271. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_23 (cost=0.28..8.30 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
272. 0.000 0.000 ↓ 0.0

Hash (cost=48.88..48.88 rows=755 width=80) (actual rows= loops=)

273. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata dr_1 (cost=0.43..48.88 rows=755 width=80) (actual rows= loops=)

  • Index Cond: (formname = 'death_report'::text)
274. 0.000 0.000 ↓ 0.0

Hash (cost=311.92..311.92 rows=133 width=56) (actual rows= loops=)

275. 0.000 0.000 ↓ 0.0

Subquery Scan on infant_deaths (cost=309.26..311.92 rows=133 width=56) (actual rows= loops=)

276. 0.000 0.000 ↓ 0.0

HashAggregate (cost=309.26..310.59 rows=133 width=56) (actual rows= loops=)

  • Group Key: dr_2.chw, 0
277. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=68.00..303.78 rows=137 width=1,622) (actual rows= loops=)

  • Hash Cond: ((form_24.doc ->> '_id'::text) = dr_2.uuid)
278. 0.000 0.000 ↓ 0.0

Append (cost=0.42..234.40 rows=653 width=1,582) (actual rows= loops=)

279. 0.000 0.000 ↓ 0.0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form_24 (cost=0.42..8.44 rows=1 width=1,032) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
280. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_death_report form_25 (cost=0.00..155.63 rows=642 width=1,595) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
281. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_26 (cost=0.00..1.21 rows=1 width=432) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
282. 0.000 0.000 ↓ 0.0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_27 (cost=0.29..8.31 rows=1 width=654) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
283. 0.000 0.000 ↓ 0.0

Index Scan using pat_form_expr_idx9 on pat_form form_28 (cost=0.14..8.16 rows=1 width=638) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
284. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_29 (cost=0.28..8.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
285. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_30 (cost=0.43..8.45 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
286. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_31 (cost=0.00..1.01 rows=1 width=849) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
287. 0.000 0.000 ↓ 0.0

Index Scan using pat_person_expr_idx9 on pat_person form_32 (cost=0.42..8.44 rows=1 width=1,401) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
288. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_33 (cost=0.28..8.29 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
289. 0.000 0.000 ↓ 0.0

Seq Scan on pat_usage_stats form_34 (cost=0.00..6.60 rows=1 width=1,075) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
290. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_35 (cost=0.28..8.30 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
291. 0.000 0.000 ↓ 0.0

Hash (cost=65.87..65.87 rows=137 width=72) (actual rows= loops=)

292. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata dr_2 (cost=0.43..65.87 rows=137 width=72) (actual rows= loops=)

  • Index Cond: (formname = 'death_report'::text)
  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
293. 0.000 0.000 ↓ 0.0

Hash (cost=10,000,100,156.22..10,000,100,156.22 rows=1,800 width=48) (actual rows= loops=)

294. 0.000 0.000 ↓ 0.0

Subquery Scan on home_visits (cost=10,000,095,637.02..10,000,100,156.22 rows=1,800 width=48) (actual rows= loops=)

295. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,095,637.02..10,000,100,138.22 rows=1,800 width=48) (actual rows= loops=)

  • Group Key: useview_home_visit.reported_by, 0
296. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,095,637.02..10,000,096,757.82 rows=448,320 width=76) (actual rows= loops=)

  • Sort Key: useview_home_visit.reported_by
297. 0.000 0.000 ↓ 0.0

Index Only Scan using index_useview_home_visit_reported_family_uuid_reported_by on useview_home_visit (cost=0.45..33,630.85 rows=448,320 width=76) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
298. 0.000 0.000 ↓ 0.0

Materialize (cost=10,000,014,263.49..10,000,017,014.67 rows=200 width=97) (actual rows= loops=)

299. 0.000 0.000 ↓ 0.0

Subquery Scan on fp_fu_ke (cost=10,000,014,263.49..10,000,017,013.67 rows=200 width=97) (actual rows= loops=)

300. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,014,263.49..10,000,017,011.67 rows=200 width=97) (actual rows= loops=)

  • Group Key: "*SELECT* 1_1".reported_by, 0
301. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,014,263.49..10,000,014,425.03 rows=64,616 width=178) (actual rows= loops=)

  • Sort Key: "*SELECT* 1_1".reported_by
302. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=121.96..3,357.30 rows=64,616 width=178) (actual rows= loops=)

  • Hash Cond: ("*SELECT* 1_1".form_uuid = useview_fp_follow_up_prospective_ke.source_id)
303. 0.000 0.000 ↓ 0.0

Append (cost=0.00..957.10 rows=5,556 width=122) (actual rows= loops=)

304. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=0.00..163.86 rows=1,089 width=122) (actual rows= loops=)

305. 0.000 0.000 ↓ 0.0

Result (cost=0.00..152.97 rows=1,089 width=122) (actual rows= loops=)

306. 0.000 0.000 ↓ 0.0

Append (cost=0.00..142.08 rows=1,089 width=121) (actual rows= loops=)

307. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_prospective_ke useview_fp_follow_up_prospective_ke_1 (cost=0.00..56.26 rows=405 width=121) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
308. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_short_term_ke useview_fp_follow_up_short_term_ke_1 (cost=0.00..39.20 rows=368 width=121) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
309. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_long_term_ke useview_fp_follow_up_long_term_ke_1 (cost=0.00..41.17 rows=316 width=121) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
310. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_1 (cost=0.00..765.46 rows=4,467 width=122) (actual rows= loops=)

311. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_registration_ke (cost=0.00..720.79 rows=4,467 width=122) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, ('2019-08-01'::date)::timestamp with time zone))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, ('2019-11-01'::date)::timestamp with time zone) + '1 day'::interval))::timestamp without time zone))
312. 0.000 0.000 ↓ 0.0

Hash (cost=92.89..92.89 rows=2,326 width=89) (actual rows= loops=)

313. 0.000 0.000 ↓ 0.0

Append (cost=0.00..92.89 rows=2,326 width=89) (actual rows= loops=)

314. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_prospective_ke (cost=0.00..32.30 rows=930 width=88) (actual rows= loops=)

315. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_short_term_ke (cost=0.00..23.83 rows=683 width=89) (actual rows= loops=)

316. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_follow_up_long_term_ke (cost=0.00..25.13 rows=713 width=89) (actual rows= loops=)