explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xT9w

Settings
# exclusive inclusive rows x rows loops node
1. 167.771 215,763.389 ↓ 2,760.4 13,802 1

GroupAggregate (cost=1,055,506.17..1,055,516.03 rows=5 width=389) (actual time=215,593.666..215,763.389 rows=13,802 loops=1)

  • Group Key: chwlist.branch_uuid, chwlist.branch_name, chwlist.supervisor_uuid, chwlist.supervisor_name, chwlist.chw_uuid, chwlist.chw_name, chwlist.chw_phone, (date(chwlist.interval_start)), chwlist.interval_number
  • Functions: 822
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 111.120 ms, Inlining 56.941 ms, Optimization 6313.491 ms, Emission 4351.427 ms, Total 10832.979 ms
2. 91.460 215,595.618 ↓ 373.0 13,802 1

Sort (cost=1,055,506.17..1,055,506.27 rows=37 width=577) (actual time=215,593.581..215,595.618 rows=13,802 loops=1)

  • Sort Key: chwlist.branch_uuid, chwlist.branch_name, chwlist.supervisor_uuid, chwlist.supervisor_name, chwlist.chw_uuid, chwlist.chw_name, chwlist.chw_phone, (date(chwlist.interval_start)), chwlist.interval_number
  • Sort Method: quicksort Memory: 5,831kB
3. 31.840 215,504.158 ↓ 373.0 13,802 1

Merge Left Join (cost=963,612.56..1,055,505.21 rows=37 width=577) (actual time=22,316.630..215,504.158 rows=13,802 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_chp_sync.chw_uuid)
  • Join Filter: ((0) = chwlist.interval_number)
4. 27.398 214,229.787 ↓ 373.0 13,802 1

Merge Left Join (cost=963,612.01..970,226.56 rows=37 width=573) (actual time=22,316.566..214,229.787 rows=13,802 loops=1)

  • Merge Cond: (chwlist.chw_uuid = visit_1.chw)
  • Join Filter: ((0) = chwlist.interval_number)
5. 49.143 214,115.248 ↓ 373.0 13,802 1

Nested Loop Left Join (cost=955,318.29..961,598.11 rows=37 width=565) (actual time=22,268.925..214,115.248 rows=13,802 loops=1)

  • Join Filter: (chwlist.interval_number = 0)
6. 27.653 22,301.117 ↓ 373.0 13,802 1

Merge Left Join (cost=955,318.01..955,318.60 rows=37 width=561) (actual time=22,267.490..22,301.117 rows=13,802 loops=1)

  • Merge Cond: ((chwlist.chw_uuid = communityevent.chw_uuid) AND (chwlist.interval_number = communityevent.interval_number))
7. 17.582 22,239.788 ↓ 373.0 13,802 1

Sort (cost=954,438.80..954,438.89 rows=37 width=553) (actual time=22,233.814..22,239.788 rows=13,802 loops=1)

  • Sort Key: chwlist.chw_uuid, chwlist.interval_number
  • Sort Method: quicksort Memory: 5,662kB
8. 1,778.646 22,222.206 ↓ 373.0 13,802 1

Merge Left Join (cost=954,434.87..954,437.83 rows=37 width=553) (actual time=19,459.526..22,222.206 rows=13,802 loops=1)

  • Merge Cond: (chwlist.interval_number = chp_visits.interval_number)
  • Join Filter: (chp_visits.chw_area_uuid = chwlist.chw_area_uuid)
  • Rows Removed by Join Filter: 18,367,882
9. 8.255 17,001.642 ↓ 373.0 13,802 1

Merge Left Join (cost=382,019.27..382,020.67 rows=37 width=585) (actual time=16,990.680..17,001.642 rows=13,802 loops=1)

  • Merge Cond: ((chwlist.interval_number = pncvisit.interval_number) AND (chwlist.chw_uuid = pncvisit.chw_uuid))
10. 56.297 16,980.101 ↓ 373.0 13,802 1

Sort (cost=381,857.98..381,858.07 rows=37 width=537) (actual time=16,977.641..16,980.101 rows=13,802 loops=1)

  • Sort Key: chwlist.interval_number, chwlist.chw_uuid
  • Sort Method: quicksort Memory: 7,517kB
11. 4.139 16,923.804 ↓ 373.0 13,802 1

Hash Left Join (cost=373,654.03..381,857.02 rows=37 width=537) (actual time=16,903.779..16,923.804 rows=13,802 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = eddnopnc.chw_uuid) AND (chwlist.interval_number = eddnopnc.interval_number))
12. 4.064 14,234.299 ↓ 373.0 13,802 1

Hash Left Join (cost=127,061.96..135,264.75 rows=37 width=529) (actual time=14,218.398..14,234.299 rows=13,802 loops=1)

  • Hash Cond: ((chwlist.chw_uuid = allpreg.chw_uuid) AND (chwlist.interval_number = allpreg.interval_number))
13. 7.992 14,225.262 ↓ 373.0 13,802 1

