explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RrGkh

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

GroupAggregate (cost=160,001,052,814.31..160,001,052,816.26 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: 832
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
2.          

CTE fp

3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,007,827.41..10,000,007,938.19 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,007,827.41..10,000,007,842.80 rows=6,159 width=80) (actual rows= loops=)

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

Result (cost=0.00..7,439.74 rows=6,159 width=80) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Append (cost=0.00..7,378.15 rows=6,159 width=76) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

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

8. 0.000 0.000 ↓ 0.0

Seq Scan on useview_fp_registration (cost=0.00..349.86 rows=44 width=256) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
9. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_2 (cost=23.99..528.11 rows=299 width=78) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_person_fp_registration (cost=23.99..525.12 rows=299 width=256) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '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..23.92 rows=348 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
12. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=0.45..6,468.95 rows=5,816 width=76) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using useview_postnatal_reported on useview_postnatal_care useview_postnatal_care_2 (cost=0.45..6,410.79 rows=5,816 width=254) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
14. 0.000 0.000 ↓ 0.0

Sort (cost=150,001,044,876.12..150,001,044,876.12 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))
15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=140,000,891,769.91..140,001,044,876.09 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))
16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=130,000,889,348.85..130,001,041,727.78 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))
17. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=120,000,857,620.05..120,001,009,998.96 rows=3 width=1,923) (actual rows= loops=)

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

Nested Loop Left Join (cost=110,000,811,584.56..110,000,963,963.45 rows=3 width=1,883) (actual rows= loops=)

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

Hash Left Join (cost=100,000,760,660.64..100,000,913,039.40 rows=3 width=1,875) (actual rows= loops=)

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

Nested Loop Left Join (cost=100,000,760,653.64..100,000,913,032.22 rows=3 width=1,859) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = infant_deaths.chw_uuid) AND (chwlist.interval_number = infant_deaths.interval_number))
21. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=100,000,760,341.66..100,000,912,716.86 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))
22. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=100,000,699,725.97..100,000,852,101.16 rows=3 width=1,871) (actual rows= loops=)

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

Hash Right Join (cost=100,000,530,396.56..100,000,682,771.73 rows=3 width=1,863) (actual rows= loops=)

  • Hash Cond: ((contactview_metadata.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
24. 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
25. 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)
26. 0.000 0.000 ↓ 0.0

Hash (cost=100,000,530,396.11..100,000,530,396.11 rows=1 width=1,819) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=100,000,521,218.94..100,000,530,396.11 rows=1 width=1,819) (actual rows= loops=)

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

Nested Loop Left Join (cost=100,000,521,218.66..100,000,521,898.72 rows=1 width=1,815) (actual rows= loops=)

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

Hash Right Join (cost=100,000,485,100.29..100,000,485,742.48 rows=1 width=1,807) (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,010,927.49..10,000,011,510.16 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,010,927.49..10,000,011,067.74 rows=56,103 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.58..4,006.64 rows=56,103 width=76) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
33. 0.000 0.000 ↓ 0.0

Hash (cost=90,000,474,172.79..90,000,474,172.79 rows=1 width=1,799) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=90,000,473,821.11..90,000,474,172.79 rows=1 width=1,799) (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,022,805.89..10,000,023,120.09 rows=2,141 width=64) (actual rows= loops=)

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

Sort (cost=10,000,022,805.89..10,000,022,838.42 rows=13,013 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=565.84..21,916.61 rows=13,013 width=88) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '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..562.58 rows=13,013 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
39. 0.000 0.000 ↓ 0.0

Hash (cost=80,000,451,015.21..80,000,451,015.21 rows=1 width=1,775) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,000,450,940.38..80,000,451,015.21 rows=1 width=1,775) (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=16,834.96..16,854.91 rows=1,995 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=113.51..14,958.66 rows=5,176 width=86) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '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..112.21 rows=5,176 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
44. 0.000 0.000 ↓ 0.0

