explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EDIM

Settings
# exclusive inclusive rows x rows loops node
1. 14.657 98,461.132 ↓ 13.0 13 1

GroupAggregate (cost=443,863.03..443,864.99 rows=1 width=688) (actual time=98,447.861..98,461.132 rows=13 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: 920
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 168.215 ms, Inlining 0.000 ms, Optimization 54.149 ms, Emission 1229.968 ms, Total 1452.332 ms
2. 9.103 98,446.475 ↓ 614.0 1,842 1

Sort (cost=443,863.03..443,863.04 rows=3 width=2,024) (actual time=98,446.220..98,446.475 rows=1,842 loops=1)

  • Sort Key: chwlist.branch_uuid, chwlist.branch_name, (date(chwlist.interval_start)), chwlist.interval_number
  • Sort Method: quicksort Memory: 540kB
3. 5.741 98,437.372 ↓ 614.0 1,842 1

Merge Left Join (cost=188,922.57..443,863.01 rows=3 width=2,024) (actual time=5,024.484..98,437.372 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = "*SELECT* 1_2".reported_by)
  • Join Filter: (chwlist.interval_number = (0))
4. 4.846 98,430.033 ↓ 614.0 1,842 1

Merge Left Join (cost=188,769.11..443,707.40 rows=3 width=1,848) (actual time=5,022.879..98,430.033 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_home_visit.reported_by)
  • Join Filter: (chwlist.interval_number = (0))
5. 3.678 98,424.935 ↓ 614.0 1,842 1

Merge Left Join (cost=188,706.17..443,621.27 rows=3 width=1,840) (actual time=5,022.783..98,424.935 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = "*SELECT* 1_1".chw_uuid)
  • Join Filter: (chwlist.interval_number = (0))
6. 5.052 98,323.176 ↓ 614.0 1,842 1

Nested Loop Left Join (cost=180,247.68..435,162.66 rows=3 width=1,832) (actual time=4,924.696..98,323.176 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_uuid = infant_deaths.chw_uuid) AND (chwlist.interval_number = infant_deaths.interval_number))
7. 4.654 98,318.124 ↓ 614.0 1,842 1

Merge Left Join (cost=180,166.38..435,081.24 rows=3 width=1,816) (actual time=4,924.183..98,318.124 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = assess_u1fu_pnc_aggregated.chw)
  • Join Filter: (chwlist.interval_number = (0))
8. 5.356 98,313.000 ↓ 614.0 1,842 1

Merge Left Join (cost=179,877.14..434,771.45 rows=3 width=1,776) (actual time=4,923.767..98,313.000 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = "*SELECT* 1".reported_by)
  • Join Filter: (chwlist.interval_number = (0))
9. 293.785 98,302.800 ↓ 614.0 1,842 1

Nested Loop Left Join (cost=179,425.55..434,309.96 rows=3 width=1,760) (actual time=4,918.915..98,302.800 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_area_uuid = population_all_time.chw_area_uuid) AND (chwlist.interval_number = population_all_time.interval_number))
  • Rows Removed by Join Filter: 2045916
10. 16.216 95,503.895 ↓ 614.0 1,842 1

Merge Left Join (cost=179,425.00..352,472.73 rows=3 width=1,788) (actual time=4,105.890..95,503.895 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_chp_sync.chw_uuid)
  • Join Filter: (chwlist.interval_number = (0))
11. 303.642 92,556.400 ↓ 614.0 1,842 1

Nested Loop Left Join (cost=179,424.44..188,551.12 rows=3 width=1,780) (actual time=4,105.129..92,556.400 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_area_uuid = contactview_metadata_1.parent_uuid) AND (chwlist.interval_number = (0)))
  • Rows Removed by Join Filter: 2065516
12. 4.966 13,474.102 ↓ 1,842.0 1,842 1

Merge Left Join (cost=147,418.69..149,246.77 rows=1 width=1,736) (actual time=3,647.328..13,474.102 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = survey.chw)
  • Join Filter: (chwlist.interval_number = (0))
13. 7.125 13,469.082 ↓ 1,842.0 1,842 1

Nested Loop Left Join (cost=147,367.79..149,192.36 rows=1 width=1,712) (actual time=3,647.269..13,469.082 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_area_uuid = population.chp_area_uuid) AND (chwlist.interval_number = (0)))
  • Rows Removed by Join Filter: 5523
14. 11.293 13,397.487 ↓ 1,842.0 1,842 1

Nested Loop Left Join (cost=146,773.24..148,372.37 rows=1 width=1,600) (actual time=3,646.745..13,397.487 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_uuid = useview_households_visited.chw) AND (chwlist.interval_number = (0)))
  • Rows Removed by Join Filter: 22092
15. 16.404 13,306.988 ↓ 1,842.0 1,842 1

Nested Loop Left Join (cost=146,478.40..147,985.48 rows=1 width=1,592) (actual time=3,644.441..13,306.988 rows=1,842 loops=1)

  • Join Filter: (chwlist.interval_number = 0)
16. 2.658 3,686.396 ↓ 1,842.0 1,842 1

Merge Left Join (cost=146,478.12..147,721.32 rows=1 width=1,588) (actual time=3,640.557..3,686.396 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = meta.chw)
  • Join Filter: (chwlist.interval_number = (0))
17. 2.781 3,676.943 ↓ 1,842.0 1,842 1

Merge Left Join (cost=145,646.55..146,886.70 rows=1 width=1,580) (actual time=3,633.750..3,676.943 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = assess.chw)
  • Join Filter: (chwlist.interval_number = (0))
18. 4.258 3,674.122 ↓ 1,842.0 1,842 1

Merge Left Join (cost=145,492.49..146,732.31 rows=1 width=1,572) (actual time=3,633.706..3,674.122 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = p.chw)
  • Join Filter: (chwlist.interval_number = (0))
19. 3.630 3,100.654 ↓ 1,842.0 1,842 1

Merge Left Join (cost=99,499.52..99,529.29 rows=1 width=1,564) (actual time=3,064.798..3,100.654 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = anc.chw)
  • Join Filter: (chwlist.interval_number = (0))
20. 3.732 3,067.385 ↓ 1,842.0 1,842 1

Merge Left Join (cost=95,292.79..95,321.50 rows=1 width=1,556) (actual time=3,035.161..3,067.385 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = pnc_1.chw)
  • Join Filter: (chwlist.interval_number = (0))
21. 4.415 3,063.469 ↓ 1,842.0 1,842 1

Merge Left Join (cost=95,223.23..95,240.64 rows=1 width=1,460) (actual time=3,034.972..3,063.469 rows=1,842 loops=1)

  • Merge Cond: (chwlist.chw_uuid = useview_pregnancy.chw)
  • Join Filter: (chwlist.interval_number = (0))
22. 7.294 3,058.288 ↓ 1,842.0 1,842 1

Nested Loop Left Join (cost=95,186.46..95,198.66 rows=1 width=1,444) (actual time=3,034.735..3,058.288 rows=1,842 loops=1)

  • Join Filter: ((chwlist.chw_area_uuid = contactview_metadata.parent_uuid) AND (chwlist.interval_number = (0)))
  • Rows Removed by Join Filter: 1841
23. 9.010 2,828.112 ↓ 1,842.0 1,842 1

Merge Left Join (cost=79,350.09..79,362.11 rows=1 width=1,436) (actual time=2,817.539..2,828.112 rows=1,842 loops=1)

  • Merge Cond: ((chwlist.chw_uuid = anc_pnc_u1fu.chw_uuid) AND (chwlist.interval_number = anc_pnc_u1fu.interval_number))
24. 4.663 1,338.794 ↓ 1,842.0 1,842 1

Sort (cost=2,211.96..2,211.96 rows=1 width=1,388) (actual time=1,337.218..1,338.794 rows=1,842 loops=1)

  • Sort Key: chwlist.chw_uuid, chwlist.interval_number
  • Sort Method: quicksort Memory: 538kB
25. 0.468 1,334.131 ↓ 1,842.0 1,842 1

Hash Right Join (cost=1,880.03..2,211.95 rows=1 width=1,388) (actual time=1,333.654..1,334.131 rows=1,842 loops=1)

  • Hash Cond: ((chwview_assessment.chw_uuid = chwlist.chw_uuid) AND ((0) = chwlist.interval_number))
26. 0.043 2.016 ↑ 283.2 4 1

GroupAggregate (cost=1,678.54..1,979.30 rows=1,133 width=1,292) (actual time=1.994..2.016 rows=4 loops=1)

  • Group Key: chwview_assessment.chw_uuid, 0
27. 0.014 1.973 ↑ 403.0 4 1

Sort (cost=1,678.54..1,682.57 rows=1,612 width=352) (actual time=1.973..1.973 rows=4 loops=1)

  • Sort Key: chwview_assessment.chw_uuid
  • Sort Method: quicksort Memory: 25kB
28. 1.959 1.959 ↑ 403.0 4 1