Hash Right Join (cost=126,833.04..135,035.65 rows=37 width=521) (actual time=14,213.411..14,225.262 rows=13,802 loops=1)

  • Hash Cond: ((cmeta.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
14. 226.982 1,800.409 ↑ 44.6 6,682 1

HashAggregate (cost=115,788.19..118,770.82 rows=298,263 width=56) (actual time=1,796.537..1,800.409 rows=6,682 loops=1)

  • Group Key: cmeta.parent_uuid, 0
15. 434.678 1,573.427 ↑ 1.0 919,885 1

Hash Left Join (cost=68,573.43..106,547.77 rows=924,042 width=76) (actual time=882.888..1,573.427 rows=919,885 loops=1)

  • Hash Cond: (cmeta.uuid = useview_family_survey.family_id)
16. 256.558 256.558 ↑ 1.0 919,885 1

Index Scan using contactview_metadata_type on contactview_metadata cmeta (cost=0.43..35,549.17 rows=924,042 width=72) (actual time=0.041..256.558 rows=919,885 loops=1)

  • Index Cond: (type = 'clinic'::text)
17. 147.738 882.191 ↓ 1.1 603,507 1

Hash (cost=61,859.45..61,859.45 rows=537,084 width=36) (actual time=882.191..882.191 rows=603,507 loops=1)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 48,858kB
18. 445.220 734.453 ↓ 1.1 603,507 1

HashAggregate (cost=51,117.77..56,488.61 rows=537,084 width=36) (actual time=603.320..734.453 rows=603,507 loops=1)

  • Group Key: useview_family_survey.family_id
19. 289.233 289.233 ↓ 1.0 864,078 1

Seq Scan on useview_family_survey (cost=0.00..48,973.56 rows=857,683 width=36) (actual time=0.032..289.233 rows=864,078 loops=1)

  • Filter: is_equity_survey
  • Rows Removed by Filter: 428,316
20. 10.714 12,416.861 ↓ 2,760.4 13,802 1

Hash (cost=11,044.78..11,044.78 rows=5 width=469) (actual time=12,416.861..12,416.861 rows=13,802 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 4,027kB
21. 7.863 12,406.147 ↓ 2,760.4 13,802 1

Merge Left Join (cost=10,263.23..11,044.78 rows=5 width=469) (actual time=11,816.156..12,406.147 rows=13,802 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_assessment.chw)
  • Join Filter: (chwlist.interval_number = (0))
22. 7.383 11,500.409 ↓ 2,760.4 13,802 1

Merge Left Join (cost=8,379.37..8,379.96 rows=5 width=229) (actual time=11,490.378..11,500.409 rows=13,802 loops=1)

  • Merge Cond: ((chwlist.chw_uuid = on_time_follow_ups.chw_uuid) AND (chwlist.interval_number = on_time_follow_ups.interval_number))
23. 32.227 10,861.897 ↓ 2,760.4 13,802 1

Sort (cost=5,637.17..5,637.18 rows=5 width=221) (actual time=10,859.405..10,861.897 rows=13,802 loops=1)

  • Sort Key: chwlist.chw_uuid, chwlist.interval_number
  • Sort Method: quicksort Memory: 4,054kB
24. 3.410 10,829.670 ↓ 2,760.4 13,802 1

Hash Right Join (cost=5,600.28..5,637.11 rows=5 width=221) (actual time=10,825.834..10,829.670 rows=13,802 loops=1)

  • Hash Cond: ((contactview_metadata.parent_uuid = chwlist.chw_area_uuid) AND ((0) = chwlist.interval_number))
25. 3.914 116.966 ↓ 1.5 2,031 1

HashAggregate (cost=4,873.08..4,886.47 rows=1,339 width=48) (actual time=116.529..116.966 rows=2,031 loops=1)

  • Group Key: contactview_metadata.parent_uuid, 0
26. 113.052 113.052 ↓ 8.4 11,308 1

Index Scan using contactview_metadata_reported on contactview_metadata (cost=0.45..4,863.02 rows=1,342 width=40) (actual time=0.129..113.052 rows=11,308 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: 40,287
27. 5.631 10,709.294 ↓ 2,760.4 13,802 1

Hash (cost=727.12..727.12 rows=5 width=213) (actual time=10,709.294..10,709.294 rows=13,802 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3,356kB
28. 1.484 10,703.663 ↓ 2,760.4 13,802 1

Subquery Scan on chwlist (cost=688.27..727.12 rows=5 width=213) (actual time=10,699.856..10,703.663 rows=13,802 loops=1)

29. 2.350 10,702.179 ↓ 2,760.4 13,802 1

Hash Join (cost=688.27..727.07 rows=5 width=213) (actual time=10,699.854..10,702.179 rows=13,802 loops=1)

  • Hash Cond: ((row_number() OVER (?)) = (row_number() OVER (?)))
30. 0.008 10,511.365 ↑ 1,000.0 1 1

WindowAgg (cost=59.84..84.84 rows=1,000 width=24) (actual time=10,511.363..10,511.365 rows=1 loops=1)

31. 0.005 10,511.357 ↑ 1,000.0 1 1

Sort (cost=59.84..62.34 rows=1,000 width=8) (actual time=10,511.356..10,511.357 rows=1 loops=1)

  • Sort Key: generate_series.generate_series
  • Sort Method: quicksort Memory: 25kB
32. 10,511.352 10,511.352 ↑ 1,000.0 1 1

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

33. 6.398 188.464 ↓ 13,802.0 13,802 1

Hash (cost=628.42..628.42 rows=1 width=213) (actual time=188.464..188.464 rows=13,802 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3,356kB
34. 3.975 182.066 ↓ 13,802.0 13,802 1

Nested Loop (cost=4.20..628.42 rows=1 width=213) (actual time=0.172..182.066 rows=13,802 loops=1)

35. 0.000 164.289 ↓ 13,802.0 13,802 1

Nested Loop Anti Join (cost=4.14..628.32 rows=1 width=201) (actual time=0.152..164.289 rows=13,802 loops=1)

36. 2.474 119.220 ↓ 15,251.0 15,251 1

Nested Loop (cost=3.86..628.00 rows=1 width=201) (actual time=0.135..119.220 rows=15,251 loops=1)

37. 6.186 9.758 ↓ 15,284.0 15,284 1

Hash Join (cost=3.31..625.76 rows=1 width=185) (actual time=0.100..9.758 rows=15,284 loops=1)

  • Hash Cond: (chp_1.branch_uuid = cmd.uuid)
38. 3.499 3.499 ↑ 1.0 15,402 1

Seq Scan on contactview_chp chp_1 (cost=0.00..582.02 rows=15,402 width=166) (actual time=0.018..3.499 rows=15,402 loops=1)

39. 0.009 0.073 ↑ 1.1 23 1

Hash (cost=2.99..2.99 rows=25 width=52) (actual time=0.073..0.073 rows=23 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
40. 0.064 0.064 ↑ 1.1 23 1

Index Scan using contactview_metadata_type on contactview_metadata cmd (cost=0.43..2.99 rows=25 width=52) (actual time=0.043..0.064 rows=23 loops=1)

  • Index Cond: (type = 'district_hospital'::text)
  • Filter: ((name <> 'HQ'::text) AND (name <> 'HQ OVC'::text))
  • Rows Removed by Filter: 2
41. 106.988 106.988 ↑ 1.0 1 15,284

Index Scan using contactview_metadata_uuid on contactview_metadata cmeta_1 (cost=0.56..2.25 rows=1 width=52) (actual time=0.007..0.007 rows=1 loops=15,284)

  • Index Cond: (uuid = chp_1.supervisor_uuid)
42. 45.753 45.753 ↓ 0.0 0 15,251

Index Only Scan using chp_muting_chw on chp_muting (cost=0.28..0.30 rows=1 width=36) (actual time=0.003..0.003 rows=0 loops=15,251)

  • Index Cond: (chw = chp_1.uuid)
  • Heap Fetches: 103
43. 13.802 13.802 ↑ 1.0 1 13,802

WindowAgg (cost=0.06..0.08 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=13,802)

44. 0.000 0.000 ↑ 1.0 1 13,802

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

  • Sort Key: generate_series_1.generate_series
  • Sort Method: quicksort Memory: 25kB
45. 0.010 0.010 ↑ 1.0 1 1

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

46. 1.137 631.129 ↓ 39.2 2,858 1

Sort (cost=2,742.20..2,742.38 rows=73 width=48) (actual time=630.946..631.129 rows=2,858 loops=1)

  • Sort Key: on_time_follow_ups.chw_uuid, on_time_follow_ups.interval_number
  • Sort Method: quicksort Memory: 469kB
47. 0.279 629.992 ↓ 39.2 2,858 1

Subquery Scan on on_time_follow_ups (cost=2,737.75..2,739.94 rows=73 width=48) (actual time=623.252..629.992 rows=2,858 loops=1)

48. 4.240 629.713 ↓ 39.2 2,858 1

GroupAggregate (cost=2,737.75..2,739.21 rows=73 width=48) (actual time=623.250..629.713 rows=2,858 loops=1)

  • Group Key: assess.chw, 0
49. 48.169 625.473 ↓ 462.5 33,762 1

Sort (cost=2,737.75..2,737.93 rows=73 width=40) (actual time=623.227..625.473 rows=33,762 loops=1)

  • Sort Key: assess.chw
  • Sort Method: quicksort Memory: 4,174kB
50. 36.638 577.304 ↓ 462.5 33,762 1

Nested Loop (cost=1.01..2,735.49 rows=73 width=40) (actual time=0.136..577.304 rows=33,762 loops=1)

51. 166.392 166.392 ↓ 110.9 41,586 1

Index Scan using useview_assessment_reported on useview_assessment assess (cost=0.45..1,765.43 rows=375 width=81) (actual time=0.091..166.392 rows=41,586 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: ((patient_age_in_years < 5) AND (referral_follow_up = 'true'::text))
  • Rows Removed by Filter: 69,644
52. 374.274 374.274 ↑ 1.0 1 41,586

Index Scan using useview_assessment_follow_up_form_source_id on useview_assessment_follow_up follow_up (cost=0.56..2.58 rows=1 width=44) (actual time=0.009..0.009 rows=1 loops=41,586)

  • 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
53. 4.629 897.875 ↓ 1.9 3,602 1

Materialize (cost=1,883.86..2,659.44 rows=1,906 width=280) (actual time=325.771..897.875 rows=3,602 loops=1)

54. 549.295 893.246 ↓ 1.9 3,602 1

GroupAggregate (cost=1,883.86..2,635.61 rows=1,906 width=304) (actual time=325.767..893.246 rows=3,602 loops=1)

  • Group Key: useview_assessment.chw, 0
55. 219.615 343.951 ↓ 47.8 111,230 1

Sort (cost=1,883.86..1,889.68 rows=2,326 width=129) (actual time=325.562..343.951 rows=111,230 loops=1)

  • Sort Key: useview_assessment.chw
  • Sort Method: quicksort Memory: 32,609kB
56. 124.336 124.336 ↓ 47.8 111,230 1

Index Scan using useview_assessment_reported on useview_assessment (cost=0.45..1,753.80 rows=2,326 width=129) (actual time=0.048..124.336 rows=111,230 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))
57. 0.409 4.973 ↓ 6.2 1,449 1

Hash (cost=225.42..225.42 rows=233 width=47) (actual time=4.973..4.973 rows=1,449 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 135kB
58. 0.163 4.564 ↓ 6.2 1,449 1

Subquery Scan on allpreg (cost=220.76..225.42 rows=233 width=47) (actual time=4.123..4.564 rows=1,449 loops=1)

59. 1.517 4.401 ↓ 6.2 1,449 1

HashAggregate (cost=220.76..223.09 rows=233 width=47) (actual time=4.121..4.401 rows=1,449 loops=1)

  • Group Key: visit.chw, 0
60. 2.884 2.884 ↓ 14.9 3,557 1

Index Scan using useview_pregnancy_reported on useview_pregnancy visit (cost=0.44..218.97 rows=238 width=39) (actual time=0.068..2.884 rows=3,557 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))
61. 0.249 2,685.366 ↓ 5.7 1,147 1

Hash (cost=246,589.07..246,589.07 rows=200 width=47) (actual time=2,685.366..2,685.366 rows=1,147 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 110kB
62. 0.107 2,685.117 ↓ 5.7 1,147 1

Subquery Scan on eddnopnc (cost=246,585.07..246,589.07 rows=200 width=47) (actual time=2,684.796..2,685.117 rows=1,147 loops=1)

63. 0.862 2,685.010 ↓ 5.7 1,147 1

HashAggregate (cost=246,585.07..246,587.07 rows=200 width=47) (actual time=2,684.794..2,685.010 rows=1,147 loops=1)

  • Group Key: p.chw, 0
64. 6.447 2,684.148 ↑ 708.7 1,509 1

Hash Left Join (cost=236,326.26..238,563.80 rows=1,069,503 width=39) (actual time=2,646.153..2,684.148 rows=1,509 loops=1)

  • Hash Cond: (p.patient_id = useview_postnatal_care.patient_id)
  • Filter: (((NOT (hashed SubPlan 7)) AND ((max(useview_postnatal_care.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.reported)))::date)) > 60))
  • Rows Removed by Filter: 749
65. 57.364 2,090.026 ↑ 3.2 2,258 1

HashAggregate (cost=212,268.02..214,412.14 rows=7,330 width=75) (actual time=2,053.723..2,090.026 rows=2,258 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: 38,586
66. 31.607 2,032.662 ↓ 1.1 47,142 1

Merge Anti Join (cost=210,584.36..211,388.38 rows=43,982 width=83) (actual time=1,985.707..2,032.662 rows=47,142 loops=1)

  • Merge Cond: (p.patient_id = useview_pregnancy_visit_1.patient_id)
67. 204.614 1,306.467 ↓ 1.7 83,347 1

Sort (cost=102,025.13..102,147.92 rows=49,114 width=83) (actual time=1,293.492..1,306.467 rows=83,347 loops=1)

  • Sort Key: p.patient_id
  • Sort Method: quicksort Memory: 14,793kB
68. 112.969 1,101.853 ↓ 1.7 83,347 1

Hash Join (cost=81,775.35..98,198.21 rows=49,114 width=83) (actual time=907.449..1,101.853 rows=83,347 loops=1)

  • Hash Cond: (p.patient_id = pv.patient_id)
  • Join Filter: (p.reported < pv.reported)
  • Rows Removed by Join Filter: 739
69. 81.535 81.535 ↓ 1.0 387,536 1

Seq Scan on useview_pregnancy p (cost=0.00..15,406.57 rows=387,157 width=83) (actual time=0.010..81.535 rows=387,536 loops=1)

70. 17.479 907.349 ↑ 1.7 71,253 1

Hash (cost=80,236.04..80,236.04 rows=123,145 width=52) (actual time=907.349..907.349 rows=71,253 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 7,876kB
71. 7.690 889.870 ↑ 1.7 71,253 1

Subquery Scan on pv (cost=78,160.79..80,236.04 rows=123,145 width=52) (actual time=831.419..889.870 rows=71,253 loops=1)

72. 23.613 882.180 ↑ 1.7 71,253 1

Unique (cost=78,160.79..79,004.59 rows=123,145 width=84) (actual time=831.408..882.180 rows=71,253 loops=1)

73. 504.996 858.567 ↓ 1.0 177,029 1

Sort (cost=78,160.79..78,582.69 rows=168,759 width=84) (actual time=831.406..858.567 rows=177,029 loops=1)

  • Sort Key: useview_pregnancy_visit.patient_id, useview_pregnancy_visit.reported DESC
  • Sort Method: quicksort Memory: 31,039kB
74. 269.869 353.571 ↓ 1.0 177,029 1

Bitmap Heap Scan on useview_pregnancy_visit (cost=6,276.89..63,508.63 rows=168,759 width=84) (actual time=92.166..353.571 rows=177,029 loops=1)

  • Recheck Cond: ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval)))
  • Filter: (((NOT (hashed SubPlan 8)) AND (edd_updated = 'TRUE'::text) AND (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))) OR (reported > (now() - '9 mons'::interval)))
  • Rows Removed by Filter: 17,682
  • Heap Blocks: exact=24,654
75. 0.003 30.071 ↓ 0.0 0 1

BitmapOr (cost=5,686.96..5,686.96 rows=355,161 width=0) (actual time=30.071..30.071 rows=0 loops=1)

76. 18.592 18.592 ↓ 1.0 194,720 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,940.45 rows=186,403 width=0) (actual time=18.592..18.592 rows=194,720 loops=1)

  • Index Cond: (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))
77. 11.476 11.476 ↓ 1.0 177,038 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,662.12 rows=168,759 width=0) (actual time=11.476..11.476 rows=177,038 loops=1)

  • Index Cond: (reported > (now() - '9 mons'::interval))
78.          

SubPlan (for Bitmap Heap Scan)

79. 53.631 53.631 ↓ 1.0 15,764 1

Seq Scan on useview_muting_approved useview_muting_approved_1 (cost=0.00..550.55 rows=15,755 width=37) (actual time=50.319..53.631 rows=15,764 loops=1)

80. 95.011 694.588 ↓ 1.2 41,342 1

Sort (cost=108,559.22..108,643.75 rows=33,809 width=44) (actual time=692.189..694.588 rows=41,342 loops=1)

  • Sort Key: useview_pregnancy_visit_1.patient_id, useview_pregnancy_visit_1.reported DESC
  • Sort Method: quicksort Memory: 4,766kB
81. 3.075 599.577 ↓ 1.2 41,342 1

Append (cost=64,263.54..106,015.92 rows=33,809 width=44) (actual time=236.680..599.577 rows=41,342 loops=1)

82. 2.991 240.822 ↓ 1.4 16,950 1

Unique (cost=64,263.54..64,324.88 rows=11,994 width=44) (actual time=236.679..240.822 rows=16,950 loops=1)

83. 31.619 237.831 ↓ 1.4 17,585 1

Sort (cost=64,263.54..64,294.21 rows=12,268 width=44) (actual time=236.677..237.831 rows=17,585 loops=1)

  • Sort Key: useview_pregnancy_visit_1.patient_id
  • Sort Method: quicksort Memory: 2,142kB
84. 131.787 206.212 ↓ 1.4 17,585 1

Bitmap Heap Scan on useview_pregnancy_visit useview_pregnancy_visit_1 (cost=6,198.65..63,430.38 rows=12,268 width=44) (actual time=82.569..206.212 rows=17,585 loops=1)

  • Recheck Cond: ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval)))
  • Filter: ((NOT (hashed SubPlan 9)) AND (continue_follow_up <> 'yes'::text))
  • Rows Removed by Filter: 177,126
  • Heap Blocks: exact=24,654