Hash (cost=80,000,434,105.41..80,000,434,105.41 rows=1 width=1,663) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=80,000,434,057.69..80,000,434,105.41 rows=1 width=1,663) (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,568.07..4,585.42 rows=1,735 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,545.22 rows=3,047 width=76) (actual rows= loops=)

  • Index Cond: (formname = 'community_event'::text)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
48. 0.000 0.000 ↓ 0.0

Hash (cost=80,000,429,489.60..80,000,429,489.60 rows=1 width=1,655) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=80,000,425,496.26..80,000,429,489.60 rows=1 width=1,655) (actual rows= loops=)

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

Nested Loop Left Join (cost=80,000,424,356.05..80,000,428,312.54 rows=1 width=1,639) (actual rows= loops=)

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

Nested Loop Left Join (cost=60,000,378,461.75..60,000,382,411.24 rows=1 width=1,631) (actual rows= loops=)

  • Join Filter: ((chwlist.chw_uuid = pmb.chw_uuid) AND (chwlist.interval_number = pmb.interval_number))
52. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=30,000,065,839.71..30,000,069,778.70 rows=1 width=1,583) (actual rows= loops=)

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

GroupAggregate (cost=10,000,029,708.84..10,000,033,589.00 rows=2,139 width=1,292) (actual rows= loops=)

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

Sort (cost=10,000,029,708.84..10,000,029,793.48 rows=33,856 width=352) (actual rows= loops=)

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

Bitmap Heap Scan on chwview_assessment (cost=1,463.48..21,722.67 rows=33,856 width=352) (actual rows= loops=)

  • Recheck Cond: ((reported_day >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported_day < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
56. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on chwview_assessment_reported_chw_uuid (cost=0.00..1,455.01 rows=33,856 width=0) (actual rows= loops=)

  • Index Cond: ((reported_day >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported_day < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
57. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,036,130.85..20,000,036,130.85 rows=1 width=331) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,036,076.91..20,000,036,130.85 rows=1 width=331) (actual rows= loops=)

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

HashAggregate (cost=12,200.45..12,220.06 rows=1,961 width=48) (actual rows= loops=)

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

Seq Scan on useview_pregnancy_visit anc (cost=0.00..12,161.28 rows=5,223 width=40) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
61. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,023,876.45..20,000,023,876.45 rows=1 width=323) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,023,839.92..20,000,023,876.45 rows=1 width=323) (actual rows= loops=)

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

HashAggregate (cost=4,577.12..4,590.40 rows=1,328 width=136) (actual rows= loops=)

  • Group Key: pnc.chw, 0
64. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_postnatal_care pnc (cost=106.89..4,333.43 rows=2,074 width=101) (actual rows= loops=)

  • Recheck Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
65. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_postnatal_care_count_reported_uuid (cost=0.00..106.37 rows=2,074 width=0) (actual rows= loops=)

  • Index Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
66. 0.000 0.000 ↓ 0.0

Hash (cost=20,000,019,262.78..20,000,019,262.78 rows=1 width=227) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,000,019,230.62..20,000,019,262.78 rows=1 width=227) (actual rows= loops=)

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

HashAggregate (cost=19,008.82..19,020.51 rows=1,169 width=48) (actual rows= loops=)

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

Index Scan using contactview_metadata_type on contactview_metadata contactview_metadata_1 (cost=0.43..19,000.02 rows=1,173 width=76) (actual rows= loops=)

  • Index Cond: (type = 'clinic'::text)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
70. 0.000 0.000 ↓ 0.0

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

71. 0.000 0.000 ↓ 0.0

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

72. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=20,000,000,204.44..20,000,000,221.78 rows=1 width=219) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,000,204.17..20,000,000,204.22 rows=5 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, (date_trunc('month'::text, now()) - '1 mon'::interval))), (0)
74. 0.000 0.000 ↓ 0.0

Hash Join (cost=20,000,000,162.74..20,000,000,204.04 rows=5 width=219) (actual rows= loops=)

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

