explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cdt2 : Optimization for: plan #6DXB

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 22.505 362,843.852 ↓ 4.4 22 1

GroupAggregate (cost=687,356.96..687,367.18 rows=5 width=436) (actual time=362,820.730..362,843.852 rows=22 loops=1)

  • Group Key: chwlist.branch_uuid, chwlist.branch_name, 'multiple'::text, 'multiple'::text, 'multiple'::text, 'multiple'::text, 'multiple'::text, (date(chwlist.interval_start)), chwlist.interval_number
  • Functions: 723
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 347.922 ms, Inlining 163.988 ms, Optimization 11618.506 ms, Emission 6715.751 ms, Total 18846.166 ms
2. 33.721 362,821.347 ↓ 167.8 6,207 1

Sort (cost=687,356.96..687,357.05 rows=37 width=600) (actual time=362,820.138..362,821.347 rows=6,207 loops=1)

  • Sort Key: chwlist.branch_uuid, chwlist.branch_name, (date(chwlist.interval_start)), chwlist.interval_number
  • Sort Method: quicksort Memory: 2584kB
3. 5,287.614 362,787.626 ↓ 167.8 6,207 1

Nested Loop Left Join (cost=572,291.70..687,355.99 rows=37 width=600) (actual time=28,157.756..362,787.626 rows=6,207 loops=1)

  • Join Filter: ((sync.chw_uuid = chwlist.chw_uuid) AND (sync.interval_number = chwlist.interval_number))
  • Rows Removed by Join Filter: 37617702
4. 15.772 352,490.963 ↓ 167.8 6,207 1

Hash Left Join (cost=572,291.15..616,370.39 rows=37 width=472) (actual time=27,423.477..352,490.963 rows=6,207 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = fp.chw_uuid) AND (chwlist.interval_number = fp.interval_number))
5. 21.609 352,379.904 ↓ 167.8 6,207 1

Hash Left Join (cost=567,033.33..611,112.38 rows=37 width=464) (actual time=27,328.149..352,379.904 rows=6,207 loops=1)

  • Hash Cond: ((chwlist.chw_area_uuid = chp_visits.chw_area_uuid) AND (chwlist.interval_number = chp_visits.interval_number))
6. 57.594 352,272.969 ↓ 167.8 6,207 1

Nested Loop Left Join (cost=381,948.73..426,027.59 rows=37 width=496) (actual time=27,242.800..352,272.969 rows=6,207 loops=1)

  • Join Filter: (chwlist.interval_number = 0)
7. 23.745 27,309.960 ↓ 167.8 6,207 1

Hash Left Join (cost=381,948.45..390,004.73 rows=37 width=492) (actual time=27,185.338..27,309.960 rows=6,207 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = communityevent.chw_uuid) AND (chwlist.interval_number = communityevent.interval_number))
8. 23.018 27,220.724 ↓ 167.8 6,207 1

Hash Left Join (cost=379,919.18..387,975.27 rows=37 width=484) (actual time=27,119.826..27,220.724 rows=6,207 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = eddnopnc.chw_uuid) AND (chwlist.interval_number = eddnopnc.interval_number))
9. 16.923 23,751.472 ↓ 167.8 6,207 1

Hash Left Join (cost=141,891.75..149,947.64 rows=37 width=476) (actual time=23,673.571..23,751.472 rows=6,207 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = pncvisit.chw_uuid) AND (chwlist.interval_number = pncvisit.interval_number))
10. 29.837 23,715.937 ↓ 167.8 6,207 1