Index Scan using chwview_assessment_reported_chw_uuid on chwview_assessment (cost=0.45..1,592.67 rows=1,612 width=352) (actual time=0.058..1.959 rows=4 loops=1)

  • Index Cond: ((reported_day >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND (reported_day < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
29. 0.761 1,331.647 ↓ 1,842.0 1,842 1

Hash (cost=201.47..201.47 rows=1 width=136) (actual time=1,331.647..1,331.647 rows=1,842 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 306kB
30. 0.252 1,330.886 ↓ 1,842.0 1,842 1

Subquery Scan on chwlist (cost=196.04..201.47 rows=1 width=136) (actual time=1,322.651..1,330.886 rows=1,842 loops=1)

31. 1.855 1,330.634 ↓ 1,842.0 1,842 1

Nested Loop Anti Join (cost=196.04..201.46 rows=1 width=264) (actual time=1,322.649..1,330.634 rows=1,842 loops=1)

32. 1.227 1,324.087 ↓ 469.2 2,346 1

Group (cost=195.76..195.90 rows=5 width=219) (actual time=1,322.623..1,324.087 rows=2,346 loops=1)

  • Group Key: cmd.uuid, cmd.name, chp_1.supervisor_uuid, chp_1.area_uuid, cmeta.name, chp_1.uuid, chp_1.name, chp_1.phone, (date_trunc('day'::text, date_trunc('month'::text, now()))), (0)
33. 8.117 1,322.860 ↓ 469.2 2,346 1

Sort (cost=195.76..195.77 rows=5 width=219) (actual time=1,322.613..1,322.860 rows=2,346 loops=1)

  • Sort Key: cmd.uuid, cmd.name, chp_1.supervisor_uuid, chp_1.area_uuid, cmeta.name, chp_1.uuid, chp_1.name, chp_1.phone, (date_trunc('day'::text, date_trunc('month'::text, now()))), (0)
  • Sort Method: quicksort Memory: 720kB
34. 0.543 1,314.743 ↓ 469.2 2,346 1

Hash Join (cost=156.90..195.70 rows=5 width=219) (actual time=1,314.225..1,314.743 rows=2,346 loops=1)

  • Hash Cond: ((row_number() OVER (?)) = (row_number() OVER (?)))
35. 0.008 1,292.516 ↑ 1,000.0 1 1

WindowAgg (cost=59.84..84.84 rows=1,000 width=24) (actual time=1,292.515..1,292.516 rows=1 loops=1)

36. 0.005 1,292.508 ↑ 1,000.0 1 1

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

  • Sort Key: generate_series.generate_series
  • Sort Method: quicksort Memory: 25kB
37. 1,292.503 1,292.503 ↑ 1,000.0 1 1

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

38. 1.197 21.684 ↓ 2,346.0 2,346 1

Hash (cost=97.05..97.05 rows=1 width=219) (actual time=21.683..21.684 rows=2,346 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 608kB
39. 1.324 20.487 ↓ 2,346.0 2,346 1

Nested Loop (cost=1.19..97.05 rows=1 width=219) (actual time=0.104..20.487 rows=2,346 loops=1)

40. 0.473 16.817 ↓ 2,346.0 2,346 1

Nested Loop (cost=1.14..96.95 rows=1 width=207) (actual time=0.084..16.817 rows=2,346 loops=1)

41. 0.733 2.268 ↓ 2,346.0 2,346 1

Nested Loop (cost=0.71..94.68 rows=1 width=191) (actual time=0.066..2.268 rows=2,346 loops=1)

42. 0.053 0.053 ↓ 13.0 13 1

Index Scan using contactview_metadata_type on contactview_metadata cmd (cost=0.43..1.45 rows=1 width=52) (actual time=0.045..0.053 rows=13 loops=1)

  • Index Cond: (type = 'district_hospital'::text)
  • Filter: ((name <> 'HQ'::text) AND (name <> 'HQ OVC'::text))
  • Rows Removed by Filter: 1
43. 1.482 1.482 ↓ 1.0 180 13

Index Scan using contactview_chp_branch_uuid on contactview_chp chp_1 (cost=0.28..91.48 rows=175 width=172) (actual time=0.011..0.114 rows=180 loops=13)

  • Index Cond: (branch_uuid = cmd.uuid)
44. 14.076 14.076 ↑ 1.0 1 2,346

Index Scan using contactview_metadata_uuid on contactview_metadata cmeta (cost=0.43..2.27 rows=1 width=52) (actual time=0.006..0.006 rows=1 loops=2,346)

  • Index Cond: (uuid = chp_1.supervisor_uuid)
45. 2.346 2.346 ↑ 1.0 1 2,346

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

46. 0.000 0.000 ↑ 1.0 1 2,346

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

  • Sort Key: generate_series_1.generate_series
  • Sort Method: quicksort Memory: 25kB
47. 0.011 0.011 ↑ 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.011 rows=1 loops=1)

48. 4.692 4.692 ↓ 0.0 0 2,346

Index Only Scan using chp_muting_chw on chp_muting (cost=0.28..1.09 rows=1 width=37) (actual time=0.002..0.002 rows=0 loops=2,346)

  • Index Cond: (chw = chp_1.uuid)
  • Heap Fetches: 0
49. 0.009 1,480.308 ↑ 200.0 1 1

GroupAggregate (cost=77,138.13..77,147.13 rows=200 width=88) (actual time=1,480.308..1,480.308 rows=1 loops=1)

  • Group Key: anc_pnc_u1fu.chw_uuid, anc_pnc_u1fu.interval_number
50.          

CTE u1s

51. 0.003 0.491 ↑ 186.0 1 1

Group (cost=584.51..586.83 rows=186 width=81) (actual time=0.491..0.491 rows=1 loops=1)

  • Group Key: useview_population_demographics.family_uuid, useview_population_demographics.uuid, useview_population_demographics.date_of_birth, 0
52. 0.005 0.488 ↑ 186.0 1 1

Sort (cost=584.51..584.97 rows=186 width=81) (actual time=0.488..0.488 rows=1 loops=1)

  • Sort Key: useview_population_demographics.family_uuid, useview_population_demographics.uuid, useview_population_demographics.date_of_birth
  • Sort Method: quicksort Memory: 25kB
53. 0.483 0.483 ↑ 186.0 1 1

Index Scan using useview_population_demographics_reported_idx on useview_population_demographics (cost=0.45..577.50 rows=186 width=81) (actual time=0.032..0.483 rows=1 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: ((date_part('years'::text, age(now(), (date_of_birth)::timestamp with time zone)))::integer <= 1)
  • Rows Removed by Filter: 2
54. 0.006 1,480.299 ↑ 200.0 1 1

Sort (cost=76,551.30..76,551.80 rows=200 width=64) (actual time=1,480.299..1,480.299 rows=1 loops=1)

  • Sort Key: anc_pnc_u1fu.chw_uuid, anc_pnc_u1fu.interval_number
  • Sort Method: quicksort Memory: 25kB
55. 0.002 1,480.293 ↑ 200.0 1 1

Subquery Scan on anc_pnc_u1fu (cost=76,427.71..76,543.66 rows=200 width=64) (actual time=1,480.292..1,480.293 rows=1 loops=1)

56. 0.032 1,480.291 ↑ 200.0 1 1

GroupAggregate (cost=76,427.71..76,541.66 rows=200 width=100) (actual time=1,480.291..1,480.291 rows=1 loops=1)

  • Group Key: pnc.chw, u1s.uuid, u1s.interval_number
57. 0.008 1,480.259 ↑ 2,132.3 3 1

Sort (cost=76,427.71..76,443.70 rows=6,397 width=183) (actual time=1,480.259..1,480.259 rows=3 loops=1)

  • Sort Key: pnc.chw, u1s.uuid, u1s.interval_number
  • Sort Method: quicksort Memory: 25kB
58. 0.170 1,480.251 ↑ 2,132.3 3 1

Hash Left Join (cost=72,960.47..76,023.32 rows=6,397 width=183) (actual time=1,480.245..1,480.251 rows=3 loops=1)

  • Hash Cond: (pnc.patient_id = pv.patient_id)
59. 0.004 1,397.609 ↑ 1,754.0 1 1

Nested Loop Left Join (cost=64,043.66..66,834.22 rows=1,754 width=182) (actual time=1,397.605..1,397.609 rows=1 loops=1)

60. 0.004 1,397.577 ↑ 721.0 1 1

Nested Loop Left Join (cost=64,043.25..65,178.79 rows=721 width=145) (actual time=1,397.573..1,397.577 rows=1 loops=1)

61. 0.003 1,397.565 ↑ 350.0 1 1

Group (cost=64,042.83..64,048.95 rows=350 width=176) (actual time=1,397.564..1,397.565 rows=1 loops=1)

  • Group Key: pnc.chw, u1s.family_uuid, fp.person_ids, pnc.patient_id, u1s.uuid, u1s.interval_number
62. 0.005 1,397.562 ↑ 350.0 1 1

Sort (cost=64,042.83..64,043.70 rows=350 width=172) (actual time=1,397.562..1,397.562 rows=1 loops=1)

  • Sort Key: pnc.chw, u1s.family_uuid, fp.person_ids, u1s.uuid, u1s.interval_number
  • Sort Method: quicksort Memory: 25kB
63. 0.006 1,397.557 ↑ 350.0 1 1

Nested Loop (cost=63,455.95..64,028.04 rows=350 width=172) (actual time=1,397.555..1,397.557 rows=1 loops=1)

64. 0.014 1,397.535 ↑ 170.0 1 1

Hash Join (cost=63,455.53..63,459.75 rows=170 width=100) (actual time=1,397.534..1,397.535 rows=1 loops=1)

  • Hash Cond: (u1s.family_uuid = fp.family_uuid)
65. 0.494 0.494 ↑ 186.0 1 1

CTE Scan on u1s (cost=0.00..3.72 rows=186 width=68) (actual time=0.493..0.494 rows=1 loops=1)

66. 0.004 1,397.027 ↑ 170.0 1 1

Hash (cost=63,453.41..63,453.41 rows=170 width=69) (actual time=1,397.027..1,397.027 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
67. 0.002 1,397.023 ↑ 170.0 1 1

Subquery Scan on fp (cost=63,448.31..63,453.41 rows=170 width=69) (actual time=1,397.022..1,397.023 rows=1 loops=1)

68. 0.031 1,397.021 ↑ 170.0 1 1

GroupAggregate (cost=63,448.31..63,451.71 rows=170 width=69) (actual time=1,397.021..1,397.021 rows=1 loops=1)

  • Group Key: pd.family_uuid
69. 0.007 1,396.990 ↑ 170.0 1 1

Sort (cost=63,448.31..63,448.73 rows=170 width=73) (actual time=1,396.990..1,396.990 rows=1 loops=1)

  • Sort Key: pd.family_uuid
  • Sort Method: quicksort Memory: 25kB
70. 65.471 1,396.983 ↑ 170.0 1 1

Hash Join (cost=6.47..63,442.01 rows=170 width=73) (actual time=483.217..1,396.983 rows=1 loops=1)

  • Hash Cond: (pd.family_uuid = u1s_1.family_uuid)
71. 1,331.506 1,331.506 ↓ 1.8 314,293 1

Index Scan using useview_population_demographics_sex_date_of_birth_idx on useview_population_demographics pd (cost=0.42..62,765.93 rows=178,223 width=73) (actual time=0.041..1,331.506 rows=314,293 loops=1)

  • Index Cond: (sex = 'female'::text)
  • Filter: ((date_part('years'::text, age(now(), (date_of_birth)::timestamp with time zone)))::integer >= 15)
  • Rows Removed by Filter: 219430
72. 0.003 0.006 ↑ 186.0 1 1

Hash (cost=3.72..3.72 rows=186 width=32) (actual time=0.005..0.006 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
73. 0.003 0.003 ↑ 186.0 1 1

CTE Scan on u1s u1s_1 (cost=0.00..3.72 rows=186 width=32) (actual time=0.002..0.003 rows=1 loops=1)

74. 0.016 0.016 ↑ 2.0 1 1

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pnc (cost=0.42..3.32 rows=2 width=72) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: (patient_id = fp.person_ids)
75. 0.008 0.008 ↑ 2.0 1 1

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pc (cost=0.42..3.20 rows=2 width=73) (actual time=0.006..0.008 rows=1 loops=1)

  • Index Cond: (patient_id = pnc.patient_id)
76. 0.028 0.028 ↓ 0.0 0 1

Index Scan using useview_u1_follow_up_patient_id on useview_u1_follow_up u1fu (cost=0.41..2.28 rows=2 width=74) (actual time=0.028..0.028 rows=0 loops=1)

  • Index Cond: (patient_id = u1s.uuid)
77. 45.862 82.472 ↑ 1.0 177,936 1

Hash (cost=6,611.36..6,611.36 rows=184,436 width=73) (actual time=82.472..82.472 rows=177,936 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 20464kB
78. 36.610 36.610 ↑ 1.0 177,936 1

Seq Scan on useview_pregnancy_visit pv (cost=0.00..6,611.36 rows=184,436 width=73) (actual time=0.007..36.610 rows=177,936 loops=1)

79. 3.684 222.882 ↑ 4.0 1 1,842

GroupAggregate (cost=15,836.37..15,836.45 rows=4 width=48) (actual time=0.121..0.121 rows=1 loops=1,842)

  • Group Key: contactview_metadata.parent_uuid, 0
80. 2.022 219.198 ↑ 4.0 1 1,842

Sort (cost=15,836.37..15,836.38 rows=4 width=76) (actual time=0.118..0.119 rows=1 loops=1,842)

  • Sort Key: contactview_metadata.parent_uuid
  • Sort Method: quicksort Memory: 25kB
81. 217.176 217.176 ↑ 4.0 1 1

Index Scan using contactview_metadata_type on contactview_metadata (cost=0.43..15,836.33 rows=4 width=76) (actual time=217.130..217.176 rows=1 loops=1)

  • Index Cond: (type = 'clinic'::text)
  • 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: 239511
82. 0.092 0.766 ↑ 1.3 81 1

Materialize (cost=36.77..41.70 rows=108 width=56) (actual time=0.231..0.766 rows=81 loops=1)

83. 0.395 0.674 ↑ 1.3 81 1

GroupAggregate (cost=36.77..40.35 rows=108 width=56) (actual time=0.228..0.674 rows=81 loops=1)

  • Group Key: useview_pregnancy.chw, 0
84. 0.149 0.279 ↑ 1.2 92 1

Sort (cost=36.77..37.05 rows=111 width=78) (actual time=0.219..0.279 rows=92 loops=1)

  • Sort Key: useview_pregnancy.chw
  • Sort Method: quicksort Memory: 37kB
85. 0.130 0.130 ↑ 1.2 92 1

Index Scan using useview_pregnancy_reported on useview_pregnancy (cost=0.31..33.00 rows=111 width=78) (actual time=0.064..0.130 rows=92 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))
86. 0.003 0.184 ↑ 77.0 1 1

Materialize (cost=69.56..80.65 rows=77 width=136) (actual time=0.183..0.184 rows=1 loops=1)

87. 0.017 0.181 ↑ 77.0 1 1

GroupAggregate (cost=69.56..79.69 rows=77 width=136) (actual time=0.181..0.181 rows=1 loops=1)

  • Group Key: pnc_1.chw, 0
88. 0.004 0.164 ↑ 78.0 1 1

Sort (cost=69.56..69.76 rows=78 width=101) (actual time=0.164..0.164 rows=1 loops=1)

  • Sort Key: pnc_1.chw
  • Sort Method: quicksort Memory: 25kB
89. 0.160 0.160 ↑ 78.0 1 1

Index Scan using useview_postnatal_care_count_reported_uuid on useview_postnatal_care pnc_1 (cost=0.44..67.11 rows=78 width=101) (actual time=0.046..0.160 rows=1 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))
90. 0.005 29.639 ↑ 10.0 3 1

Materialize (cost=4,206.72..4,207.70 rows=30 width=48) (actual time=29.631..29.639 rows=3 loops=1)

91. 0.023 29.634 ↑ 10.0 3 1

GroupAggregate (cost=4,206.72..4,207.32 rows=30 width=48) (actual time=29.628..29.634 rows=3 loops=1)

  • Group Key: anc.chw, 0
92. 0.014 29.611 ↑ 7.5 4 1

Sort (cost=4,206.72..4,206.80 rows=30 width=40) (actual time=29.610..29.611 rows=4 loops=1)

  • Sort Key: anc.chw
  • Sort Method: quicksort Memory: 25kB
93. 29.597 29.597 ↑ 7.5 4 1

Index Scan using useview_pregnancy_visit_pregnancy_reported_uuid on useview_pregnancy_visit anc (cost=0.44..4,205.99 rows=30 width=40) (actual time=12.524..29.597 rows=4 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))
94. 0.064 569.210 ↑ 3.1 65 1

Materialize (cost=45,992.97..47,202.50 rows=200 width=48) (actual time=568.902..569.210 rows=65 loops=1)

95. 0.209 569.146 ↑ 3.1 65 1

GroupAggregate (cost=45,992.97..47,200.00 rows=200 width=48) (actual time=568.898..569.146 rows=65 loops=1)

  • Group Key: p.chw, 0
96. 0.093 568.937 ↑ 1,746.4 69 1

Sort (cost=45,992.97..46,294.23 rows=120,503 width=76) (actual time=568.885..568.937 rows=69 loops=1)

  • Sort Key: p.chw
  • Sort Method: quicksort Memory: 34kB
97. 0.342 568.844 ↑ 1,746.4 69 1

Hash Left Join (cost=35,061.55..35,823.30 rows=120,503 width=76) (actual time=550.204..568.844 rows=69 loops=1)

  • Hash Cond: (p.patient_id = useview_postnatal_care.patient_id)
  • Filter: (((max(useview_postnatal_care.reported)) IS NULL) OR ((@ ((CASE WHEN (max(pv_1.new_edd) <> ''::text) THEN (max(pv_1.new_edd))::date ELSE max(p.edd) END) - ((max(useview_postnatal_care.reported)))::date)) > 60))
  • Rows Removed by Filter: 12
98. 16.913 359.835 ↑ 21.4 81 1

GroupAggregate (cost=23,871.17..24,610.89 rows=1,730 width=76) (actual time=341.284..359.835 rows=81 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: 9932
99. 32.064 342.922 ↓ 1.1 10,998 1

Sort (cost=23,871.17..23,897.13 rows=10,382 width=78) (actual time=341.152..342.922 rows=10,998 loops=1)

  • Sort Key: p.chw, p.patient_id
  • Sort Method: quicksort Memory: 1931kB
100. 7.519 310.858 ↓ 1.1 10,998 1

Hash Anti Join (cost=19,975.07..23,178.60 rows=10,382 width=78) (actual time=254.297..310.858 rows=10,998 loops=1)

  • Hash Cond: (p.patient_id = upv.patient_id)
101. 26.211 263.152 ↓ 1.4 17,866 1

Hash Join (cost=15,195.60..18,258.64 rows=12,894 width=78) (actual time=214.048..263.152 rows=17,866 loops=1)

  • Hash Cond: (p.patient_id = pv_1.patient_id)
  • Join Filter: (p.reported < pv_1.reported)
  • Rows Removed by Join Filter: 45
102. 23.100 23.100 ↑ 1.0 60,772 1

Seq Scan on useview_pregnancy p (cost=0.00..2,901.89 rows=61,389 width=84) (actual time=0.014..23.100 rows=60,772 loops=1)

103. 3.795 213.841 ↑ 2.2 16,317 1

Hash (cost=14,740.98..14,740.98 rows=36,370 width=46) (actual time=213.841..213.841 rows=16,317 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 1814kB
104. 2.573 210.046 ↑ 2.2 16,317 1

Subquery Scan on pv_1 (cost=14,105.97..14,740.98 rows=36,370 width=46) (actual time=194.304..210.046 rows=16,317 loops=1)

105. 6.437 207.473 ↑ 2.2 16,317 1

Unique (cost=14,105.97..14,377.28 rows=36,370 width=47) (actual time=194.292..207.473 rows=16,317 loops=1)

106. 124.555 201.036 ↑ 1.2 47,058 1

Sort (cost=14,105.97..14,241.63 rows=54,261 width=47) (actual time=194.290..201.036 rows=47,058 loops=1)

  • Sort Key: useview_pregnancy_visit.patient_id, useview_pregnancy_visit.reported DESC
  • Sort Method: quicksort Memory: 8113kB
107. 76.481 76.481 ↑ 1.2 47,058 1

Seq Scan on useview_pregnancy_visit (cost=0.00..9,838.99 rows=54,261 width=47) (actual time=28.425..76.481 rows=47,058 loops=1)

  • Filter: (((edd_updated IS TRUE) AND (reported > (date_trunc('month'::text, now()) - '9 mons'::interval))) OR (reported > (now() - '9 mons'::interval)))
  • Rows Removed by Filter: 130878
108. 1.363 40.187 ↑ 1.8 6,365 1

Hash (cost=4,638.88..4,638.88 rows=11,247 width=36) (actual time=40.187..40.187 rows=6,365 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 557kB
109. 0.848 38.824 ↑ 1.8 6,365 1

Subquery Scan on upv (cost=4,464.94..4,638.88 rows=11,247 width=36) (actual time=35.936..38.824 rows=6,365 loops=1)

110. 1.468 37.976 ↑ 1.8 6,365 1

Unique (cost=4,464.94..4,526.41 rows=11,247 width=44) (actual time=35.927..37.976 rows=6,365 loops=1)

111. 14.472 36.508 ↑ 1.6 7,762 1

Sort (cost=4,464.94..4,495.67 rows=12,293 width=44) (actual time=35.926..36.508 rows=7,762 loops=1)

  • Sort Key: useview_pregnancy_visit_1.patient_id, useview_pregnancy_visit_1.reported DESC
  • Sort Method: quicksort Memory: 799kB
112. 22.036 22.036 ↑ 1.6 7,762 1

Index Scan using useview_pregnancy_visit_continue_follow_up on useview_pregnancy_visit useview_pregnancy_visit_1 (cost=0.42..3,629.91 rows=12,293 width=44) (actual time=7.468..22.036 rows=7,762 loops=1)

  • Index Cond: (continue_follow_up = false)
  • Filter: ((reported > (date_trunc('month'::text, now()) - '9 mons'::interval)) OR (reported > (now() - '9 mons'::interval)))
  • Rows Removed by Filter: 18040
113. 18.393 208.667 ↓ 1.0 43,086 1

Hash (cost=10,673.14..10,673.14 rows=41,379 width=44) (actual time=208.667..208.667 rows=43,086 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3879kB
114. 30.282 190.274 ↓ 1.0 43,086 1

GroupAggregate (cost=0.42..10,259.35 rows=41,379 width=44) (actual time=0.250..190.274 rows=43,086 loops=1)

  • Group Key: useview_postnatal_care.patient_id
115. 159.992 159.992 ↑ 1.1 48,409 1

Index Scan using useview_postnatal_patient_id on useview_postnatal_care (cost=0.42..9,590.93 rows=50,927 width=44) (actual time=0.019..159.992 rows=48,409 loops=1)

  • Filter: (follow_up_count = '1'::text)
  • Rows Removed by Filter: 87359
116. 0.002 0.040 ↓ 0.0 0 1

Materialize (cost=154.06..154.35 rows=9 width=48) (actual time=0.040..0.040 rows=0 loops=1)

117. 0.001 0.038 ↓ 0.0 0 1

GroupAggregate (cost=154.06..154.24 rows=9 width=48) (actual time=0.038..0.038 rows=0 loops=1)

  • Group Key: assess.chw, 0
118. 0.009 0.037 ↓ 0.0 0 1

Sort (cost=154.06..154.08 rows=9 width=77) (actual time=0.037..0.037 rows=0 loops=1)

  • Sort Key: assess.chw
  • Sort Method: quicksort Memory: 25kB
119. 0.000 0.028 ↓ 0.0 0 1

Nested Loop (cost=0.87..153.92 rows=9 width=77) (actual time=0.028..0.028 rows=0 loops=1)

120. 0.028 0.028 ↓ 0.0 0 1

Index Scan using useview_assessment_reported on useview_assessment assess (cost=0.45..99.62 rows=37 width=81) (actual time=0.028..0.028 rows=0 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: 4
121. 0.000 0.000 ↓ 0.0 0

Index Only Scan using useview_assessment_follow_up_source_date_uuid on useview_assessment_follow_up follow_up (cost=0.42..1.46 rows=1 width=45) (never executed)

  • Index Cond: (form_source_id = assess.uuid)
  • Filter: ((date(date_trunc('day'::text, reported)) - date(date_trunc('day'::text, assess.reported))) <= 2)
  • Heap Fetches: 0
122. 0.001 6.795 ↓ 0.0 0 1

Materialize (cost=831.57..834.39 rows=86 width=48) (actual time=6.795..6.795 rows=0 loops=1)

123. 0.001 6.794 ↓ 0.0 0 1

GroupAggregate (cost=831.57..833.31 rows=86 width=48) (actual time=6.794..6.794 rows=0 loops=1)

  • Group Key: meta.chw, 0
124. 0.004 6.793 ↓ 0.0 0 1

Sort (cost=831.57..831.79 rows=88 width=76) (actual time=6.793..6.793 rows=0 loops=1)

  • Sort Key: meta.chw
  • Sort Method: quicksort Memory: 25kB
125. 0.066 6.789 ↓ 0.0 0 1

Bitmap Heap Scan on form_metadata meta (cost=737.43..828.73 rows=88 width=76) (actual time=6.789..6.789 rows=0 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))
126. 0.091 6.723 ↓ 0.0 0 1

BitmapAnd (cost=737.43..737.43 rows=88 width=0) (actual time=6.723..6.723 rows=0 loops=1)

127. 1.876 1.876 ↓ 3.0 21,202 1

Bitmap Index Scan on form_metadata_reported (cost=0.00..89.03 rows=6,958 width=0) (actual time=1.876..1.876 rows=21,202 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))
128. 4.756 4.756 ↑ 1.0 52,307 1

Bitmap Index Scan on form_metadata_formname (cost=0.00..648.10 rows=54,623 width=0) (actual time=4.755..4.756 rows=52,307 loops=1)

  • Index Cond: (formname = 'community_event'::text)
129. 36.628 9,604.188 ↑ 1.0 1 1,842

Index Only Scan using contactview_chp_uuid on contactview_chp chp (cost=0.28..264.14 rows=1 width=40) (actual time=5.214..5.214 rows=1 loops=1,842)

  • Index Cond: (uuid = chwlist.chw_uuid)
  • Heap Fetches: 1560
130.          

SubPlan (for Index Only Scan)

131. 9.173 4,792.884 ↓ 0.0 0 1,842

Nested Loop Semi Join (cost=117.15..120.44 rows=1 width=0) (actual time=2.602..2.602 rows=0 loops=1,842)

  • Join Filter: (meta_1.formname = "*VALUES*".column1)
  • Rows Removed by Join Filter: 0
132. 51.576 4,783.674 ↓ 0.0 0 1,842

Bitmap Heap Scan on form_metadata meta_1 (cost=117.15..120.26 rows=3 width=15) (actual time=2.597..2.597 rows=0 loops=1,842)

  • 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=29
133. 163.755 4,732.098 ↓ 0.0 0 1,842

BitmapAnd (cost=117.15..117.15 rows=3 width=0) (actual time=2.569..2.569 rows=0 loops=1,842)

134. 753.378 753.378 ↓ 1.2 2,160 1,842

Bitmap Index Scan on form_metadata_chw (cost=0.00..27.86 rows=1,774 width=0) (actual time=0.409..0.409 rows=2,160 loops=1,842)

  • Index Cond: (chw = chp.uuid)
135. 3,814.965 3,814.965 ↓ 3.0 21,202 1,835

Bitmap Index Scan on form_metadata_reported (cost=0.00..89.03 rows=6,958 width=0) (actual time=2.079..2.079 rows=21,202 loops=1,835)

  • 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))
136. 0.029 0.037 ↑ 1.0 3 37

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

137. 0.008 0.008 ↑ 1.0 3 1

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

138. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,187.50..4,036.92 rows=454 width=36) (never executed)

139. 0.000 0.000 ↓ 0.0 0

Unique (cost=0.06..0.08 rows=3 width=32) (never executed)

140. 0.000 0.000 ↓ 0.0 0

Sort (cost=0.06..0.07 rows=3 width=32) (never executed)

  • Sort Key: "*VALUES*_1".column1
141. 0.000 0.000 ↓ 0.0 0

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

142. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on form_metadata meta_2 (cost=1,187.44..1,344.11 rows=151 width=51) (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*_1".column1))
143. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=1,187.44..1,187.44 rows=151 width=0) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on form_metadata_reported (cost=0.00..89.03 rows=6,958 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))
145. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on form_metadata_formname (cost=0.00..1,096.38 rows=93,549 width=0) (never executed)

  • Index Cond: (formname = "*VALUES*_1".column1)
146. 1.813 575.294 ↓ 0.0 0 1,838

Nested Loop (cost=1.99..10.51 rows=12 width=0) (actual time=0.313..0.313 rows=0 loops=1,838)

147. 1.792 573.456 ↓ 0.0 0 1,838

Nested Loop (cost=1.71..8.18 rows=1 width=1,401) (actual time=0.312..0.312 rows=0 loops=1,838)

148. 5.514 571.618 ↓ 0.0 0 1,838

Nested Loop (cost=1.28..5.72 rows=1 width=36) (actual time=0.311..0.311 rows=0 loops=1,838)

  • Join Filter: (chw.parent_uuid = cmd_1.parent_uuid)
149. 11.028 82.710 ↑ 1.0 1 1,838

Nested Loop (cost=0.85..4.89 rows=1 width=108) (actual time=0.044..0.045 rows=1 loops=1,838)

150. 44.112 44.112 ↑ 1.0 1 1,838

Index Scan using contactview_metadata_uuid on contactview_metadata chw (cost=0.43..2.45 rows=1 width=72) (actual time=0.024..0.024 rows=1 loops=1,838)

  • Index Cond: (uuid = chp.uuid)
151. 27.570 27.570 ↑ 1.0 1 1,838

Index Only Scan using contactview_metadata_uuid on contactview_metadata chwarea (cost=0.43..2.45 rows=1 width=36) (actual time=0.015..0.015 rows=1 loops=1,838)

  • Index Cond: (uuid = chw.parent_uuid)
  • Heap Fetches: 330
152. 483.394 483.394 ↓ 0.0 0 1,838

Index Scan using contactview_metadata_parent_uuid on contactview_metadata cmd_1 (cost=0.43..0.81 rows=1 width=36) (actual time=0.263..0.263 rows=0 loops=1,838)

  • Index Cond: (parent_uuid = chwarea.uuid)
  • Filter: ((type = 'clinic'::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))
  • Rows Removed by Filter: 115
153. 0.046 0.046 ↑ 1.0 1 1

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

  • Index Cond: ((doc ->> '_id'::text) = chp.uuid)
  • Filter: (((doc ->> 'type'::text) = 'person'::text) AND ((doc ->> 'type'::text) = ANY ('{contact,clinic,district_hospital,health_center,person}'::text[])))
154. 0.025 0.025 ↑ 1.0 1 1

Index Scan using pat_health_center_expr_idx8 on pat_health_center (cost=0.28..2.31 rows=1 width=940) (actual time=0.025..0.025 rows=1 loops=1)

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

Nested Loop (cost=1.99..15,927.33 rows=873 width=32) (never executed)

156. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.71..15,902.46 rows=70 width=1,401) (never executed)

157. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.28..15,845.80 rows=92 width=36) (never executed)

158. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..15,843.11 rows=4 width=72) (never executed)

159. 0.000 0.000 ↓ 0.0 0

Index Scan using contactview_metadata_type on contactview_metadata cmd_2 (cost=0.43..15,836.33 rows=4 width=36) (never executed)

  • Index Cond: (type = 'clinic'::text)
  • 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))