85. 0.002 24.162 ↓ 0.0 0 1

BitmapOr (cost=5,608.71..5,608.71 rows=355,161 width=0) (actual time=24.162..24.162 rows=0 loops=1)

86. 12.830 12.830 ↓ 1.0 194,720 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,940.45 rows=186,403 width=0) (actual time=12.830..12.830 rows=194,720 loops=1)

  • Index Cond: (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))
87. 11.330 11.330 ↓ 1.0 177,038 1

Bitmap Index Scan on useview_pregnancy_visit_reported_chw (cost=0.00..2,662.12 rows=168,759 width=0) (actual time=11.330..11.330 rows=177,038 loops=1)

  • Index Cond: (reported > (now() - '9 mons'::interval))
88.          

SubPlan (for Bitmap Heap Scan)

89. 50.263 50.263 ↓ 1.0 15,764 1

Seq Scan on useview_muting_approved useview_muting_approved_2 (cost=0.00..550.55 rows=15,755 width=37) (actual time=47.916..50.263 rows=15,764 loops=1)

90. 4.795 355.680 ↓ 1.1 24,392 1

Unique (cost=41,063.57..41,183.91 rows=21,815 width=44) (actual time=348.508..355.680 rows=24,392 loops=1)

91. 54.773 350.885 ↓ 1.2 29,462 1