WindowAgg (cost=10,000,000,059.85..10,000,000,087.35 rows=1,000 width=24) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,000,059.85..10,000,000,062.35 rows=1,000 width=8) (actual rows= loops=)

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

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

78. 0.000 0.000 ↓ 0.0

Hash (cost=10,000,000,102.88..10,000,000,102.88 rows=1 width=219) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,000,000,010.56..10,000,000,102.88 rows=1 width=219) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

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

81. 0.000 0.000 ↓ 0.0

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

82. 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)
  • Filter: (name <> ALL ('{HQ,"HQ OVC"}'::text[]))
83. 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)
84. 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)
85. 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)
86. 0.000 0.000 ↓ 0.0

WindowAgg (cost=10,000,000,000.07..10,000,000,000.09 rows=1 width=16) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,000,000.07..10,000,000,000.08 rows=1 width=4) (actual rows= loops=)

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

Function Scan on generate_series generate_series_1 (cost=0.05..0.06 rows=1 width=4) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Index Only Scan using chp_muting_chw on chp_muting (cost=0.28..3.49 rows=1 width=37) (actual rows= loops=)

  • Index Cond: (chw = chp_1.uuid)
90. 0.000 0.000 ↓ 0.0

HashAggregate (cost=30,000,312,622.04..30,000,312,625.54 rows=280 width=88) (actual rows= loops=)

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

CTE u1s

92. 0.000 0.000 ↓ 0.0

HashAggregate (cost=15,052.69..15,069.94 rows=1,725 width=81) (actual rows= loops=)

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

Bitmap Heap Scan on useview_population_demographics (cost=112.64..15,035.44 rows=1,725 width=81) (actual rows= loops=)

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

Bitmap Index Scan on useview_population_demographics_reported_idx (cost=0.00..112.21 rows=5,176 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
95. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=30,000,288,465.94..30,000,297,440.26 rows=2,796 width=100) (actual rows= loops=)

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

Sort (cost=30,000,288,465.94..30,000,289,743.99 rows=511,221 width=183) (actual rows= loops=)

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

Hash Left Join (cost=20,000,119,576.15..20,000,149,126.02 rows=511,221 width=183) (actual rows= loops=)

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

Hash Left Join (cost=20,000,118,356.68..20,000,140,429.86 rows=210,175 width=146) (actual rows= loops=)

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

Hash Left Join (cost=20,000,107,495.12..20,000,116,107.78 rows=57,598 width=145) (actual rows= loops=)

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

Subquery Scan on pmb (cost=20,000,096,909.34..20,000,097,678.29 rows=27,962 width=108) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Group (cost=20,000,096,909.34..20,000,097,398.67 rows=27,962 width=176) (actual rows= loops=)

  • Group Key: pnc_1.chw, u1s.family_uuid, fp_1.person_ids, pnc_1.patient_id, u1s.uuid, u1s.interval_number
102. 0.000 0.000 ↓ 0.0

Sort (cost=20,000,096,909.34..20,000,096,979.24 rows=27,962 width=172) (actual rows= loops=)

  • Sort Key: pnc_1.chw, u1s.family_uuid, fp_1.person_ids, u1s.uuid, u1s.interval_number
103. 0.000 0.000 ↓ 0.0

Hash Join (cost=10,000,087,876.86..10,000,092,453.68 rows=27,962 width=172) (actual rows= loops=)

  • Hash Cond: (fp_1.person_ids = pnc_1.patient_id)
104. 0.000 0.000 ↓ 0.0

Hash Join (cost=10,000,077,423.08..10,000,077,462.21 rows=13,576 width=100) (actual rows= loops=)

  • Hash Cond: (u1s.family_uuid = fp_1.family_uuid)
105. 0.000 0.000 ↓ 0.0

CTE Scan on u1s (cost=0.00..34.50 rows=1,725 width=68) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Hash (cost=10,000,077,403.40..10,000,077,403.40 rows=1,574 width=69) (actual rows= loops=)