160. 0.000 0.000 ↓ 0.0 0

Index Only Scan using contactview_metadata_uuid on contactview_metadata chwarea_1 (cost=0.43..1.70 rows=1 width=36) (never executed)

  • Index Cond: (uuid = cmd_2.parent_uuid)
  • Heap Fetches: 0
161. 0.000 0.000 ↓ 0.0 0

Index Scan using contactview_metadata_parent_uuid on contactview_metadata chw_1 (cost=0.43..0.59 rows=8 width=72) (never executed)

  • Index Cond: (parent_uuid = chwarea_1.uuid)
162. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_person_expr_idx8 on pat_person pat_person_1 (cost=0.42..0.61 rows=1 width=1,401) (never executed)

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

Index Scan using pat_health_center_expr_idx8 on pat_health_center pat_health_center_1 (cost=0.28..0.31 rows=1 width=940) (never executed)

  • Index Cond: ((doc ->> '_id'::text) = (pat_person_1.doc #>> '{parent,_id}'::text[]))
  • Filter: (((doc ->> 'type'::text) = 'health_center'::text) AND ((doc ->> 'type'::text) = ANY ('{contact,clinic,district_hospital,health_center,person}'::text[])))
164. 1.886 4,199.382 ↓ 0.0 0 1,837

Nested Loop (cost=118.12..138.71 rows=1 width=0) (actual time=2.286..2.286 rows=0 loops=1,837)

165. 4.902 4,193.871 ↓ 0.0 0 1,837

Nested Loop (cost=117.70..125.98 rows=3 width=72) (actual time=2.283..2.283 rows=0 loops=1,837)

166. 36.740 4,188.360 ↓ 0.0 0 1,837

Bitmap Heap Scan on form_metadata meta_3 (cost=117.15..120.26 rows=3 width=36) (actual time=2.280..2.280 rows=0 loops=1,837)

  • 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=23
167. 156.369 4,151.620 ↓ 0.0 0 1,837

BitmapAnd (cost=117.15..117.15 rows=3 width=0) (actual time=2.260..2.260 rows=0 loops=1,837)

168. 574.981 574.981 ↓ 1.2 2,157 1,837

Bitmap Index Scan on form_metadata_chw (cost=0.00..27.86 rows=1,774 width=0) (actual time=0.313..0.313 rows=2,157 loops=1,837)

  • Index Cond: (chw = chp.uuid)
169. 3,420.270 3,420.270 ↓ 3.0 21,202 1,830

Bitmap Index Scan on form_metadata_reported (cost=0.00..89.03 rows=6,958 width=0) (actual time=1.869..1.869 rows=21,202 loops=1,830)

  • 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))