Sort (cost=41,063.57..41,123.74 rows=24,068 width=44) (actual time=348.507..350.885 rows=29,462 loops=1)

  • Sort Key: useview_delivery_check.patient_id
  • Sort Method: quicksort Memory: 3,070kB
92. 245.424 296.112 ↓ 1.2 29,462 1

Seq Scan on useview_delivery_check (cost=589.94..39,312.04 rows=24,068 width=44) (actual time=55.363..296.112 rows=29,462 loops=1)

  • Filter: ((NOT (hashed SubPlan 10)) AND (still_pregnant = 'no'::text) AND ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval))))
  • Rows Removed by Filter: 603,662
93.          

SubPlan (for Seq Scan)

94. 50.688 50.688 ↓ 1.0 15,764 1

Seq Scan on useview_muting_approved useview_muting_approved_3 (cost=0.00..550.55 rows=15,755 width=37) (actual time=48.093..50.688 rows=15,764 loops=1)

95. 54.699 536.896 ↓ 2.1 183,229 1

Hash (cost=22,379.44..22,379.44 rows=87,109 width=44) (actual time=536.896..536.896 rows=183,229 loops=1)

  • Buckets: 262,144 (originally 131072) Batches: 1 (originally 1) Memory Usage: 16,363kB
96. 94.438 482.197 ↓ 2.1 183,229 1