107. 0.000 0.000 ↓ 0.0

Subquery Scan on fp_1 (cost=10,000,077,356.18..10,000,077,403.40 rows=1,574 width=69) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,077,356.18..10,000,077,387.66 rows=1,574 width=69) (actual rows= loops=)

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

Sort (cost=10,000,077,356.18..10,000,077,360.12 rows=1,574 width=73) (actual rows= loops=)

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

Hash Join (cost=74,803.83..77,272.60 rows=1,574 width=73) (actual rows= loops=)

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

CTE Scan on u1s u1s_1 (cost=0.00..34.50 rows=1,725 width=32) (actual rows= loops=)

112. 0.000 0.000 ↓ 0.0

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

113. 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))
114. 0.000 0.000 ↓ 0.0

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

115. 0.000 0.000 ↓ 0.0

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

116. 0.000 0.000 ↓ 0.0

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

117. 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=)

118. 0.000 0.000 ↓ 0.0

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

119. 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=)

120. 0.000 0.000 ↓ 0.0

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

121. 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=)

122. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,045,894.30..20,000,045,896.30 rows=200 width=48) (actual rows= loops=)

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

Hash Left Join (cost=20,000,044,366.46..20,000,045,057.56 rows=111,565 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))
124. 0.000 0.000 ↓ 0.0

HashAggregate (cost=20,000,035,342.00..20,000,036,011.65 rows=1,685 width=76) (actual rows= loops=)

  • Group Key: p.chw, p.patient_id
  • Filter: ((max(p.edd) >= date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval))) AND CASE WHEN (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) = date_trunc('day'::text, now())) THEN (max(p.edd) <= ((date_trunc('month'::text, now()) - '1 day'::interval) - '3 days'::interval)) ELSE (max(p.edd) <= ((date_trunc('month'::text, now()) - '1 day'::interval) + '1 day'::interval)) END)
125. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=20,000,021,846.44..20,000,035,139.84 rows=10,108 width=78) (actual rows= loops=)

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

Merge Join (cost=10,000,015,023.29..10,000,028,058.31 rows=12,588 width=78) (actual rows= loops=)

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

Unique (cost=10,000,015,022.88..10,000,015,290.05 rows=35,515 width=47) (actual rows= loops=)

128. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,015,022.88..10,000,015,156.46 rows=53,435 width=47) (actual rows= loops=)

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

Seq Scan on useview_pregnancy_visit (cost=0.00..10,826.76 rows=53,435 width=47) (actual rows= loops=)

  • Filter: (((edd_updated IS TRUE) AND (reported > ((date_trunc('month'::text, now()) - '1 mon'::interval) - '9 mons'::interval))) OR (reported > ((date_trunc('month'::text, now()) - '1 day'::interval) - '9 mons'::interval)))
130. 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=)

131. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,006,823.15..10,000,006,884.78 rows=11,238 width=44) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,006,823.15..10,000,006,853.97 rows=12,327 width=44) (actual rows= loops=)

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

Bitmap Heap Scan on useview_pregnancy_visit useview_pregnancy_visit_1 (cost=484.75..5,985.56 rows=12,327 width=44) (actual rows= loops=)

  • Filter: ((continue_follow_up IS FALSE) AND ((reported > ((date_trunc('month'::text, now()) - '1 mon'::interval) - '9 mons'::interval)) OR (reported > ((date_trunc('month'::text, now()) - '1 day'::interval) - '9 mons'::interval))))
134. 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)
135. 0.000 0.000 ↓ 0.0

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

136. 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
137. 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)
138. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,140.21..1,150.74 rows=1,053 width=56) (actual rows= loops=)

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

Index Scan using useview_pregnancy_reported on useview_pregnancy (cost=0.32..1,111.77 rows=1,422 width=78) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
140. 0.000 0.000 ↓ 0.0