170. 0.609 0.609 ↑ 1.0 1 29

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

  • Index Cond: (uuid = meta_3.uuid)
  • Heap Fetches: 3
171. 0.314 3.625 ↓ 0.0 0 29

Append (cost=0.42..4.12 rows=12 width=37) (actual time=0.125..0.125 rows=0 loops=29)

172. 0.522 0.522 ↓ 0.0 0 29

Index Scan using pat_clinic_expr_idx8 on pat_clinic form_36 (cost=0.42..0.46 rows=1 width=1,032) (actual time=0.018..0.018 rows=0 loops=29)

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

Index Scan using pat_form_postnatal_care_expr_idx8 on pat_form_postnatal_care form_37 (cost=0.42..0.45 rows=1 width=25) (actual time=0.017..0.017 rows=0 loops=29)

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

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

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

Index Scan using pat_feedback_expr_idx8 on pat_feedback form_39 (cost=0.41..0.44 rows=1 width=654) (actual time=0.013..0.013 rows=0 loops=28)

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

Index Scan using pat_form_expr_idx8 on pat_form form_40 (cost=0.14..0.17 rows=1 width=638) (actual time=0.003..0.003 rows=0 loops=28)

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

Index Scan using pat_health_center_expr_idx8 on pat_health_center form_41 (cost=0.28..0.31 rows=1 width=940) (actual time=0.007..0.007 rows=0 loops=28)

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