GroupAggregate (cost=590.36..21,508.35 rows=87,109 width=44) (actual time=56.585..482.197 rows=183,229 loops=1)

  • Group Key: useview_postnatal_care.patient_id
97. 337.343 387.759 ↓ 2.0 206,938 1

Index Scan using useview_postnatal_follow_up_count_patient_id on useview_postnatal_care (cost=590.36..20,120.77 rows=103,298 width=44) (actual time=55.301..387.759 rows=206,938 loops=1)

  • Index Cond: (follow_up_count = '1'::text)
  • Filter: (NOT (hashed SubPlan 11))
  • Rows Removed by Filter: 517
98.          

SubPlan (for Index Scan)

99. 50.416 50.416 ↓ 1.0 15,764 1

Seq Scan on useview_muting_approved useview_muting_approved_4 (cost=0.00..550.55 rows=15,755 width=37) (actual time=48.056..50.416 rows=15,764 loops=1)

100.          

SubPlan (for Hash Left Join)

101. 50.779 50.779 ↓ 1.0 15,764 1

Seq Scan on useview_muting_approved (cost=0.00..550.55 rows=15,755 width=37) (actual time=48.404..50.779 rows=15,764 loops=1)

102. 3.408 13.286 ↓ 10.9 1,629 1

Sort (cost=161.29..161.66 rows=149 width=87) (actual time=13.014..13.286 rows=1,629 loops=1)

  • Sort Key: pncvisit.interval_number, pncvisit.chw_uuid
  • Sort Method: quicksort Memory: 278kB
103. 0.155 9.878 ↓ 10.9 1,629 1

Subquery Scan on pncvisit (cost=152.93..155.91 rows=149 width=87) (actual time=9.311..9.878 rows=1,629 loops=1)

104. 6.921 9.723 ↓ 10.9 1,629 1

HashAggregate (cost=152.93..154.42 rows=149 width=87) (actual time=9.310..9.723 rows=1,629 loops=1)

  • Group Key: useview_postnatal_care_1.chw, 0
105. 2.802 2.802 ↓ 17.8 2,691 1