HashAggregate (cost=36,118.36..36,129.18 rows=1,082 width=48) (actual rows= loops=)

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

Nested Loop (cost=4,933.02..36,110.25 rows=1,082 width=77) (actual rows= loops=)

142. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_assessment assess (cost=4,932.60..18,858.76 rows=4,662 width=81) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone) AND (patient_age_in_years < 5) AND (referral_follow_up = 'true'::text))
143. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=4,932.60..4,932.60 rows=4,662 width=0) (actual rows= loops=)

144. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_assessment_reported_age_uuid (cost=0.00..1,695.30 rows=27,221 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone) AND (patient_age_in_years < 5))
145. 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)
146. 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..3.69 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)
147. 0.000 0.000 ↓ 0.0

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

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

SubPlan (for Index Only Scan)

149. 0.000 0.000 ↓ 0.0

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

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

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

  • Index Cond: (chw = chp.uuid)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
151. 0.000 0.000 ↓ 0.0

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

152. 0.000 0.000 ↓ 0.0

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

153. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.47..39,064.13 rows=15,655 width=36) (actual rows= loops=)

154. 0.000 0.000 ↓ 0.0

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

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

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

156. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata meta_2 (cost=0.43..12,969.17 rows=5,218 width=51) (actual rows= loops=)

  • Index Cond: (formname = "*VALUES*_1".column1)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
157. 0.000 0.000 ↓ 0.0

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

158. 0.000 0.000 ↓ 0.0

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

159. 0.000 0.000 ↓ 0.0

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

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

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

161. 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)
162. 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)
163. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (parent_uuid = chwarea.uuid)
  • Filter: ((type = 'clinic'::text) AND (reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
164. 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[])))
165. 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[])))
166. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,103.28..7,363.85 rows=1 width=0) (actual rows= loops=)

167. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,102.86..5,945.24 rows=99 width=72) (actual rows= loops=)

168. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on form_metadata meta_3 (cost=5,102.30..5,492.57 rows=99 width=36) (actual rows= loops=)

  • Recheck Cond: ((chw = chp.uuid) AND (reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
169. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=5,102.30..5,102.30 rows=99 width=0) (actual rows= loops=)

170. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on form_metadata_chw (cost=0.00..65.06 rows=1,667 width=0) (actual rows= loops=)

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

Bitmap Index Scan on form_metadata_reported (cost=0.00..5,036.95 rows=240,049 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
172. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (uuid = meta_3.uuid)
173. 0.000 0.000 ↓ 0.0

Append (cost=0.42..14.21 rows=12 width=37) (actual rows= loops=)

174. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((doc ->> '_id'::text) = fm.uuid)
  • 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_form_postnatal_care_expr_idx8 on pat_form_postnatal_care form_37 (cost=0.42..1.61 rows=1 width=25) (actual rows= loops=)

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

Index Scan using pat_district_hospital_expr_idx8 on pat_district_hospital form_38 (cost=0.14..0.16 rows=1 width=432) (actual rows= loops=)

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

Index Scan using pat_feedback_expr_idx8 on pat_feedback form_39 (cost=0.41..1.61 rows=1 width=654) (actual rows= loops=)

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

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

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

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

  • Index Cond: ((doc ->> '_id'::text) = fm.uuid)
  • 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_info_expr_idx1 on pat_info form_42 (cost=0.56..2.34 rows=1 width=297) (actual rows= loops=)

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

Index Scan using pat_meta_expr_idx8 on pat_meta form_43 (cost=0.12..0.15 rows=1 width=849) (actual rows= loops=)

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

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

  • Index Cond: ((doc ->> '_id'::text) = fm.uuid)
  • 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 pat_traffic_stats_expr_idx8 on pat_traffic_stats form_45 (cost=0.28..1.35 rows=1 width=828) (actual rows= loops=)

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

Index Scan using pat_usage_stats_expr_idx8 on pat_usage_stats form_46 (cost=0.14..0.17 rows=1 width=1,075) (actual rows= loops=)

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

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

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

Nested Loop (cost=1.53..8,400.63 rows=41 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.14 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (uuid = fm_1.uuid)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '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=311.98..313.11 rows=45 width=56) (actual rows= loops=)

212. 0.000 0.000 ↓ 0.0

Subquery Scan on infant_deaths (cost=311.98..312.88 rows=45 width=56) (actual rows= loops=)

213. 0.000 0.000 ↓ 0.0

HashAggregate (cost=311.98..312.43 rows=45 width=56) (actual rows= loops=)

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

Hash Right Join (cost=74.40..310.18 rows=45 width=1,622) (actual rows= loops=)

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

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

216. 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)
217. 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)
218. 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)
219. 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)
220. 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)
221. 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)
222. 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)
223. 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)
224. 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)
225. 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)
226. 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)
227. 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)
228. 0.000 0.000 ↓ 0.0