Index Scan using pat_info_expr_idx8 on pat_info form_42 (cost=0.56..0.65 rows=1 width=297) (actual time=0.022..0.022 rows=0 loops=28)

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

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

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

Index Scan using pat_person_expr_idx8 on pat_person form_44 (cost=0.42..0.50 rows=1 width=1,401) (actual time=0.018..0.018 rows=0 loops=28)

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

Index Scan using pat_traffic_stats_expr_idx8 on pat_traffic_stats form_45 (cost=0.28..0.30 rows=1 width=828) (actual time=0.005..0.005 rows=0 loops=28)

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

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

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

Index Scan using couchdb_default_expr_idx8 on couchdb_default form_47 (cost=0.28..0.31 rows=1 width=698) (actual time=0.008..0.008 rows=0 loops=28)

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

Nested Loop (cost=1.54..3,533.50 rows=1 width=36) (never executed)

185. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.98..3,098.61 rows=693 width=73) (never executed)

186. 0.000 0.000 ↓ 0.0 0

Append (cost=0.42..1,971.40 rows=693 width=37) (never executed)

187. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form_48 (cost=0.42..2.44 rows=1 width=1,032) (never executed)

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

Index Scan using pat_form_postnatal_care_expr_expr1_idx1 on pat_form_postnatal_care form_49 (cost=0.42..1,944.75 rows=682 width=25) (never executed)

  • Index Cond: ((doc #>> '{fields,follow_up_count}'::text[]) = '1'::text)
189. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_51 (cost=0.29..2.31 rows=1 width=654) (never executed)

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

Index Scan using pat_form_expr_idx9 on pat_form form_52 (cost=0.14..2.16 rows=1 width=638) (never executed)

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

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_53 (cost=0.28..2.30 rows=1 width=940) (never executed)

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

Index Scan using pat_info_expr_idx9 on pat_info form_54 (cost=0.43..2.46 rows=1 width=297) (never executed)

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

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

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

Index Scan using pat_person_expr_idx9 on pat_person form_56 (cost=0.42..2.45 rows=1 width=1,401) (never executed)

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

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_57 (cost=0.28..2.30 rows=1 width=828) (never executed)

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

Index Scan using pat_usage_stats_expr_idx9 on pat_usage_stats form_58 (cost=0.14..2.16 rows=1 width=1,075) (never executed)

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

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_59 (cost=0.28..2.31 rows=1 width=698) (never executed)

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

Index Only Scan using form_metadata_uuid on form_metadata fm_1 (cost=0.56..1.63 rows=1 width=36) (never executed)

  • Index Cond: (uuid = (form_48.doc ->> '_id'::text))
  • Heap Fetches: 0
200. 0.000 0.000 ↓ 0.0 0

Index Scan using form_metadata_uuid on form_metadata meta_4 (cost=0.56..0.63 rows=1 width=72) (never executed)

  • Index Cond: (uuid = fm_1.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))
201. 71.838 79.206 ↑ 123.9 12 1,842

GroupAggregate (cost=294.84..334.85 rows=1,487 width=48) (actual time=0.014..0.043 rows=12 loops=1,842)

  • Group Key: useview_households_visited.chw, 0
202. 5.127 7.368 ↑ 119.7 21 1,842

Sort (cost=294.84..301.12 rows=2,514 width=76) (actual time=0.002..0.004 rows=21 loops=1,842)

  • Sort Key: useview_households_visited.chw
  • Sort Method: quicksort Memory: 27kB
203. 2.241 2.241 ↑ 119.7 21 1

Index Only Scan using households_date_visited_chw_hh on useview_households_visited (cost=0.57..152.85 rows=2,514 width=76) (actual time=0.065..2.241 rows=21 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))
  • Heap Fetches: 3918