Index Scan using useview_postnatal_care_count_reported_uuid on useview_postnatal_care useview_postnatal_care_1 (cost=0.44..140.85 rows=151 width=63) (actual time=0.069..2.802 rows=2,691 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))
106. 973.626 3,441.918 ↓ 91,787.6 18,357,519 1

Sort (cost=572,415.60..572,416.10 rows=200 width=40) (actual time=2,468.605..3,441.918 rows=18,357,519 loops=1)

  • Sort Key: chp_visits.interval_number
  • Sort Method: quicksort Memory: 167kB
107. 0.178 2,468.292 ↓ 7.6 1,517 1

Subquery Scan on chp_visits (cost=572,389.42..572,407.96 rows=200 width=40) (actual time=2,467.264..2,468.292 rows=1,517 loops=1)

108. 0.364 2,468.114 ↓ 7.6 1,517 1

Unique (cost=572,389.42..572,405.96 rows=200 width=40) (actual time=2,467.262..2,468.114 rows=1,517 loops=1)

109. 0.382 2,467.750 ↓ 7.6 1,517 1

Group (cost=572,389.42..572,405.46 rows=200 width=40) (actual time=2,467.261..2,467.750 rows=1,517 loops=1)

  • Group Key: ((pat_clinic.doc #>> '{fields,inputs,contact,_id}'::text[])), 0
110. 2.842 2,467.368 ↑ 1.2 1,780 1

Sort (cost=572,389.42..572,394.60 rows=2,072 width=36) (actual time=2,467.250..2,467.368 rows=1,780 loops=1)

  • Sort Key: ((pat_clinic.doc #>> '{fields,inputs,contact,_id}'::text[]))
  • Sort Method: quicksort Memory: 188kB
111. 91.096 2,464.526 ↑ 1.2 1,780 1

Hash Join (cost=314,096.06..572,275.29 rows=2,072 width=36) (actual time=2,333.708..2,464.526 rows=1,780 loops=1)

  • Hash Cond: ((pat_clinic.doc #>> '{fields,inputs,contact,_id}'::text[]) = form_metadata.chw_area)
112. 0.336 39.951 ↑ 2.2 1,854 1

Nested Loop (cost=0.46..258,137.73 rows=4,143 width=866) (actual time=0.120..39.951 rows=1,854 loops=1)

113. 0.004 0.011 ↑ 1.0 2 1

Unique (cost=0.04..0.04 rows=2 width=32) (actual time=0.006..0.011 rows=2 loops=1)

114. 0.004 0.007 ↑ 1.0 2 1

Sort (cost=0.04..0.04 rows=2 width=32) (actual time=0.006..0.007 rows=2 loops=1)

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

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

116. 0.278 39.604 ↑ 317.9 927 2

Append (cost=0.42..126,121.47 rows=294,737 width=866) (actual time=0.068..19.802 rows=927 loops=2)

117. 0.026 0.026 ↓ 0.0 0 2

Index Scan using pat_clinic_expr_idx9 on pat_clinic (cost=0.42..2.97 rows=1 width=560) (actual time=0.013..0.013 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))
118. 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))
119. 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))
120. 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,569.64 rows=3,457 width=1,447) (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))
121. 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..35,675.15 rows=61,753 width=196) (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))
122. 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.31..146.19 rows=322 width=41) (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))
123. 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..29,665.44 rows=44,809 width=1,285) (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))
124. 39.188 39.188 ↓ 1.5 1,854 1

Index Scan using pat_data_record_chp_visit_f_cast_isots_idx on pat_data_record_chp_visit (cost=0.31..728.08 rows=1,214 width=119) (actual time=0.062..39.188 rows=1,854 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))
125. 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..16.67 rows=15 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))
126. 0.006 0.006 ↓ 0.0 0 1

Index Scan using pat_data_record_community_events_f_cast_isots_idx on pat_data_record_community_events (cost=0.30..2.33 rows=1 width=1,329) (actual time=0.005..0.006 rows=0 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))
127. 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.30..34.53 rows=118 width=1,672) (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))
128. 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..17.80 rows=77 width=1,012) (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))
129. 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.29..2.32 rows=1 width=1,861) (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))
130. 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..688.59 rows=958 width=1,791) (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))
131. 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..57.22 rows=79 width=283) (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))
132. 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..17.24 rows=19 width=1,717) (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))
133. 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..6,928.86 rows=7,184 width=287) (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_fp_follow_up_long_term_f_cast_isots_idx on pat_data_record_fp_follow_up_long_term (cost=0.31..285.85 rows=775 width=1,596) (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_fp_follow_up_prospective_f_cast_isots_idx on pat_data_record_fp_follow_up_prospective (cost=0.44..2,261.88 rows=10,707 width=928) (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_fp_follow_up_refill_f_cast_isots_idx on pat_data_record_fp_follow_up_refill (cost=0.31..528.53 rows=3,285 width=637) (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_fp_follow_up_short_term_f_cast_isots_idx on pat_data_record_fp_follow_up_short_term (cost=0.31..3,816.24 rows=11,030 width=1,542) (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. 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,833.57 rows=11,346 width=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))
139. 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,299.26 rows=105,578 width=1,342) (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.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.31..31.47 rows=97 width=1,748) (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))
141. 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.31..4.72 rows=12 width=1,811) (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_hub_spoke_f_cast_isots_idx on pat_data_record_hub_spoke (cost=0.30..4.34 rows=3 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))
143. 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..1,362.25 rows=1,459 width=1,313) (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_immunization_ug_f_cast_isots_idx on pat_data_record_immunization_ug (cost=0.44..4,723.48 rows=16,380 width=1,754) (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_immunization_ug_follow_up_f_cast_isots_idx on pat_data_record_immunization_ug_follow_up (cost=0.31..908.44 rows=3,622 width=1,555) (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_it_support_f_cast_isots_idx on pat_data_record_it_support (cost=0.30..5.39 rows=4 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))
147. 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))
148. 0.000 0.000 ↓ 0.0 0

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