Hash (cost=73.42..73.42 rows=45 width=72) (actual rows= loops=)

229. 0.000 0.000 ↓ 0.0

Index Scan using form_metadata_formname on form_metadata dr (cost=0.43..73.42 rows=45 width=72) (actual rows= loops=)

  • Index Cond: (formname = 'death_report'::text)
  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
230. 0.000 0.000 ↓ 0.0

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

231. 0.000 0.000 ↓ 0.0

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

232. 0.000 0.000 ↓ 0.0

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

233. 0.000 0.000 ↓ 0.0

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

234. 0.000 0.000 ↓ 0.0

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

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

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

236. 0.000 0.000 ↓ 0.0

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

237. 0.000 0.000 ↓ 0.0

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

  • Filter: (("*SELECT* 1".reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND ("*SELECT* 1".reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
238. 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=)

239. 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
240. 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_12.doc #>> '{fields,inputs,contact,_id}'::text[]))
241. 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)
242. 0.000 0.000 ↓ 0.0

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

243. 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)
244. 0.000 0.000 ↓ 0.0

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

245. 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)
246. 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)
247. 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)
248. 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)
249. 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)
250. 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)
251. 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)
252. 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)
253. 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)
254. 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)
255. 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)
256. 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)
257. 0.000 0.000 ↓ 0.0

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

258. 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)
259. 0.000 0.000 ↓ 0.0

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

  • Filter: (("*SELECT* 2".reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND ("*SELECT* 2".reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
260. 0.000 0.000 ↓ 0.0

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

261. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ((form_24.doc #>> '{fields,inputs,contact,_id}'::text[]) = pc_1.patient_id)
262. 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))
263. 0.000 0.000 ↓ 0.0

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

264. 0.000 0.000 ↓ 0.0

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

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

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

266. 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)
267. 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)
268. 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)
269. 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)
270. 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)
271. 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)
272. 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)
273. 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)
274. 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)
275. 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)
276. 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)
277. 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)
278. 0.000 0.000 ↓ 0.0

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

279. 0.000 0.000 ↓ 0.0

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

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

Hash (cost=10,000,046,032.49..10,000,046,032.49 rows=200 width=80) (actual rows= loops=)

281. 0.000 0.000 ↓ 0.0

Subquery Scan on assessed (cost=10,000,046,028.49..10,000,046,032.49 rows=200 width=80) (actual rows= loops=)

282. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,000,046,028.49..10,000,046,030.49 rows=200 width=80) (actual rows= loops=)

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

Subquery Scan on assess_u1fu_pnc_aggregated (cost=10,000,045,828.97..10,000,046,013.49 rows=200 width=96) (actual rows= loops=)

284. 0.000 0.000 ↓ 0.0

Unique (cost=10,000,045,828.97..10,000,046,011.49 rows=200 width=100) (actual rows= loops=)

285. 0.000 0.000 ↓ 0.0

Sort (cost=10,000,045,828.97..10,000,045,920.23 rows=36,504 width=100) (actual rows= loops=)

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