204. 62.628 64.470 ↑ 164.0 3 1,842

GroupAggregate (cost=594.54..802.77 rows=492 width=152) (actual time=0.017..0.035 rows=3 loops=1,842)

  • Group Key: population.chp_area_uuid, 0
205. 1.365 1.842 ↑ 185.7 3 1,842

Sort (cost=594.54..595.94 rows=557 width=86) (actual time=0.001..0.001 rows=3 loops=1,842)

  • Sort Key: population.chp_area_uuid
  • Sort Method: quicksort Memory: 25kB
206. 0.477 0.477 ↑ 185.7 3 1

Index Scan using useview_population_demographics_reported_idx on useview_population_demographics population (cost=0.45..569.14 rows=557 width=86) (actual time=0.026..0.477 rows=3 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))
207. 0.003 0.054 ↑ 73.0 1 1

Materialize (cost=50.91..54.21 rows=73 width=64) (actual time=0.053..0.054 rows=1 loops=1)

208. 0.014 0.051 ↑ 73.0 1 1

GroupAggregate (cost=50.91..53.30 rows=73 width=64) (actual time=0.051..0.051 rows=1 loops=1)

  • Group Key: survey.chw, 0
209. 0.004 0.037 ↑ 74.0 1 1

Sort (cost=50.91..51.09 rows=74 width=88) (actual time=0.037..0.037 rows=1 loops=1)

  • Sort Key: survey.chw
  • Sort Method: quicksort Memory: 25kB
210. 0.033 0.033 ↑ 74.0 1 1

Index Scan using useview_family_survey_uuid_reported_chw on useview_family_survey survey (cost=0.45..48.61 rows=74 width=88) (actual time=0.018..0.033 rows=1 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))
211. 39,240.126 78,778.656 ↑ 122.2 1,122 1,842

GroupAggregate (cost=32,005.75..35,877.27 rows=137,083 width=48) (actual time=0.265..42.768 rows=1,122 loops=1,842)

  • Group Key: contactview_metadata_1.parent_uuid, 0
212. 39,461.235 39,538.530 ↑ 2.1 120,165 1,842

Sort (cost=32,005.75..32,630.92 rows=250,069 width=40) (actual time=0.233..21.465 rows=120,165 loops=1,842)

  • Sort Key: contactview_metadata_1.parent_uuid
  • Sort Method: quicksort Memory: 24856kB
213. 77.295 77.295 ↑ 1.0 239,512 1

Index Scan using contactview_metadata_type on contactview_metadata contactview_metadata_1 (cost=0.43..9,584.60 rows=250,069 width=40) (actual time=0.027..77.295 rows=239,512 loops=1)

  • Index Cond: (type = 'clinic'::text)
214. 3.961 2,931.279 ↓ 1.1 2,706 1

Materialize (cost=0.56..163,915.06 rows=2,435 width=48) (actual time=0.082..2,931.279 rows=2,706 loops=1)

215. 850.748 2,927.318 ↓ 1.1 2,706 1

GroupAggregate (cost=0.56..163,884.62 rows=2,435 width=48) (actual time=0.078..2,927.318 rows=2,706 loops=1)

  • Group Key: useview_chp_sync.chw_uuid, 0
216. 2,076.570 2,076.570 ↑ 1.0 5,259,497 1

Index Only Scan using useview_chp_sync_chw_uuid_latest_replication_date on useview_chp_sync (cost=0.56..123,842.13 rows=5,332,505 width=48) (actual time=0.058..2,076.570 rows=5,259,497 loops=1)

  • Heap Fetches: 0
217. 164.352 2,505.120 ↑ 2.0 1,112 1,842

Materialize (cost=0.55..81,726.97 rows=2,205 width=48) (actual time=0.001..1.360 rows=1,112 loops=1,842)

218. 0.590 2,340.768 ↓ 1.0 2,222 1

Subquery Scan on population_all_time (cost=0.55..81,715.95 rows=2,205 width=48) (actual time=1.311..2,340.768 rows=2,222 loops=1)

219. 180.833 2,340.178 ↓ 1.0 2,222 1

GroupAggregate (cost=0.55..81,693.90 rows=2,205 width=48) (actual time=1.309..2,340.178 rows=2,222 loops=1)

  • Group Key: population_1.chp_area_uuid, 0
220. 2,159.345 2,159.345 ↑ 1.0 977,458 1

Index Scan using useview_population_demographics_chp_area_reported on useview_population_demographics population_1 (cost=0.55..74,340.75 rows=977,480 width=76) (actual time=0.040..2,159.345 rows=977,458 loops=1)

221. 0.003 4.844 ↑ 200.0 1 1

Materialize (cost=451.59..460.95 rows=200 width=56) (actual time=4.844..4.844 rows=1 loops=1)

222. 0.016 4.841 ↑ 200.0 1 1

GroupAggregate (cost=451.59..458.45 rows=200 width=56) (actual time=4.841..4.841 rows=1 loops=1)

  • Group Key: "*SELECT* 1".reported_by, 0
223. 0.010 4.825 ↑ 221.0 1 1

Sort (cost=451.59..452.14 rows=221 width=80) (actual time=4.825..4.825 rows=1 loops=1)

  • Sort Key: "*SELECT* 1".reported_by
  • Sort Method: quicksort Memory: 25kB
224. 0.002 4.815 ↑ 221.0 1 1

Result (cost=0.00..442.98 rows=221 width=80) (actual time=4.541..4.815 rows=1 loops=1)

225. 0.002 4.813 ↑ 221.0 1 1

Append (cost=0.00..440.77 rows=221 width=76) (actual time=4.540..4.813 rows=1 loops=1)

226. 0.000 4.348 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.00..302.44 rows=1 width=78) (actual time=4.348..4.348 rows=0 loops=1)

227. 4.348 4.348 ↓ 0.0 0 1

Seq Scan on useview_fp_registration (cost=0.00..302.43 rows=1 width=256) (actual time=4.348..4.348 rows=0 loops=1)

  • 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: 4862
228. 0.001 0.018 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.43..2.72 rows=1 width=78) (actual time=0.018..0.018 rows=0 loops=1)

229. 0.017 0.017 ↓ 0.0 0 1

Index Scan using index_useview_person_fp_registration_reported_chw_patient_id on useview_person_fp_registration (cost=0.43..2.71 rows=1 width=256) (actual time=0.017..0.017 rows=0 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 >= 15)
230. 0.004 0.445 ↑ 219.0 1 1

Subquery Scan on *SELECT* 3 (cost=0.44..134.51 rows=219 width=76) (actual time=0.172..0.445 rows=1 loops=1)

231. 0.441 0.441 ↑ 219.0 1 1

Index Scan using useview_postnatal_reported on useview_postnatal_care useview_postnatal_care_1 (cost=0.44..132.32 rows=219 width=254) (actual time=0.169..0.441 rows=1 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))
232. 0.007 0.470 ↑ 40.0 5 1

Materialize (cost=289.24..309.24 rows=200 width=80) (actual time=0.409..0.470 rows=5 loops=1)

233. 0.070 0.463 ↑ 40.0 5 1

GroupAggregate (cost=289.24..306.74 rows=200 width=80) (actual time=0.408..0.463 rows=5 loops=1)

  • Group Key: assess_u1fu_pnc_aggregated.chw, 0
234. 0.009 0.393 ↑ 40.0 5 1

Sort (cost=289.24..289.74 rows=200 width=114) (actual time=0.389..0.393 rows=5 loops=1)

  • Sort Key: assess_u1fu_pnc_aggregated.chw
  • Sort Method: quicksort Memory: 25kB
235. 0.004 0.384 ↑ 40.0 5 1

Subquery Scan on assess_u1fu_pnc_aggregated (cost=277.76..281.60 rows=200 width=114) (actual time=0.380..0.384 rows=5 loops=1)