149. 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)
150. 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))
151. 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..73.33 rows=77 width=1,407) (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_mute_person_f_cast_isots_idx on pat_data_record_mute_person (cost=0.30..66.40 rows=219 width=1,725) (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_muting_approve_request_f_cast_isots_idx on pat_data_record_muting_approve_request (cost=0.31..195.59 rows=1,202 width=780) (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_muting_approved_f_cast_isots_idx on pat_data_record_muting_approved (cost=0.30..4.91 rows=13 width=975) (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_nutrition_assessment_f_cast_isots_idx on pat_data_record_nutrition_assessment (cost=0.44..510.97 rows=635 width=1,771) (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_ovc_survey_f_cast_isots_idx on pat_data_record_ovc_survey (cost=0.30..4.59 rows=4 width=700) (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_postnatal_care_f_cast_isots_idx on pat_data_record_postnatal_care (cost=0.44..215.55 rows=223 width=251) (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_postnatal_care_cbds_f_cast_isots_idx on pat_data_record_postnatal_care_cbds (cost=0.30..4.15 rows=3 width=159) (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_pregnancy_f_cast_isots_idx on pat_data_record_pregnancy (cost=0.44..152.54 rows=160 width=71) (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

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..55.37 rows=55 width=1,055) (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))
161. 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..5,117.40 rows=6,790 width=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))
162. 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..133.93 rows=151 width=1,460) (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))
163. 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..2.19 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))
164. 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..5.41 rows=4 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))
165. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on pat_data_record_default (cost=216.10..1,451.24 rows=881 width=1,591) (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))
166. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=216.10..216.10 rows=881 width=0) (never executed)

167. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pat_data_record_default_expr_idx9 (cost=0.00..18.73 rows=1,526 width=0) (never executed)

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

Bitmap Index Scan on pat_data_record_default_f_cast_isots_idx (cost=0.00..193.37 rows=14,106 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))
169. 0.008 0.008 ↓ 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.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))
170. 0.010 0.010 ↓ 0.0 0 2

Index Scan using pat_feedback_expr_idx9 on pat_feedback (cost=0.29..2.84 rows=1 width=674) (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))
171. 0.006 0.006 ↓ 0.0 0 2

Index Scan using pat_form_expr_idx9 on pat_form (cost=0.14..2.69 rows=1 width=615) (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))
172. 0.010 0.010 ↓ 0.0 0 2

Index Scan using pat_health_center_expr_idx9 on pat_health_center (cost=0.29..2.83 rows=1 width=736) (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))
173. 0.016 0.016 ↓ 0.0 0 2

Index Scan using pat_info_expr_idx9 on pat_info (cost=0.43..2.98 rows=1 width=291) (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))
174. 0.008 0.008 ↓ 0.0 0 2

Seq Scan on pat_meta (cost=0.00..1.54 rows=1 width=32) (actual time=0.004..0.004 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
175. 0.018 0.018 ↓ 0.0 0 2

Index Scan using pat_person_expr_idx9 on pat_person (cost=0.43..2.98 rows=1 width=652) (actual time=0.009..0.009 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))
176. 0.010 0.010 ↓ 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.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))
177. 0.006 0.006 ↓ 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.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))
178. 0.014 0.014 ↓ 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.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))
179. 0.833 2,333.479 ↑ 1.3 4,382 1

Hash (cost=314,024.38..314,024.38 rows=5,698 width=36) (actual time=2,333.479..2,333.479 rows=4,382 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 357kB
180. 489.271 2,332.646 ↑ 1.3 4,383 1

HashAggregate (cost=313,967.40..314,024.38 rows=5,698 width=36) (actual time=2,331.959..2,332.646 rows=4,383 loops=1)

  • Group Key: form_metadata.chw_area
181. 1,843.375 1,843.375 ↑ 1.0 2,145,962 1

Index Scan using form_metadata_reported on form_metadata (cost=0.45..308,592.02 rows=2,150,152 width=36) (actual time=0.035..1,843.375 rows=2,145,962 loops=1)

  • Index Cond: ((reported >= ((date_trunc('month'::text, now()) - '3 mons'::interval))::timestamp without time zone) AND (reported < (date_trunc('month'::text, now()))::timestamp without time zone))
182. 0.040 33.676 ↑ 1.2 35 1

Sort (cost=879.21..879.31 rows=41 width=48) (actual time=33.655..33.676 rows=35 loops=1)

  • Sort Key: communityevent.chw_uuid, communityevent.interval_number
  • Sort Method: quicksort Memory: 29kB
183. 0.005 33.636 ↑ 1.2 35 1

Subquery Scan on communityevent (cost=876.88..878.11 rows=41 width=48) (actual time=33.614..33.636 rows=35 loops=1)

184. 0.024 33.631 ↑ 1.2 35 1

GroupAggregate (cost=876.88..877.70 rows=41 width=48) (actual time=33.612..33.631 rows=35 loops=1)

  • Group Key: meta.chw, 0
185. 0.038 33.607 ↓ 1.2 51 1

Sort (cost=876.88..876.98 rows=41 width=40) (actual time=33.604..33.607 rows=51 loops=1)

  • Sort Key: meta.chw
  • Sort Method: quicksort Memory: 28kB
186. 0.130 33.569 ↓ 1.2 51 1

Bitmap Heap Scan on form_metadata meta (cost=833.24..875.78 rows=41 width=40) (actual time=33.478..33.569 rows=51 loops=1)

  • 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 = 'community_event'::text))
  • Heap Blocks: exact=49
187. 0.425 33.439 ↓ 0.0 0 1