Append (cost=0.45..41,064.24 rows=36,504 width=100) (actual rows= loops=)

287. 0.000 0.000 ↓ 0.0

Index Scan using useview_assessment_reported on useview_assessment (cost=0.45..33,127.18 rows=33,828 width=94) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
288. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_u1_follow_up (cost=51.87..920.54 rows=737 width=161) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
289. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on useview_u1_follow_up_reported_chw_uuid (cost=0.00..51.69 rows=737 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
290. 0.000 0.000 ↓ 0.0

Index Scan using useview_postnatal_reported on useview_postnatal_care useview_postnatal_care_1 (cost=0.45..6,468.96 rows=1,939 width=185) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
  • Filter: is_date((date_of_birth)::character varying)
291. 0.000 0.000 ↓ 0.0

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

292. 0.000 0.000 ↓ 0.0

Subquery Scan on home_visits (cost=10,000,030,195.09..10,000,031,701.80 rows=1,800 width=48) (actual rows= loops=)

293. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,030,195.09..10,000,031,683.80 rows=1,800 width=48) (actual rows= loops=)

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

Sort (cost=10,000,030,195.09..10,000,030,562.77 rows=147,071 width=76) (actual rows= loops=)

  • Sort Key: useview_home_visit.reported_by
295. 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.46..11,033.87 rows=147,071 width=76) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
296. 0.000 0.000 ↓ 0.0

Materialize (cost=10,000,002,421.05..10,000,003,138.31 rows=200 width=97) (actual rows= loops=)

297. 0.000 0.000 ↓ 0.0

Subquery Scan on fp_fu_ke (cost=10,000,002,421.05..10,000,003,137.31 rows=200 width=97) (actual rows= loops=)

298. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10,000,002,421.05..10,000,003,135.31 rows=200 width=97) (actual rows= loops=)

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

Sort (cost=10,000,002,421.05..10,000,002,462.95 rows=16,759 width=178) (actual rows= loops=)

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

Hash Left Join (cost=131.53..1,245.19 rows=16,759 width=178) (actual rows= loops=)

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

Append (cost=9.56..532.34 rows=1,441 width=122) (actual rows= loops=)

302. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=9.56..131.85 rows=364 width=122) (actual rows= loops=)

303. 0.000 0.000 ↓ 0.0

Result (cost=9.56..128.21 rows=364 width=122) (actual rows= loops=)

304. 0.000 0.000 ↓ 0.0

Append (cost=9.56..124.57 rows=364 width=121) (actual rows= loops=)

305. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_fp_follow_up_prospective_ke useview_fp_follow_up_prospective_ke_1 (cost=9.56..38.71 rows=123 width=121) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
306. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_useview_fp_follow_up_prospective_ke_reported_patient_id_u (cost=0.00..9.53 rows=123 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
307. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_fp_follow_up_short_term_ke useview_fp_follow_up_short_term_ke_1 (cost=13.55..35.74 rows=122 width=121) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
308. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_useview_fp_follow_up_short_term_ke_reported_patient_id_uu (cost=0.00..13.52 rows=122 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '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..48.30 rows=119 width=121) (actual rows= loops=)

  • Filter: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
310. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_1 (cost=71.35..393.28 rows=1,077 width=122) (actual rows= loops=)

311. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on useview_fp_registration_ke (cost=71.35..382.51 rows=1,077 width=122) (actual rows= loops=)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
312. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_useview_fp_registration_ke_reported_patient_id_uuid (cost=0.00..71.08 rows=1,077 width=0) (actual rows= loops=)

  • Index Cond: ((reported >= (date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 mon'::interval)))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, (date_trunc('month'::text, now()) - '1 day'::interval)) + '1 day'::interval))::timestamp without time zone))
313. 0.000 0.000 ↓ 0.0

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

314. 0.000 0.000 ↓ 0.0

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

315. 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=)

316. 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=)

317. 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=)