Hash Right Join (cost=141,647.28..149,702.98 rows=37 width=428) (actual time=23,654.937..23,715.937 rows=6,207 loops=1)

  • Hash Cond: ((cmeta.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
11. 455.020 2,825.119 ↑ 45.8 6,399 1

HashAggregate (cost=125,219.99..128,149.20 rows=292,921 width=56) (actual time=2,791.864..2,825.119 rows=6,399 loops=1)

  • Group Key: cmeta.parent_uuid, 0
12. 645.166 2,370.099 ↑ 1.0 882,032 1

Hash Left Join (cost=64,412.80..116,292.17 rows=892,782 width=76) (actual time=1,335.613..2,370.099 rows=882,032 loops=1)

  • Hash Cond: (cmeta.uuid = useview_family_survey.family_id)
13. 391.373 391.373 ↑ 1.0 882,032 1

Index Scan using contactview_metadata_type on contactview_metadata cmeta (cost=0.43..49,536.25 rows=892,782 width=72) (actual time=0.062..391.373 rows=882,032 loops=1)

  • Index Cond: (type = 'clinic'::text)
14. 261.715 1,333.560 ↓ 1.1 558,048 1

Hash (cost=58,338.95..58,338.95 rows=485,874 width=36) (actual time=1,333.560..1,333.560 rows=558,048 loops=1)

  • Buckets: 1048576 (originally 524288) Batches: 1 (originally 1) Memory Usage: 45795kB
15. 655.826 1,071.845 ↓ 1.1 558,048 1

HashAggregate (cost=48,621.47..53,480.21 rows=485,874 width=36) (actual time=878.677..1,071.845 rows=558,048 loops=1)

  • Group Key: useview_family_survey.family_id
16. 416.019 416.019 ↓ 1.0 763,084 1

Seq Scan on useview_family_survey (cost=0.00..46,753.96 rows=747,003 width=36) (actual time=0.032..416.019 rows=763,084 loops=1)

  • Filter: is_equity_survey
  • Rows Removed by Filter: 428135
17. 9.223 20,860.981 ↓ 1,241.4 6,207 1

Hash (cost=16,427.21..16,427.21 rows=5 width=376) (actual time=20,860.981..20,860.981 rows=6,207 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1695kB
18. 9.286 20,851.758 ↓ 1,241.4 6,207 1

Merge Left Join (cost=16,159.25..16,427.21 rows=5 width=376) (actual time=19,748.950..20,851.758 rows=6,207 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_assessment.chw)
  • Join Filter: (chwlist.interval_number = (0))
19. 7.596 19,268.577 ↓ 1,241.4 6,207 1

Merge Left Join (cost=15,295.26..15,295.50 rows=5 width=160) (actual time=19,258.765..19,268.577 rows=6,207 loops=1)

  • Merge Cond: ((chwlist.chw_uuid = on_time_follow_ups.chw_uuid) AND (chwlist.interval_number = on_time_follow_ups.interval_number))
20. 24.183 18,813.572 ↓ 1,241.4 6,207 1

Sort (cost=14,168.09..14,168.10 rows=5 width=152) (actual time=18,811.651..18,813.572 rows=6,207 loops=1)

  • Sort Key: chwlist.chw_uuid, chwlist.interval_number
  • Sort Method: quicksort Memory: 1841kB
21. 2.812 18,789.389 ↓ 1,241.4 6,207 1

Hash Right Join (cost=14,057.36..14,168.03 rows=5 width=152) (actual time=18,785.732..18,789.389 rows=6,207 loops=1)

  • Hash Cond: ((contactview_metadata.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
22. 7.804 77.534 ↑ 1.8 2,260 1

HashAggregate (cost=12,687.82..12,728.06 rows=4,024 width=48) (actual time=76.661..77.534 rows=2,260 loops=1)

  • Group Key: contactview_metadata.parent_uuid, 0
23. 69.730 69.730 ↓ 3.2 12,757 1

Index Scan using contactview_metadata_reported on contactview_metadata (cost=0.45..12,657.45 rows=4,049 width=40) (actual time=0.146..69.730 rows=12,757 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: (type = 'clinic'::text)
  • Rows Removed by Filter: 44523
24. 3.377 18,709.043 ↓ 1,241.4 6,207 1

Hash (cost=1,369.47..1,369.47 rows=5 width=144) (actual time=18,709.043..18,709.043 rows=6,207 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1062kB
25. 2.670 18,705.666 ↓ 1,241.4 6,207 1

Hash Right Join (cost=1,346.19..1,369.47 rows=5 width=144) (actual time=18,702.131..18,705.666 rows=6,207 loops=1)

  • Hash Cond: ((visit.chw = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
26. 4.172 11.426 ↓ 3.0 2,544 1

HashAggregate (cost=870.99..879.45 rows=846 width=47) (actual time=10.529..11.426 rows=2,544 loops=1)

  • Group Key: visit.chw, 0
27. 7.254 7.254 ↓ 6.9 6,339 1

Index Scan using useview_pregnancy_reported on useview_pregnancy visit (cost=0.44..864.13 rows=914 width=39) (actual time=0.222..7.254 rows=6,339 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
28. 3.176 18,691.570 ↓ 1,241.4 6,207 1

Hash (cost=475.13..475.13 rows=5 width=136) (actual time=18,691.570..18,691.570 rows=6,207 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1037kB
29. 1.241 18,688.394 ↓ 1,241.4 6,207 1

Subquery Scan on chwlist (cost=436.28..475.13 rows=5 width=136) (actual time=18,685.718..18,688.394 rows=6,207 loops=1)

30. 1.508 18,687.153 ↓ 1,241.4 6,207 1

Hash Join (cost=436.28..475.08 rows=5 width=264) (actual time=18,685.715..18,687.153 rows=6,207 loops=1)

  • Hash Cond: ((row_number() OVER (?)) = (row_number() OVER (?)))
31. 0.011 18,525.978 ↑ 1,000.0 1 1

WindowAgg (cost=59.84..84.84 rows=1,000 width=24) (actual time=18,525.976..18,525.978 rows=1 loops=1)

32. 0.041 18,525.967 ↑ 1,000.0 1 1

Sort (cost=59.84..62.34 rows=1,000 width=8) (actual time=18,525.967..18,525.967 rows=1 loops=1)

  • Sort Key: generate_series.generate_series
  • Sort Method: quicksort Memory: 25kB
33. 18,525.926 18,525.926 ↑ 1,000.0 1 1

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

34. 3.559 159.667 ↓ 6,207.0 6,207 1

Hash (cost=376.42..376.42 rows=1 width=136) (actual time=159.667..159.667 rows=6,207 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1035kB
35. 5.845 156.108 ↓ 6,207.0 6,207 1

Nested Loop (cost=12.76..376.42 rows=1 width=136) (actual time=0.171..156.108 rows=6,207 loops=1)

36. 7.621 137.849 ↓ 6,207.0 6,207 1

Nested Loop Anti Join (cost=12.70..376.33 rows=1 width=124) (actual time=0.144..137.849 rows=6,207 loops=1)

37. 7.014 99.620 ↓ 7,652.0 7,652 1

Nested Loop (cost=12.43..376.01 rows=1 width=124) (actual time=0.129..99.620 rows=7,652 loops=1)

38. 5.623 8.071 ↓ 7,685.0 7,685 1

Hash Join (cost=11.87..374.31 rows=1 width=159) (actual time=0.098..8.071 rows=7,685 loops=1)

  • Hash Cond: (chp_1.branch_uuid = cmd.uuid)
39. 2.388 2.388 ↑ 1.0 7,797 1

Seq Scan on contactview_chp chp_1 (cost=0.00..341.97 rows=7,797 width=140) (actual time=0.024..2.388 rows=7,797 loops=1)

40. 0.014 0.060 ↑ 2.2 22 1

Hash (cost=11.26..11.26 rows=49 width=52) (actual time=0.060..0.060 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
41. 0.046 0.046 ↑ 2.2 22 1

Index Scan using contactview_metadata_type on contactview_metadata cmd (cost=0.43..11.26 rows=49 width=52) (actual time=0.035..0.046 rows=22 loops=1)

  • Index Cond: (type = 'district_hospital'::text)
  • Filter: ((name <> 'HQ'::text) AND (name <> 'HQ OVC'::text))
  • Rows Removed by Filter: 2
42. 84.535 84.535 ↑ 1.0 1 7,685

Index Only Scan using contactview_metadata_uuid on contactview_metadata cmeta_1 (cost=0.56..1.70 rows=1 width=36) (actual time=0.011..0.011 rows=1 loops=7,685)

  • Index Cond: (uuid = chp_1.supervisor_uuid)
  • Heap Fetches: 1324
43. 30.608 30.608 ↓ 0.0 0 7,652

Index Only Scan using chp_muting_chw on chp_muting (cost=0.28..0.30 rows=1 width=36) (actual time=0.004..0.004 rows=0 loops=7,652)

  • Index Cond: (chw = chp_1.uuid)
  • Heap Fetches: 11
44. 12.414 12.414 ↑ 1.0 1 6,207

WindowAgg (cost=0.06..0.08 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=6,207)

45. 0.000 0.000 ↑ 1.0 1 6,207

Sort (cost=0.06..0.06 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=6,207)

  • Sort Key: generate_series_1.generate_series
  • Sort Method: quicksort Memory: 25kB
46. 0.015 0.015 ↑ 1.0 1 1

Function Scan on generate_series generate_series_1 (cost=0.04..0.05 rows=1 width=4) (actual time=0.014..0.015 rows=1 loops=1)

47. 1.667 447.409 ↓ 82.9 2,156 1

Sort (cost=1,127.17..1,127.24 rows=26 width=47) (actual time=447.065..447.409 rows=2,156 loops=1)

  • Sort Key: on_time_follow_ups.chw_uuid, on_time_follow_ups.interval_number
  • Sort Method: quicksort Memory: 379kB
48. 0.413 445.742 ↓ 82.9 2,156 1

Subquery Scan on on_time_follow_ups (cost=1,125.78..1,126.56 rows=26 width=47) (actual time=440.273..445.742 rows=2,156 loops=1)

49. 3.477 445.329 ↓ 82.9 2,156 1

GroupAggregate (cost=1,125.78..1,126.30 rows=26 width=47) (actual time=440.270..445.329 rows=2,156 loops=1)

  • Group Key: assess.chw, 0
50. 26.268 441.852 ↓ 437.2 11,368 1

Sort (cost=1,125.78..1,125.85 rows=26 width=39) (actual time=440.229..441.852 rows=11,368 loops=1)

  • Sort Key: assess.chw
  • Sort Method: quicksort Memory: 1273kB
51. 6.388 415.584 ↓ 437.2 11,368 1

Nested Loop (cost=0.88..1,125.17 rows=26 width=39) (actual time=0.156..415.584 rows=11,368 loops=1)

52. 171.812 171.812 ↓ 98.4 13,188 1

Index Scan using useview_assessment_reported_age_uuid on useview_assessment assess (cost=0.45..794.19 rows=134 width=80) (actual time=0.093..171.812 rows=13,188 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone) AND (patient_age_in_years < 5))
  • Filter: (referral_follow_up = 'true'::text)
  • Rows Removed by Filter: 80172
53. 237.384 237.384 ↑ 1.0 1 13,188

Index Scan using useview_assessment_follow_up_form_source_id on useview_assessment_follow_up follow_up (cost=0.43..2.46 rows=1 width=44) (actual time=0.017..0.018 rows=1 loops=13,188)

  • Index Cond: (form_source_id = assess.uuid)
  • Filter: ((date(date_trunc('day'::text, reported)) - date(date_trunc('day'::text, assess.reported))) <= 2)
  • Rows Removed by Filter: 0
54. 7.079 1,573.895 ↓ 4.5 3,557 1

Materialize (cost=863.99..1,129.46 rows=797 width=255) (actual time=490.174..1,573.895 rows=3,557 loops=1)

55. 1,050.323 1,566.816 ↓ 4.5 3,557 1

GroupAggregate (cost=863.99..1,119.49 rows=797 width=279) (actual time=490.167..1,566.816 rows=3,557 loops=1)

  • Group Key: useview_assessment.chw, 0
56. 356.008 516.493 ↓ 115.9 99,772 1

Sort (cost=863.99..866.14 rows=861 width=127) (actual time=489.475..516.493 rows=99,772 loops=1)

  • Sort Key: useview_assessment.chw
  • Sort Method: quicksort Memory: 29574kB
57. 160.485 160.485 ↓ 115.9 99,772 1

Index Scan using useview_assessment_reported on useview_assessment (cost=0.45..822.01 rows=861 width=127) (actual time=0.147..160.485 rows=99,772 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
58. 0.910 18.612 ↓ 7.7 1,780 1

Hash (cost=241.00..241.00 rows=231 width=87) (actual time=18.612..18.612 rows=1,780 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 231kB
59. 0.355 17.702 ↓ 7.7 1,780 1

Subquery Scan on pncvisit (cost=236.38..241.00 rows=231 width=87) (actual time=16.488..17.702 rows=1,780 loops=1)

60. 12.197 17.347 ↓ 7.7 1,780 1

HashAggregate (cost=236.38..238.69 rows=231 width=87) (actual time=16.485..17.347 rows=1,780 loops=1)

  • Group Key: useview_postnatal_care.chw, 0
61. 5.150 5.150 ↓ 12.8 3,015 1

Index Scan using useview_postnatal_care_count_reported_uuid on useview_postnatal_care (cost=0.44..217.50 rows=236 width=61) (actual time=0.073..5.150 rows=3,015 loops=1)

  • Index Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
62. 0.511 3,446.234 ↓ 5.8 1,153 1

Hash (cost=238,024.44..238,024.44 rows=200 width=47) (actual time=3,446.234..3,446.234 rows=1,153 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 110kB
63. 0.218 3,445.723 ↓ 5.8 1,153 1

Subquery Scan on eddnopnc (cost=238,020.44..238,024.44 rows=200 width=47) (actual time=3,445.112..3,445.723 rows=1,153 loops=1)

64. 1.805 3,445.505 ↓ 5.8 1,153 1

HashAggregate (cost=238,020.44..238,022.44 rows=200 width=47) (actual time=3,445.109..3,445.505 rows=1,153 loops=1)

  • Group Key: p.chw, 0
65. 2.832 3,443.700 ↑ 932.0 1,567 1

Hash Left Join (cost=225,097.82..227,067.56 rows=1,460,383 width=39) (actual time=3,377.224..3,443.700 rows=1,567 loops=1)

  • Hash Cond: (p.patient_id = useview_postnatal_care_1.patient_id)
  • Filter: (((max(useview_postnatal_care_1.reported)) IS NULL) OR ((@ ((CASE WHEN (max(pv.new_edd) <> ''::text) THEN (max(pv.new_edd))::date ELSE max(p.edd) END) - ((max(useview_postnatal_care_1.reported)))::date)) > 60))
  • Rows Removed by Filter: 709
66. 103.968 2,891.781 ↑ 2.8 2,276 1

HashAggregate (cost=201,312.69..203,200.29 rows=6,453 width=75) (actual time=2,827.138..2,891.781 rows=2,276 loops=1)

  • Group Key: p.chw, p.patient_id
  • Filter: ((max(p.edd) >= date_trunc('day'::text, date_trunc('month'::text, now()))) AND CASE WHEN (date_trunc('day'::text, now()) = date_trunc('day'::text, now())) THEN (max(p.edd) <= (now() - '3 days'::interval)) ELSE (max(p.edd) <= (now() + '1 day'::interval)) END)
  • Rows Removed by Filter: 38956
67. 55.958 2,787.813 ↓ 1.2 47,068 1

Merge Anti Join (cost=199,290.73..200,538.29 rows=38,720 width=82) (actual time=2,706.345..2,787.813 rows=47,068 loops=1)

  • Merge Cond: (p.patient_id = useview_pregnancy_visit_1.patient_id)
68. 371.411 1,987.539 ↓ 1.7 84,035 1

Sort (cost=96,208.09..96,328.86 rows=48,309 width=82) (actual time=1,967.194..1,987.539 rows=84,035 loops=1)

  • Sort Key: p.patient_id
  • Sort Method: quicksort Memory: 14890kB
69. 206.570 1,616.128 ↓ 1.7 84,035 1

Hash Join (cost=76,948.34..92,449.65 rows=48,309 width=82) (actual time=1,316.570..1,616.128 rows=84,035 loops=1)

  • Hash Cond: (p.patient_id = pv.patient_id)
  • Join Filter: (p.reported < pv.reported)
  • Rows Removed by Join Filter: 871
70. 93.111 93.111 ↓ 1.0 363,753 1

Seq Scan on useview_pregnancy p (cost=0.00..14,547.51 rows=363,351 width=83) (actual time=0.011..93.111 rows=363,753 loops=1)

71. 34.124 1,316.447 ↑ 1.7 72,669 1

Hash (cost=75,424.32..75,424.32 rows=121,922 width=51) (actual time=1,316.447..1,316.447 rows=72,669 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 7732kB
72. 15.098 1,282.323 ↑ 1.7 72,669 1

Subquery Scan on pv (cost=73,354.23..75,424.32 rows=121,922 width=51) (actual time=1,181.615..1,282.323 rows=72,669 loops=1)

73. 43.816 1,267.225 ↑ 1.7 72,669 1

Unique (cost=73,354.23..74,205.10 rows=121,922 width=83) (actual time=1,181.596..1,267.225 rows=72,669 loops=1)

74. 892.417 1,223.409 ↓ 1.1 183,983 1

Sort (cost=73,354.23..73,779.66 rows=170,173 width=83) (actual time=1,181.593..1,223.409 rows=183,983 loops=1)

  • Sort Key: useview_pregnancy_visit.patient_id, useview_pregnancy_visit.reported DESC
  • Sort Method: quicksort Memory: 32017kB
75. 284.813 330.992 ↓ 1.1 183,983 1

Bitmap Heap Scan on useview_pregnancy_visit (cost=5,793.76..58,569.05 rows=170,173 width=83) (actual time=51.642..330.992 rows=183,983 loops=1)

  • Recheck Cond: ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval)))
  • Filter: (((edd_updated = 'TRUE'::text) AND (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))) OR (reported > (now() - '9 mons'::interval)))
  • Rows Removed by Filter: 12821
  • Heap Blocks: exact=23339
76. 0.002 46.179 ↓ 0.0 0 1

BitmapOr (cost=5,793.76..5,793.76 rows=353,843 width=0) (actual time=46.179..46.179 rows=0 loops=1)

77. 25.627 25.627 ↓ 1.1 196,810 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,962.95 rows=183,669 width=0) (actual time=25.627..25.627 rows=196,810 loops=1)

  • Index Cond: (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))
78. 20.550 20.550 ↓ 1.1 183,989 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,745.73 rows=170,173 width=0) (actual time=20.550..20.550 rows=183,989 loops=1)

  • Index Cond: (reported > (now() - '9 mons'::interval))
79. 167.950 744.316 ↑ 1.5 41,193 1

Sort (cost=103,082.64..103,234.33 rows=60,675 width=44) (actual time=739.103..744.316 rows=41,193 loops=1)

  • Sort Key: useview_pregnancy_visit_1.patient_id, useview_pregnancy_visit_1.reported DESC
  • Sort Method: quicksort Memory: 4755kB
80. 6.030 576.366 ↑ 1.5 41,193 1

Append (cost=60,206.04..98,262.37 rows=60,675 width=44) (actual time=232.137..576.366 rows=41,193 loops=1)

81. 5.484 240.855 ↑ 1.4 16,174 1

Unique (cost=60,206.04..60,323.80 rows=22,505 width=44) (actual time=232.136..240.855 rows=16,174 loops=1)

82. 56.379 235.371 ↑ 1.4 16,759 1

Sort (cost=60,206.04..60,264.92 rows=23,552 width=44) (actual time=232.134..235.371 rows=16,759 loops=1)

  • Sort Key: useview_pregnancy_visit_1.patient_id
  • Sort Method: quicksort Memory: 2078kB
83. 135.812 178.992 ↑ 1.4 16,759 1

Bitmap Heap Scan on useview_pregnancy_visit useview_pregnancy_visit_1 (cost=5,720.45..58,495.74 rows=23,552 width=44) (actual time=48.445..178.992 rows=16,759 loops=1)

  • Recheck Cond: ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval)))
  • Filter: (continue_follow_up <> 'yes'::text)
  • Rows Removed by Filter: 180045
  • Heap Blocks: exact=23339
84. 0.002 43.180 ↓ 0.0 0 1

BitmapOr (cost=5,720.45..5,720.45 rows=353,843 width=0) (actual time=43.180..43.180 rows=0 loops=1)

85. 22.703 22.703 ↓ 1.1 196,810 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,962.95 rows=183,669 width=0) (actual time=22.703..22.703 rows=196,810 loops=1)

  • Index Cond: (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))
86. 20.475 20.475 ↓ 1.1 183,989 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,745.73 rows=170,173 width=0) (actual time=20.475..20.475 rows=183,989 loops=1)

  • Index Cond: (reported > (now() - '9 mons'::interval))
87. 8.745 329.481 ↑ 1.5 25,019 1

Unique (cost=36,791.63..37,028.45 rows=38,170 width=44) (actual time=315.139..329.481 rows=25,019 loops=1)

88. 99.282 320.736 ↑ 1.7 27,794 1

Sort (cost=36,791.63..36,910.04 rows=47,364 width=44) (actual time=315.137..320.736 rows=27,794 loops=1)

  • Sort Key: useview_delivery_check.patient_id
  • Sort Method: quicksort Memory: 2940kB
89. 221.454 221.454 ↑ 1.7 27,794 1

Seq Scan on useview_delivery_check (cost=0.00..33,113.46 rows=47,364 width=44) (actual time=0.043..221.454 rows=27,794 loops=1)

  • Filter: ((still_pregnant = 'no'::text) AND ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval))))
  • Rows Removed by Filter: 517765