236. 0.003 0.380 ↑ 40.0 5 1

Unique (cost=277.76..279.60 rows=200 width=118) (actual time=0.377..0.380 rows=5 loops=1)

237. 0.007 0.377 ↑ 73.4 5 1

Sort (cost=277.76..278.68 rows=367 width=117) (actual time=0.376..0.377 rows=5 loops=1)

  • Sort Key: useview_assessment.patient_id, useview_assessment.reported DESC
  • Sort Method: quicksort Memory: 25kB
238. 0.002 0.370 ↑ 73.4 5 1

Append (cost=0.45..262.13 rows=367 width=117) (actual time=0.022..0.370 rows=5 loops=1)

239. 0.025 0.025 ↑ 66.5 4 1

Index Scan using useview_assessment_reported on useview_assessment (cost=0.45..98.29 rows=266 width=94) (actual time=0.021..0.025 rows=4 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))
240. 0.060 0.060 ↓ 0.0 0 1

Index Scan using useview_u1_follow_up_reported_chw_uuid on useview_u1_follow_up (cost=0.31..23.82 rows=28 width=161) (actual time=0.060..0.060 rows=0 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))
241. 0.283 0.283 ↑ 73.0 1 1

Index Scan using useview_postnatal_reported on useview_postnatal_care useview_postnatal_care_2 (cost=0.44..134.51 rows=73 width=185) (actual time=0.074..0.283 rows=1 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: is_date((date_of_birth)::character varying)
242. 0.000 0.000 ↓ 0.0 0 1,842

Materialize (cost=81.30..81.37 rows=1 width=56) (actual time=0.000..0.000 rows=0 loops=1,842)

243. 0.000 0.507 ↓ 0.0 0 1

Subquery Scan on infant_deaths (cost=81.30..81.36 rows=1 width=56) (actual time=0.507..0.507 rows=0 loops=1)

244. 0.001 0.507 ↓ 0.0 0 1

GroupAggregate (cost=81.30..81.35 rows=1 width=56) (actual time=0.507..0.507 rows=0 loops=1)

  • Group Key: dr.chw, 0
245. 0.002 0.506 ↓ 0.0 0 1

Sort (cost=81.30..81.30 rows=1 width=1,622) (actual time=0.506..0.506 rows=0 loops=1)

  • Sort Key: dr.chw
  • Sort Method: quicksort Memory: 25kB
246. 0.001 0.504 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.85..81.29 rows=1 width=1,622) (actual time=0.504..0.504 rows=0 loops=1)

247. 0.503 0.503 ↓ 0.0 0 1

Index Scan using form_metadata_formname on form_metadata dr (cost=0.43..55.62 rows=1 width=72) (actual time=0.503..0.503 rows=0 loops=1)

  • Index Cond: (formname = 'death_report'::text)
  • 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: 638
248. 0.000 0.000 ↓ 0.0 0

Append (cost=0.42..25.55 rows=12 width=1,582) (never executed)

249. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_clinic_expr_idx9 on pat_clinic form (cost=0.42..2.44 rows=1 width=1,032) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
250. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_form_death_report_expr_idx8 on pat_form_death_report form_1 (cost=0.28..2.30 rows=1 width=1,595) (never executed)

  • Index Cond: ((doc ->> '_id'::text) = dr.uuid)
  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
251. 0.000 0.000 ↓ 0.0 0

Seq Scan on pat_district_hospital form_2 (cost=0.00..1.28 rows=1 width=432) (never executed)

  • Filter: (((doc ->> 'form'::text) = 'death_report'::text) AND (dr.uuid = (doc ->> '_id'::text)))
252. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_3 (cost=0.29..2.31 rows=1 width=654) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
253. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_form_expr_idx9 on pat_form form_4 (cost=0.14..2.16 rows=1 width=638) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
254. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_5 (cost=0.28..2.30 rows=1 width=940) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
255. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_info_expr_idx9 on pat_info form_6 (cost=0.43..2.46 rows=1 width=297) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
256. 0.000 0.000 ↓ 0.0 0

Seq Scan on pat_meta form_7 (cost=0.00..1.02 rows=1 width=849) (never executed)

  • Filter: (((doc ->> 'form'::text) = 'death_report'::text) AND (dr.uuid = (doc ->> '_id'::text)))
257. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_person_expr_idx9 on pat_person form_8 (cost=0.42..2.45 rows=1 width=1,401) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
258. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_9 (cost=0.28..2.30 rows=1 width=828) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
259. 0.000 0.000 ↓ 0.0 0

Index Scan using pat_usage_stats_expr_idx9 on pat_usage_stats form_10 (cost=0.14..2.16 rows=1 width=1,075) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
260. 0.000 0.000 ↓ 0.0 0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_11 (cost=0.28..2.31 rows=1 width=698) (never executed)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
  • Filter: (dr.uuid = (doc ->> '_id'::text))
261. 0.001 98.081 ↓ 0.0 0 1

Materialize (cost=8,458.49..8,458.56 rows=2 width=48) (actual time=98.081..98.081 rows=0 loops=1)

262. 0.001 98.080 ↓ 0.0 0 1

GroupAggregate (cost=8,458.49..8,458.53 rows=2 width=48) (actual time=98.080..98.080 rows=0 loops=1)

  • Group Key: "*SELECT* 1_1".chw_uuid, 0
263. 0.002 98.079 ↓ 0.0 0 1