BitmapAnd (cost=833.24..833.24 rows=41 width=0) (actual time=33.439..33.439 rows=0 loops=1)

188. 29.051 29.051 ↓ 55.4 466,873 1

Bitmap Index Scan on form_metadata_reported (cost=0.00..108.66 rows=8,420 width=0) (actual time=29.051..29.051 rows=466,873 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))
189. 3.963 3.963 ↑ 1.0 59,598 1

Bitmap Index Scan on form_metadata_formname (cost=0.00..724.32 rows=62,101 width=0) (actual time=3.963..3.963 rows=59,598 loops=1)

  • Index Cond: (formname = 'community_event'::text)
190. 164.862 191,764.988 ↑ 1.0 1 13,802

Index Scan using contactview_chp_uuid on contactview_chp chp (cost=0.29..169.70 rows=1 width=40) (actual time=13.894..13.894 rows=1 loops=13,802)

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

SubPlan (for Index Scan)

192. 39.308 180,447.348 ↓ 0.0 0 13,802

Nested Loop Semi Join (cost=141.21..142.85 rows=1 width=0) (actual time=13.074..13.074 rows=0 loops=13,802)

  • Join Filter: (meta_1.formname = ""*VALUES*_1"".column1)
  • Rows Removed by Join Filter: 2
193. 138.020 180,392.140 ↓ 0.0 0 13,802

Bitmap Heap Scan on form_metadata meta_1 (cost=141.21..142.25 rows=1 width=14) (actual time=13.070..13.070 rows=0 loops=13,802)

  • 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=3,919
194. 543.786 180,254.120 ↓ 0.0 0 13,802

BitmapAnd (cost=141.21..141.21 rows=1 width=0) (actual time=13.060..13.060 rows=0 loops=13,802)

195. 2,084.102 2,084.102 ↑ 2.3 895 13,802

Bitmap Index Scan on form_metadata_chw (cost=0.00..32.30 rows=2,099 width=0) (actual time=0.151..0.151 rows=895 loops=13,802)

  • Index Cond: (chw = chp.uuid)
196. 177,626.232 177,626.232 ↓ 55.4 466,873 5,367

Bitmap Index Scan on form_metadata_reported (cost=0.00..108.66 rows=8,420 width=0) (actual time=33.096..33.096 rows=466,873 loops=5,367)

  • 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))
197. 15.900 15.900 ↑ 3.4 7 3,975

Values Scan on ""*VALUES*_1"" (cost=0.00..0.30 rows=24 width=32) (actual time=0.002..0.004 rows=7 loops=3,975)

198. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=1.06..8,489.95 rows=4,124 width=36) (never executed)

  • Hash Cond: (meta_2.formname = ""*VALUES*_2"".column1)
199. 0.000 0.000 ↓ 0.0 0

Index Scan using form_metadata_reported on form_metadata meta_2 (cost=0.46..8,421.37 rows=8,420 width=50) (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))
200. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.30..0.30 rows=24 width=32) (never executed)

201. 0.000 0.000 ↓ 0.0 0

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

202. 3,707.434 3,707.434 ↓ 0.0 0 10,102

Index Scan using contactview_metadata_parent_uuid on contactview_metadata clinic (cost=0.56..14.06 rows=1 width=0) (actual time=0.367..0.367 rows=0 loops=10,102)

  • 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: 224
203. 0.000 0.000 ↓ 0.0 0

Index Scan using contactview_metadata_reported on contactview_metadata clinic_1 (cost=0.45..4,849.19 rows=5,532 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))
204. 7,445.344 7,445.344 ↓ 0.0 0 6,554

Index Scan using useview_postnatal_reported_chw_patient_id on useview_postnatal_care pnc (cost=0.44..10.49 rows=1 width=0) (actual time=1.136..1.136 rows=0 loops=6,554)

  • 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)
205. 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..140.85 rows=151 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))
206. 1.408 87.141 ↑ 1.5 1,789 1

Materialize (cost=8,293.72..8,615.82 rows=2,606 width=47) (actual time=47.634..87.141 rows=1,789 loops=1)

207. 32.610 85.733 ↑ 1.5 1,789 1

GroupAggregate (cost=8,293.72..8,583.24 rows=2,606 width=47) (actual time=47.630..85.733 rows=1,789 loops=1)

  • Group Key: visit_1.chw, 0
208. 34.173 53.123 ↓ 1.5 22,556 1

Sort (cost=8,293.72..8,331.36 rows=15,055 width=80) (actual time=47.541..53.123 rows=22,556 loops=1)

  • Sort Key: visit_1.chw
  • Sort Method: quicksort Memory: 4,017kB
209. 18.950 18.950 ↓ 1.5 22,556 1

Index Scan using useview_fp_visit_reported_xmlforms_uuid on useview_fp_visit visit_1 (cost=0.44..7,249.06 rows=15,055 width=80) (actual time=0.046..18.950 rows=22,556 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))
210. 6.629 1,242.531 ↓ 1.7 10,163 1

Materialize (cost=0.56..85,250.22 rows=5,871 width=48) (actual time=0.056..1,242.531 rows=10,163 loops=1)

211. 278.193 1,235.902 ↓ 1.7 10,163 1

GroupAggregate (cost=0.56..85,176.83 rows=5,871 width=48) (actual time=0.054..1,235.902 rows=10,163 loops=1)

  • Group Key: useview_chp_sync.chw_uuid, 0
212. 957.709 957.709 ↓ 1.0 2,452,910 1

Index Only Scan using useview_chp_sync_chw_uuid_latest_replication_date on useview_chp_sync (cost=0.56..67,080.12 rows=2,397,238 width=48) (actual time=0.045..957.709 rows=2,452,910 loops=1)

  • Heap Fetches: 284,232
Execution time : 215,877.077 ms