90. 91.471 549.087 ↓ 1.3 170,343 1

Hash (cost=22,104.61..22,104.61 rows=134,442 width=44) (actual time=549.086..549.087 rows=170,343 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 15357kB
91. 161.051 457.616 ↓ 1.3 170,343 1

GroupAggregate (cost=0.42..20,760.19 rows=134,442 width=44) (actual time=1.006..457.616 rows=170,343 loops=1)

  • Group Key: useview_postnatal_care_1.patient_id
92. 296.565 296.565 ↓ 1.0 192,816 1

Index Scan using useview_postnatal_follow_up_count_patient_id on useview_postnatal_care useview_postnatal_care_1 (cost=0.42..18,452.40 rows=192,674 width=44) (actual time=0.048..296.565 rows=192,816 loops=1)

  • Index Cond: (follow_up_count = '1'::text)
93. 0.095 65.491 ↑ 1.8 207 1

Hash (cost=2,023.69..2,023.69 rows=372 width=47) (actual time=65.491..65.491 rows=207 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
94. 0.041 65.396 ↑ 1.8 207 1

Subquery Scan on communityevent (cost=2,012.41..2,023.69 rows=372 width=47) (actual time=65.141..65.396 rows=207 loops=1)

95. 0.188 65.355 ↑ 1.8 207 1

GroupAggregate (cost=2,012.41..2,019.97 rows=372 width=47) (actual time=65.139..65.355 rows=207 loops=1)

  • Group Key: meta.chw, 0
96. 0.627 65.167 ↑ 1.2 329 1

Sort (cost=2,012.41..2,013.37 rows=384 width=39) (actual time=65.125..65.167 rows=329 loops=1)

  • Sort Key: meta.chw
  • Sort Method: quicksort Memory: 50kB
97. 1.202 64.540 ↑ 1.2 329 1

Bitmap Heap Scan on form_metadata meta (cost=1,597.52..1,995.92 rows=384 width=39) (actual time=63.415..64.540 rows=329 loops=1)

  • Recheck Cond: ((formname = 'community_event'::text) AND (reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Heap Blocks: exact=263
98. 0.238 63.338 ↓ 0.0 0 1

BitmapAnd (cost=1,597.52..1,597.52 rows=384 width=0) (actual time=63.338..63.338 rows=0 loops=1)

99. 6.433 6.433 ↑ 1.0 59,055 1

Bitmap Index Scan on form_metadata_formname (cost=0.00..697.10 rows=59,805 width=0) (actual time=6.433..6.433 rows=59,055 loops=1)

  • Index Cond: (formname = 'community_event'::text)
100. 56.667 56.667 ↓ 6.9 477,713 1

Bitmap Index Scan on form_metadata_reported (cost=0.00..899.98 rows=69,053 width=0) (actual time=56.667..56.667 rows=477,713 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
101. 130.219 324,905.415 ↑ 1.0 1 6,207

Index Scan using contactview_chp_uuid on contactview_chp chp (cost=0.28..973.58 rows=1 width=40) (actual time=52.345..52.345 rows=1 loops=6,207)

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

SubPlan (for Index Scan)

103. 66.067 318,493.584 ↑ 1.0 1 6,207

Nested Loop Semi Join (cost=928.40..941.43 rows=1 width=0) (actual time=51.312..51.312 rows=1 loops=6,207)

  • Join Filter: (meta_1.formname = "*VALUES*_1".column1)
  • Rows Removed by Join Filter: 9
104. 422.076 318,406.686 ↑ 4.0 3 6,207

Bitmap Heap Scan on form_metadata meta_1 (cost=928.40..940.85 rows=12 width=14) (actual time=51.260..51.298 rows=3 loops=6,207)

  • Recheck Cond: ((chw = chp.uuid) AND (reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Heap Blocks: exact=19858
105. 887.622 317,984.610 ↓ 0.0 0 6,207

BitmapAnd (cost=928.40..928.40 rows=12 width=0) (actual time=51.230..51.230 rows=0 loops=6,207)

106. 2,395.902 2,395.902 ↑ 1.1 1,650 6,207

Bitmap Index Scan on form_metadata_chw (cost=0.00..28.16 rows=1,813 width=0) (actual time=0.386..0.386 rows=1,650 loops=6,207)

  • Index Cond: (chw = chp.uuid)
107. 314,701.086 314,701.086 ↓ 6.9 477,713 5,241

Bitmap Index Scan on form_metadata_reported (cost=0.00..899.98 rows=69,053 width=0) (actual time=60.046..60.046 rows=477,713 loops=5,241)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
108. 20.825 20.831 ↑ 1.0 3 20,831

Materialize (cost=0.00..0.05 rows=3 width=32) (actual time=0.000..0.001 rows=3 loops=20,831)

109. 0.006 0.006 ↑ 1.0 3 1

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

110. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=3,665.40..15,774.88 rows=4,604 width=35) (never executed)

111. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=0.05..0.08 rows=3 width=32) (never executed)

  • Group Key: "*VALUES*_2".column1
112. 0.000 0.000 ↓ 0.0 0

Values Scan on "*VALUES*_2" (cost=0.00..0.04 rows=3 width=32) (never executed)

113. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on form_metadata meta_2 (cost=3,665.36..5,242.92 rows=1,535 width=49) (never executed)

  • Recheck Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone) AND (formname = "*VALUES*_2".column1))
114. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=3,665.36..3,665.36 rows=1,535 width=0) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on form_metadata_reported (cost=0.00..899.98 rows=69,053 width=0) (never executed)

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

Bitmap Index Scan on form_metadata_formname (cost=0.00..2,747.47 rows=238,744 width=0) (never executed)

  • Index Cond: (formname = "*VALUES*_2".column1)
117. 640.675 640.675 ↓ 0.0 0 2,615

Index Scan using contactview_metadata_parent_uuid on contactview_metadata clinic (cost=0.56..14.06 rows=1 width=0) (actual time=0.245..0.245 rows=0 loops=2,615)

  • Index Cond: (parent_uuid = chp.area_uuid)
  • Filter: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Rows Removed by Filter: 80
118. 0.000 0.000 ↓ 0.0 0

Index Scan using contactview_metadata_reported on contactview_metadata clinic_1 (cost=0.45..12,615.93 rows=16,606 width=36) (never executed)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
119. 5,640.937 5,640.937 ↓ 0.0 0 2,549

Index Scan using useview_postnatal_reported_chw_patient_id on useview_postnatal_care pnc (cost=0.44..15.78 rows=1 width=0) (actual time=2.213..2.213 rows=0 loops=2,549)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone) AND (chw = chp.uuid))
  • Filter: (follow_up_count = '1'::text)
  • Rows Removed by Filter: 0