Sort (cost=8,458.49..8,458.50 rows=2 width=40) (actual time=98.079..98.079 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_1".chw_uuid
  • Sort Method: quicksort Memory: 25kB
264. 0.001 98.077 ↓ 0.0 0 1

Result (cost=8,224.72..8,458.48 rows=2 width=40) (actual time=98.076..98.077 rows=0 loops=1)

265. 0.002 98.076 ↓ 0.0 0 1

Append (cost=8,224.72..8,458.46 rows=2 width=36) (actual time=98.076..98.076 rows=0 loops=1)

266. 0.039 77.191 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_1 (cost=8,224.72..8,224.88 rows=1 width=36) (actual time=77.191..77.191 rows=0 loops=1)

  • Filter: (("*SELECT* 1_1".reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND ("*SELECT* 1_1".reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Rows Removed by Filter: 18
267. 0.021 77.152 ↓ 4.5 18 1

Unique (cost=8,224.72..8,224.74 rows=4 width=80) (actual time=77.126..77.152 rows=18 loops=1)

268. 0.085 77.131 ↓ 14.5 58 1

Sort (cost=8,224.72..8,224.73 rows=4 width=80) (actual time=77.125..77.131 rows=58 loops=1)

  • Sort Key: pv_2.patient_id
  • Sort Method: quicksort Memory: 33kB
269. 23.712 77.046 ↓ 14.5 58 1

Hash Join (cost=230.47..8,224.68 rows=4 width=80) (actual time=19.029..77.046 rows=58 loops=1)

  • Hash Cond: (pv_2.patient_id = (form_12.doc #>> '{fields,inputs,contact,_id}'::text[]))
270. 35.373 35.373 ↑ 1.0 177,846 1

Seq Scan on useview_pregnancy_visit pv_2 (cost=0.00..7,072.45 rows=184,343 width=36) (actual time=0.006..35.373 rows=177,846 loops=1)

  • Filter: (patient_id <> ''::text)
  • Rows Removed by Filter: 90
271. 4.475 17.961 ↓ 638.0 638 1

Hash (cost=230.46..230.46 rows=1 width=1,626) (actual time=17.961..17.961 rows=638 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1052kB
272. 8.242 13.486 ↓ 638.0 638 1

Hash Join (cost=46.01..230.46 rows=1 width=1,626) (actual time=0.409..13.486 rows=638 loops=1)

  • Hash Cond: ((form_12.doc ->> '_id'::text) = dr_1.uuid)
273. 0.071 4.888 ↑ 1.0 646 1

Append (cost=0.42..183.06 rows=658 width=1,582) (actual time=0.025..4.888 rows=646 loops=1)

274. 0.007 0.007 ↓ 0.0 0 1

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
275. 4.755 4.755 ↑ 1.0 646 1

Seq Scan on pat_form_death_report form_13 (cost=0.00..156.71 rows=647 width=1,595) (actual time=0.017..4.755 rows=646 loops=1)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
276. 0.013 0.013 ↓ 0.0 0 1

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

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
  • Rows Removed by Filter: 14
277. 0.006 0.006 ↓ 0.0 0 1

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_15 (cost=0.29..2.31 rows=1 width=654) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
278. 0.003 0.003 ↓ 0.0 0 1

Index Scan using pat_form_expr_idx9 on pat_form form_16 (cost=0.14..2.16 rows=1 width=638) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
279. 0.004 0.004 ↓ 0.0 0 1

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_17 (cost=0.28..2.30 rows=1 width=940) (actual time=0.004..0.004 rows=0 loops=1)

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

Index Scan using pat_info_expr_idx9 on pat_info form_18 (cost=0.43..2.45 rows=1 width=297) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
281. 0.005 0.005 ↓ 0.0 0 1

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

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
  • Rows Removed by Filter: 1
282. 0.006 0.006 ↓ 0.0 0 1

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

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

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_21 (cost=0.28..2.29 rows=1 width=828) (actual time=0.004..0.004 rows=0 loops=1)

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

Index Scan using pat_usage_stats_expr_idx9 on pat_usage_stats form_22 (cost=0.14..2.16 rows=1 width=1,075) (actual time=0.003..0.003 rows=0 loops=1)

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

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_23 (cost=0.28..2.30 rows=1 width=698) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
286. 0.158 0.356 ↑ 1.3 638 1

Hash (cost=35.55..35.55 rows=803 width=80) (actual time=0.356..0.356 rows=638 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 81kB
287. 0.198 0.198 ↑ 1.3 638 1

Index Scan using form_metadata_formname on form_metadata dr_1 (cost=0.43..35.55 rows=803 width=80) (actual time=0.008..0.198 rows=638 loops=1)

  • Index Cond: (formname = 'death_report'::text)
288. 0.016 20.883 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_1 (cost=233.53..233.58 rows=1 width=36) (actual time=20.883..20.883 rows=0 loops=1)

  • Filter: (("*SELECT* 2_1".reported >= (date_trunc('day'::text, date_trunc('month'::text, now())))::timestamp without time zone) AND ("*SELECT* 2_1".reported < ((date_trunc('day'::text, now()) + '1 day'::interval))::timestamp without time zone))
  • Rows Removed by Filter: 16
289. 0.010 20.867 ↓ 16.0 16 1

Unique (cost=233.53..233.54 rows=1 width=80) (actual time=20.855..20.867 rows=16 loops=1)

290. 0.043 20.857 ↓ 40.0 40 1

Sort (cost=233.53..233.54 rows=1 width=80) (actual time=20.854..20.857 rows=40 loops=1)

  • Sort Key: pc_1.patient_id
  • Sort Method: quicksort Memory: 30kB
291. 3.913 20.814 ↓ 40.0 40 1

Nested Loop (cost=46.43..233.52 rows=1 width=80) (actual time=2.596..20.814 rows=40 loops=1)

292. 7.967 13.073 ↓ 638.0 638 1

Hash Join (cost=46.01..230.46 rows=1 width=1,626) (actual time=0.431..13.073 rows=638 loops=1)

  • Hash Cond: ((form_24.doc ->> '_id'::text) = dr_2.uuid)
293. 0.073 4.731 ↑ 1.0 646 1

Append (cost=0.42..183.06 rows=658 width=1,582) (actual time=0.031..4.731 rows=646 loops=1)

294. 0.011 0.011 ↓ 0.0 0 1

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
295. 4.588 4.588 ↑ 1.0 646 1

Seq Scan on pat_form_death_report form_25 (cost=0.00..156.71 rows=647 width=1,595) (actual time=0.019..4.588 rows=646 loops=1)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
296. 0.015 0.015 ↓ 0.0 0 1

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

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
  • Rows Removed by Filter: 14
297. 0.005 0.005 ↓ 0.0 0 1

Index Scan using pat_feedback_expr_idx9 on pat_feedback form_27 (cost=0.29..2.31 rows=1 width=654) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
298. 0.007 0.007 ↓ 0.0 0 1

Index Scan using pat_form_expr_idx9 on pat_form form_28 (cost=0.14..2.16 rows=1 width=638) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
299. 0.004 0.004 ↓ 0.0 0 1

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_29 (cost=0.28..2.30 rows=1 width=940) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
300. 0.006 0.006 ↓ 0.0 0 1

Index Scan using pat_info_expr_idx9 on pat_info form_30 (cost=0.43..2.45 rows=1 width=297) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
301. 0.005 0.005 ↓ 0.0 0 1

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

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
  • Rows Removed by Filter: 1
302. 0.005 0.005 ↓ 0.0 0 1

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
303. 0.004 0.004 ↓ 0.0 0 1

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_33 (cost=0.28..2.29 rows=1 width=828) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
304. 0.003 0.003 ↓ 0.0 0 1

Index Scan using pat_usage_stats_expr_idx9 on pat_usage_stats form_34 (cost=0.14..2.16 rows=1 width=1,075) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
305. 0.005 0.005 ↓ 0.0 0 1

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_35 (cost=0.28..2.30 rows=1 width=698) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
306. 0.142 0.375 ↑ 1.3 638 1

Hash (cost=35.55..35.55 rows=803 width=80) (actual time=0.375..0.375 rows=638 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 81kB
307. 0.233 0.233 ↑ 1.3 638 1

Index Scan using form_metadata_formname on form_metadata dr_2 (cost=0.43..35.55 rows=803 width=80) (actual time=0.015..0.233 rows=638 loops=1)

  • Index Cond: (formname = 'death_report'::text)
308. 3.828 3.828 ↓ 0.0 0 638

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pc_1 (cost=0.42..3.06 rows=1 width=36) (actual time=0.006..0.006 rows=0 loops=638)

  • Index Cond: (patient_id = (form_24.doc #>> '{fields,inputs,contact,_id}'::text[]))
  • Filter: ((patient_id <> ''::text) AND (date_part('year'::text, age((CURRENT_DATE)::timestamp with time zone, ((date_of_birth)::date)::timestamp with time zone)) >= '12'::double precision))
  • Rows Removed by Filter: 0
309. 0.013 0.252 ↑ 47.6 13 1

Materialize (cost=62.94..84.46 rows=619 width=48) (actual time=0.089..0.252 rows=13 loops=1)

310. 0.159 0.239 ↑ 47.6 13 1

GroupAggregate (cost=62.94..76.72 rows=619 width=48) (actual time=0.086..0.239 rows=13 loops=1)

  • Group Key: useview_home_visit.reported_by, 0
311. 0.027 0.080 ↑ 44.6 17 1

Sort (cost=62.94..64.84 rows=759 width=76) (actual time=0.068..0.080 rows=17 loops=1)

  • Sort Key: useview_home_visit.reported_by
  • Sort Method: quicksort Memory: 27kB
312. 0.053 0.053 ↑ 44.6 17 1

Index Only Scan using index_useview_home_visit_reported_family_uuid_reported_by on useview_home_visit (cost=0.45..26.63 rows=759 width=76) (actual time=0.050..0.053 rows=17 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))
  • Heap Fetches: 0
313. 0.002 1.598 ↑ 4.0 1 1

Materialize (cost=153.47..155.55 rows=4 width=97) (actual time=1.597..1.598 rows=1 loops=1)

314. 0.013 1.596 ↑ 4.0 1 1

GroupAggregate (cost=153.47..155.50 rows=4 width=97) (actual time=1.596..1.596 rows=1 loops=1)

  • Group Key: "*SELECT* 1_2".reported_by, 0
315. 0.003 1.583 ↑ 47.0 1 1

Sort (cost=153.47..153.58 rows=47 width=178) (actual time=1.583..1.583 rows=1 loops=1)

  • Sort Key: "*SELECT* 1_2".reported_by
  • Sort Method: quicksort Memory: 25kB
316. 0.254 1.580 ↑ 47.0 1 1

Hash Right Join (cost=50.08..152.16 rows=47 width=178) (actual time=1.577..1.580 rows=1 loops=1)

  • Hash Cond: (useview_fp_follow_up_prospective_ke.source_id = "*SELECT* 1_2".form_uuid)
317. 0.190 0.811 ↑ 1.0 2,326 1

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

318. 0.286 0.286 ↑ 1.0 930 1

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

319. 0.202 0.202 ↑ 1.0 683 1

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

320. 0.133 0.133 ↑ 1.0 713 1

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

321. 0.003 0.515 ↑ 4.0 1 1

Hash (cost=50.03..50.03 rows=4 width=122) (actual time=0.515..0.515 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
322. 0.001 0.512 ↑ 4.0 1 1

Append (cost=0.29..50.03 rows=4 width=122) (actual time=0.028..0.512 rows=1 loops=1)

323. 0.001 0.501 ↑ 3.0 1 1

Subquery Scan on *SELECT* 1_2 (cost=0.29..47.67 rows=3 width=122) (actual time=0.028..0.501 rows=1 loops=1)

324. 0.002 0.500 ↑ 3.0 1 1

Result (cost=0.29..47.64 rows=3 width=122) (actual time=0.027..0.500 rows=1 loops=1)

325. 0.001 0.498 ↑ 3.0 1 1

Append (cost=0.29..47.61 rows=3 width=121) (actual time=0.025..0.498 rows=1 loops=1)

326. 0.012 0.012 ↓ 0.0 0 1

Index Scan using index_useview_fp_follow_up_prospective_ke_reported_patient_id_u on useview_fp_follow_up_prospective_ke useview_fp_follow_up_prospective_ke_1 (cost=0.29..2.32 rows=1 width=121) (actual time=0.012..0.012 rows=0 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))
327. 0.013 0.013 ↑ 1.0 1 1

Index Scan using index_useview_fp_follow_up_short_term_ke_reported_patient_id_uu on useview_fp_follow_up_short_term_ke useview_fp_follow_up_short_term_ke_1 (cost=0.29..2.31 rows=1 width=121) (actual time=0.013..0.013 rows=1 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))
328. 0.472 0.472 ↓ 0.0 0 1

Seq Scan on useview_fp_follow_up_long_term_ke useview_fp_follow_up_long_term_ke_1 (cost=0.00..42.95 rows=1 width=121) (actual time=0.472..0.472 rows=0 loops=1)

  • 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: 713
329. 0.001 0.010 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_2 (cost=0.30..2.34 rows=1 width=122) (actual time=0.010..0.010 rows=0 loops=1)

330. 0.009 0.009 ↓ 0.0 0 1

Index Scan using index_useview_fp_registration_ke_reported_patient_id_uuid on useview_fp_registration_ke (cost=0.30..2.33 rows=1 width=122) (actual time=0.009..0.009 rows=0 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))
Planning time : 70.237 ms
Execution time : 98,636.106 ms