120. 0.000 0.000 ↓ 0.0 0

Index Scan using useview_postnatal_care_count_reported_uuid on useview_postnatal_care pnc_1 (cost=0.44..217.50 rows=236 width=35) (never executed)

  • Index Cond: ((follow_up_count = '1'::text) AND (reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
121. 0.646 85.326 ↓ 7.2 1,440 1

Hash (cost=185,081.60..185,081.60 rows=200 width=40) (actual time=85.326..85.326 rows=1,440 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 128kB
122. 0.343 84.680 ↓ 7.2 1,440 1

Subquery Scan on chp_visits (cost=185,053.90..185,081.60 rows=200 width=40) (actual time=82.998..84.680 rows=1,440 loops=1)

123. 0.557 84.337 ↓ 7.2 1,440 1

Unique (cost=185,053.90..185,079.60 rows=200 width=40) (actual time=82.996..84.337 rows=1,440 loops=1)

124. 0.586 83.780 ↓ 7.2 1,440 1

Group (cost=185,053.90..185,079.10 rows=200 width=40) (actual time=82.994..83.780 rows=1,440 loops=1)

  • Group Key: ((pat_clinic.doc #>> '{fields,inputs,contact,_id}'::text[])), 0
125. 4.061 83.194 ↑ 2.1 1,549 1

Sort (cost=185,053.90..185,062.13 rows=3,293 width=36) (actual time=82.986..83.194 rows=1,549 loops=1)

  • Sort Key: ((pat_clinic.doc #>> '{fields,inputs,contact,_id}'::text[]))
  • Sort Method: quicksort Memory: 170kB
126. 37.032 79.133 ↑ 2.1 1,549 1

Nested Loop (cost=0.46..184,861.51 rows=3,293 width=36) (actual time=0.327..79.133 rows=1,549 loops=1)

127. 0.005 0.015 ↑ 1.0 2 1

Unique (cost=0.04..0.04 rows=2 width=32) (actual time=0.009..0.015 rows=2 loops=1)

128. 0.008 0.010 ↑ 1.0 2 1

Sort (cost=0.04..0.04 rows=2 width=32) (actual time=0.009..0.010 rows=2 loops=1)

  • Sort Key: "*VALUES*".column1
  • Sort Method: quicksort Memory: 25kB
129. 0.002 0.002 ↑ 1.0 2 1

Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=32) (actual time=0.001..0.002 rows=2 loops=1)

130. 0.432 42.086 ↑ 306.8 774 2

Append (cost=0.42..90,052.09 rows=237,452 width=873) (actual time=0.153..21.043 rows=774 loops=2)

131. 0.016 0.016 ↓ 0.0 0 2

Index Scan using pat_clinic_expr_idx9 on pat_clinic (cost=0.42..2.97 rows=1 width=563) (actual time=0.008..0.008 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
132. 0.000 0.000 ↓ 0.0 0

Seq Scan on pat_data_record_ancr (cost=0.00..2.09 rows=1 width=32) (never executed)

  • Filter: (("*VALUES*".column1 = (doc ->> 'form'::text)) AND (f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
133. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_ancv_f_cast_isots_idx on pat_data_record_ancv (cost=0.15..2.17 rows=1 width=32) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
134. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_anc_follow_up_f_cast_isots_idx on pat_data_record_anc_follow_up (cost=0.44..2,547.23 rows=2,971 width=1,443) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
135. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_assessment_f_cast_isots_idx on pat_data_record_assessment (cost=0.45..27,506.54 rows=40,417 width=80) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
136. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_assessment_cbds_f_cast_isots_idx on pat_data_record_assessment_cbds (cost=0.30..126.84 rows=272 width=29) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
137. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_assessment_follow_up_f_cast_isots_idx on pat_data_record_assessment_follow_up (cost=0.45..4,843.81 rows=5,508 width=1,198) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
138. 41.383 41.383 ↓ 9.1 1,480 1

Index Scan using pat_data_record_chp_visit_f_cast_isots_idx on pat_data_record_chp_visit (cost=0.31..151.02 rows=163 width=31) (actual time=0.229..41.383 rows=1,480 loops=1)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
139. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_community_event_f_cast_isots_idx on pat_data_record_community_event (cost=0.31..28.96 rows=27 width=905) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
140. 0.145 0.145 ↓ 2.9 69 1

Index Scan using pat_data_record_community_events_f_cast_isots_idx on pat_data_record_community_events (cost=0.30..25.90 rows=24 width=1,329) (actual time=0.019..0.145 rows=69 loops=1)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
141. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_death_report_f_cast_isots_idx on pat_data_record_death_report (cost=0.29..25.96 rows=84 width=1,648) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
142. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_death_report_approval_request_f_cast_isots_idx on pat_data_record_death_report_approval_request (cost=0.29..15.71 rows=73 width=1,021) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
143. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_death_report_confirmation_f_cast_isots_idx on pat_data_record_death_report_confirmation (cost=0.17..10.01 rows=28 width=1,884) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
144. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_delivery_check_f_cast_isots_idx on pat_data_record_delivery_check (cost=0.45..1,464.14 rows=1,673 width=1,820) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
145. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_ecd_assessment_f_cast_isots_idx on pat_data_record_ecd_assessment (cost=0.30..9.38 rows=8 width=72) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
146. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_ecd_follow_up_f_cast_isots_idx on pat_data_record_ecd_follow_up (cost=0.30..5.30 rows=4 width=1,730) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
147. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_family_survey_f_cast_isots_idx on pat_data_record_family_survey (cost=0.45..329.95 rows=321 width=316) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
148. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_fp_follow_up_long_term_f_cast_isots_idx on pat_data_record_fp_follow_up_long_term (cost=0.30..234.53 rows=648 width=1,677) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
149. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_fp_follow_up_prospective_f_cast_isots_idx on pat_data_record_fp_follow_up_prospective (cost=0.31..1,460.04 rows=7,415 width=559) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
150. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_fp_follow_up_refill_f_cast_isots_idx on pat_data_record_fp_follow_up_refill (cost=0.31..404.94 rows=2,232 width=318) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
151. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_fp_follow_up_short_term_f_cast_isots_idx on pat_data_record_fp_follow_up_short_term (cost=0.31..3,356.91 rows=6,410 width=1,536) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
152. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_fp_visit_f_cast_isots_idx on pat_data_record_fp_visit (cost=0.44..1,782.86 rows=9,163 width=261) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
153. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_home_visit_f_cast_isots_idx on pat_data_record_home_visit (cost=0.45..24,218.97 rows=107,842 width=1,290) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
154. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_household_mute_f_cast_isots_idx on pat_data_record_household_mute (cost=0.30..1,330.69 rows=4,499 width=1,751) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
155. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_household_mute_task_f_cast_isots_idx on pat_data_record_household_mute_task (cost=0.30..1,292.33 rows=4,719 width=1,818) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
156. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_hub_spoke_f_cast_isots_idx on pat_data_record_hub_spoke (cost=0.30..14.43 rows=13 width=1,195) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
157. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_immunization_follow_up_f_cast_isots_idx on pat_data_record_immunization_follow_up (cost=0.31..159.43 rows=155 width=1,296) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
158. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_immunization_ug_f_cast_isots_idx on pat_data_record_immunization_ug (cost=0.44..4,360.10 rows=14,705 width=1,764) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
159. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_immunization_ug_follow_up_f_cast_isots_idx on pat_data_record_immunization_ug_follow_up (cost=0.31..1,145.69 rows=4,604 width=1,524) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
160. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on pat_data_record_it_support (cost=3.42..4.97 rows=1 width=1,005) (never executed)

  • Recheck Cond: (((doc ->> 'form'::text) = "*VALUES*".column1) AND (f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
161. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=3.42..3.42 rows=1 width=0) (never executed)

162. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_it_support_expr_idx9 (cost=0.00..1.53 rows=33 width=0) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
163. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_it_support_f_cast_isots_idx (cost=0.00..1.63 rows=33 width=0) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
164. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on pat_data_record_mini_hub (cost=2.91..4.46 rows=1 width=1,218) (never executed)

  • Recheck Cond: (((doc ->> 'form'::text) = "*VALUES*".column1) AND (f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
165. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=2.91..2.91 rows=1 width=0) (never executed)

166. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_mini_hub_expr_idx9 (cost=0.00..1.32 rows=5 width=0) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
167. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_mini_hub_f_cast_isots_idx (cost=0.00..1.35 rows=5 width=0) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
168. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_muac_follow_up_f_cast_isots_idx on pat_data_record_muac_follow_up (cost=0.31..64.28 rows=62 width=1,393) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
169. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_mute_person_f_cast_isots_idx on pat_data_record_mute_person (cost=0.30..423.95 rows=1,486 width=1,728) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
170. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_muting_approve_request_f_cast_isots_idx on pat_data_record_muting_approve_request (cost=0.31..864.56 rows=6,045 width=781) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
171. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_muting_approved_f_cast_isots_idx on pat_data_record_muting_approved (cost=0.30..664.81 rows=4,799 width=817) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
172. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_nutrition_assessment_f_cast_isots_idx on pat_data_record_nutrition_assessment (cost=0.44..7,607.56 rows=8,680 width=1,773) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
173. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_ovc_survey_f_cast_isots_idx on pat_data_record_ovc_survey (cost=0.30..3.11 rows=2 width=695) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
174. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_postnatal_care_f_cast_isots_idx on pat_data_record_postnatal_care (cost=0.44..517.90 rows=520 width=210) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
175. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_postnatal_care_cbds_f_cast_isots_idx on pat_data_record_postnatal_care_cbds (cost=0.30..5.31 rows=4 width=46) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
176. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_pregnancy_f_cast_isots_idx on pat_data_record_pregnancy (cost=0.44..99.87 rows=98 width=68) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
177. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_pregnancy_referral_follow_up_f_cast_isots_idx on pat_data_record_pregnancy_referral_follow_up (cost=0.31..75.55 rows=73 width=1,017) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
178. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_pregnancy_visit_f_cast_isots_idx on pat_data_record_pregnancy_visit (cost=0.45..1,004.72 rows=1,045 width=49) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
179. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_prophylaxis_follow_up_f_cast_isots_idx on pat_data_record_prophylaxis_follow_up (cost=0.31..615.02 rows=634 width=1,451) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
180. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_symptom_report_f_cast_isots_idx on pat_data_record_symptom_report (cost=0.17..3.22 rows=1 width=18) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
181. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_data_record_u1_follow_up_f_cast_isots_idx on pat_data_record_u1_follow_up (cost=0.31..2.33 rows=1 width=1,113) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Filter: ("*VALUES*".column1 = (doc ->> 'form'::text))
182. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on pat_data_record_default (cost=4.34..17.24 rows=9 width=916) (never executed)

  • Recheck Cond: (((doc ->> 'form'::text) = "*VALUES*".column1) AND (f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
183. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=4.34..4.34 rows=9 width=0) (never executed)

184. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_default_expr_idx9 (cost=0.00..1.61 rows=45 width=0) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
185. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_default_f_cast_isots_idx (cost=0.00..2.44 rows=115 width=0) (never executed)

  • Index Cond: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
186. 0.006 0.006 ↓ 0.0 0 2

Index Scan using pat_district_hospital_expr_idx9 on pat_district_hospital (cost=0.14..2.69 rows=1 width=32) (actual time=0.003..0.003 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
187. 0.008 0.008 ↓ 0.0 0 2

Index Scan using pat_feedback_expr_idx9 on pat_feedback (cost=0.29..2.84 rows=1 width=676) (actual time=0.004..0.004 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
188. 0.004 0.004 ↓ 0.0 0 2

Index Scan using pat_form_expr_idx9 on pat_form (cost=0.14..2.69 rows=1 width=620) (actual time=0.002..0.002 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
189. 0.014 0.014 ↓ 0.0 0 2

Index Scan using pat_health_center_expr_idx9 on pat_health_center (cost=0.28..2.83 rows=1 width=688) (actual time=0.007..0.007 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
190. 0.024 0.024 ↓ 0.0 0 2

Index Scan using pat_info_expr_idx9 on pat_info (cost=0.43..2.98 rows=1 width=292) (actual time=0.012..0.012 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
191. 0.014 0.014 ↓ 0.0 0 2

Seq Scan on pat_meta (cost=0.00..1.54 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=2)

  • Filter: (("*VALUES*".column1 = (doc ->> 'form'::text)) AND (f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Rows Removed by Filter: 1
192. 0.014 0.014 ↓ 0.0 0 2

Index Scan using pat_person_expr_idx9 on pat_person (cost=0.43..2.98 rows=1 width=655) (actual time=0.007..0.007 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
193. 0.008 0.008 ↓ 0.0 0 2

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats (cost=0.28..2.83 rows=1 width=599) (actual time=0.004..0.004 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
194. 0.008 0.008 ↓ 0.0 0 2

Index Scan using pat_usage_stats_expr_idx9 on pat_usage_stats (cost=0.14..2.69 rows=1 width=1,078) (actual time=0.004..0.004 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
195. 0.010 0.010 ↓ 0.0 0 2

Index Scan using couchdb_default_expr_idx9 on couchdb_default (cost=0.42..2.97 rows=1 width=808) (actual time=0.005..0.005 rows=0 loops=2)

  • Index Cond: ((doc ->> 'form'::text) = "*VALUES*".column1)
  • Filter: ((f_cast_isots((doc ->> 'reported_date'::text)) >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (f_cast_isots((doc ->> 'reported_date'::text)) < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
196. 0.794 95.287 ↑ 1.4 1,663 1

Hash (cost=5,223.48..5,223.48 rows=2,289 width=47) (actual time=95.287..95.287 rows=1,663 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 167kB
197. 0.388 94.493 ↑ 1.4 1,663 1

Subquery Scan on fp (cost=4,823.82..5,223.48 rows=2,289 width=47) (actual time=74.348..94.493 rows=1,663 loops=1)

198. 16.026 94.105 ↑ 1.4 1,663 1

GroupAggregate (cost=4,823.82..5,200.59 rows=2,289 width=47) (actual time=74.345..94.105 rows=1,663 loops=1)

  • Group Key: visit_1.chw, 0
199. 53.364 78.079 ↓ 1.0 20,447 1

Sort (cost=4,823.82..4,874.37 rows=20,222 width=80) (actual time=74.237..78.079 rows=20,447 loops=1)

  • Sort Key: visit_1.chw
  • Sort Method: quicksort Memory: 3693kB
200. 24.715 24.715 ↓ 1.0 20,447 1

Index Scan using useview_fp_visit_reported_xmlforms_uuid on useview_fp_visit visit_1 (cost=0.44..3,377.58 rows=20,222 width=80) (actual time=0.056..24.715 rows=20,447 loops=1)

  • Index Cond: ((reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
201. 4,050.181 5,009.049 ↓ 1.0 6,061 6,207

Materialize (cost=0.55..67,113.57 rows=6,003 width=48) (actual time=0.000..0.807 rows=6,061 loops=6,207)

202. 2.289 958.868 ↓ 1.5 9,144 1

Subquery Scan on sync (cost=0.55..67,083.56 rows=6,003 width=48) (actual time=0.080..958.868 rows=9,144 loops=1)

203. 351.170 956.579 ↓ 1.5 9,144 1

GroupAggregate (cost=0.55..67,023.53 rows=6,003 width=48) (actual time=0.078..956.579 rows=9,144 loops=1)

  • Group Key: useview_chp_sync.chw_uuid, 0
204. 605.409 605.409 ↓ 1.1 1,962,343 1

Index Only Scan using useview_chp_sync_chw_uuid_latest_replication_date on useview_chp_sync (cost=0.55..53,723.16 rows=1,757,374 width=48) (actual time=0.057..605.409 rows=1,962,343 loops=1)

  • Heap Fetches: 0
Execution time : 363,288.453 ms