explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9e4I

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

Limit (cost=105,470.75..105,470.77 rows=1 width=32) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Aggregate (cost=105,470.75..105,470.77 rows=1 width=32) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,431.82..105,470.75 rows=1 width=8) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues4.pat_id) AND ((mvpatpdtproc2.action_date)::date >= (mvpathissues4.hi_start_date)::date) AND ((mvpathissues4.hi_end_date IS NULL) OR ((mvpatpdtproc2.action_date)::date < (mvpathissues4.hi_end_date)::date)))
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,431.39..105,469.83 rows=1 width=144) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = attachmentaap5.patient_ident_id) AND (mvpatmeasure1.mi_id = attachmentaap5.mi_id) AND ((mvpatpdtproc2.action_date)::date >= (attachmentaap5.enrl_register_date)::date) AND ((attachmentaap5.enrl_unregister_date IS NULL) OR ((mvpatpdtproc2.action_date)::date < (attachmentaap5.enrl_unregister_date)::date)) AND (((mvpatpdtproc2.action_date)::date - '18 years'::interval) >= attachmentaap5.patient_birthday))
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,430.96..105,469.02 rows=1 width=224) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues5.pat_id) AND ((mvpatpdtproc1.action_date)::date >= (mvpathissues5.hi_start_date)::date) AND ((mvpathissues5.hi_end_date IS NULL) OR ((mvpatpdtproc1.action_date)::date < (mvpathissues5.hi_end_date)::date)))
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,430.52..105,468.11 rows=1 width=224) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = attachmentaap6.patient_ident_id) AND (mvpatmeasure1.mi_id = attachmentaap6.mi_id) AND ((mvpatpdtproc1.action_date)::date >= (attachmentaap6.enrl_register_date)::date) AND ((attachmentaap6.enrl_unregister_date IS NULL) OR ((mvpatpdtproc1.action_date)::date < (attachmentaap6.enrl_unregister_date)::date)) AND (((mvpatpdtproc1.action_date)::date - '18 years'::interval) >= attachmentaap6.patient_birthday))
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,430.09..105,467.30 rows=1 width=208) (actual rows= loops=)

  • Join Filter: ((mvpatpdtproc1.procedure_item_id <> mvpatpdtproc2.procedure_item_id) AND (mvpatmeasure1.pat_id = mvpatpdtproc2.pat_id) AND (mvpatmeasure1.mi_id = mvpatpdtproc2.mi_id))
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,429.66..105,466.38 rows=1 width=192) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues3.pat_id) AND ((mvpatmeasure4.action_date)::date >= (mvpathissues3.hi_start_date)::date) AND ((mvpathissues3.hi_end_date IS NULL) OR ((mvpatmeasure4.action_date)::date < (mvpathissues3.hi_end_date)::date)))
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,429.23..105,465.46 rows=1 width=192) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = attachmentaap4.patient_ident_id) AND (mvpatmeasure1.mi_id = attachmentaap4.mi_id) AND ((mvpatmeasure4.action_date)::date >= (attachmentaap4.enrl_register_date)::date) AND ((attachmentaap4.enrl_unregister_date IS NULL) OR ((mvpatmeasure4.action_date)::date < (attachmentaap4.enrl_unregister_date)::date)) AND (((mvpatmeasure4.action_date)::date - '18 years'::interval) >= attachmentaap4.patient_birthday))
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,428.80..105,464.65 rows=1 width=176) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues2.pat_id) AND ((mvpatmeasure3.action_date)::date >= (mvpathissues2.hi_start_date)::date) AND ((mvpathissues2.hi_end_date IS NULL) OR ((mvpatmeasure3.action_date)::date < (mvpathissues2.hi_end_date)::date)))
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,428.36..105,463.74 rows=1 width=176) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = attachmentaap3.patient_ident_id) AND (mvpatmeasure1.mi_id = attachmentaap3.mi_id) AND ((mvpatmeasure3.action_date)::date >= (attachmentaap3.enrl_register_date)::date) AND ((attachmentaap3.enrl_unregister_date IS NULL) OR ((mvpatmeasure3.action_date)::date < (attachmentaap3.enrl_unregister_date)::date)) AND (((mvpatmeasure3.action_date)::date - '18 years'::interval) >= attachmentaap3.patient_birthday))
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,427.93..105,462.93 rows=1 width=160) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues1.pat_id) AND ((mvpatmeasure2.action_date)::date >= (mvpathissues1.hi_start_date)::date) AND ((mvpathissues1.hi_end_date IS NULL) OR ((mvpatmeasure2.action_date)::date < (mvpathissues1.hi_end_date)::date)))
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,427.50..105,462.01 rows=1 width=160) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpathissues6.pat_id) AND ((mvpatmeasure1.action_date)::date >= (mvpathissues6.hi_start_date)::date) AND ((mvpathissues6.hi_end_date IS NULL) OR ((mvpatmeasure1.action_date)::date < (mvpathissues6.hi_end_date)::date)))
14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,427.06..105,461.09 rows=1 width=160) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = mvpatpdtproc1.pat_id) AND (mvpatmeasure1.mi_id = mvpatpdtproc1.mi_id))
15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,426.63..105,460.17 rows=1 width=128) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.measurement_id <> mvpatmeasure4.measurement_id) AND (mvpatmeasure4.measurement_id <> mvpatmeasure2.measurement_id) AND (mvpatmeasure4.measurement_id <> mvpatmeasure3.measurement_id) AND (mvpatmeasure1.pat_id = mvpatmeasure4.pat_id) AND (mvpatmeasure1.mi_id = mvpatmeasure4.mi_id))
16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,426.19..105,458.09 rows=1 width=128) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.measurement_id <> mvpatmeasure3.measurement_id) AND (mvpatmeasure2.measurement_id <> mvpatmeasure3.measurement_id) AND (mvpatmeasure1.pat_id = mvpatmeasure3.pat_id) AND (mvpatmeasure1.mi_id = mvpatmeasure3.mi_id))
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,425.76..105,456.01 rows=1 width=96) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.measurement_id <> mvpatmeasure2.measurement_id) AND (mvpatmeasure1.pat_id = mvpatmeasure2.pat_id) AND (mvpatmeasure1.mi_id = mvpatmeasure2.mi_id) AND ((mvpatmeasure2.action_date)::date >= (attachmentaap2.enrl_register_date)::date) AND ((attachmentaap2.enrl_unregister_date IS NULL) OR ((mvpatmeasure2.action_date)::date < (attachmentaap2.enrl_unregister_date)::date)) AND (((mvpatmeasure2.action_date)::date - '18 years'::interval) >= attachmentaap2.patient_birthday))
18. 0.000 0.000 ↓ 0.0

Gather (cost=1,425.32..105,453.92 rows=1 width=84) (actual rows= loops=)

  • Workers Planned: 2
19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=425.32..104,453.82 rows=1 width=84) (actual rows= loops=)

  • Join Filter: ((mvpatmeasure1.pat_id = attachmentaap1.patient_ident_id) AND (mvpatmeasure1.mi_id = attachmentaap1.mi_id) AND ((mvpatmeasure1.action_date)::date >= (attachmentaap1.enrl_register_date)::date) AND ((attachmentaap1.enrl_unregister_date IS NULL) OR ((mvpatmeasure1.action_date)::date < (attachmentaap1.enrl_unregister_date)::date)) AND (((mvpatmeasure1.action_date)::date - '18 years'::interval) >= attachmentaap1.patient_birthday))
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=424.89..104,369.12 rows=105 width=68) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on mvpatmeasure mvpatmeasure1 (cost=424.46..57,919.73 rows=2,966 width=32) (actual rows= loops=)

  • Recheck Cond: (measurement_code = '13012'::text)
  • Filter: (((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
22. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on mvpatmeasure_measurement_code_idx (cost=0.00..422.69 rows=22,700 width=0) (actual rows= loops=)

  • Index Cond: (measurement_code = '13012'::text)
23. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap2 (cost=0.43..15.65 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = mvpatmeasure1.pat_id)
  • Filter: ((mvpatmeasure1.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
24. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap1 (cost=0.43..0.77 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = attachmentaap2.patient_ident_id)
  • Filter: ((patient_birthday IS NOT NULL) AND (attachmentaap2.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
25. 0.000 0.000 ↓ 0.0

Index Scan using mvpatmeasure_pat_id_idx on mvpatmeasure mvpatmeasure2 (cost=0.43..2.06 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((measurement_code = ANY ('{01050,01054}'::text[])) AND (attachmentaap1.mi_id = mi_id) AND ((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
26. 0.000 0.000 ↓ 0.0

Index Scan using mvpatmeasure_pat_id_idx on mvpatmeasure mvpatmeasure3 (cost=0.43..2.06 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((measurement_code = '10028'::text) AND (attachmentaap1.mi_id = mi_id) AND ((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
27. 0.000 0.000 ↓ 0.0

Index Scan using mvpatmeasure_pat_id_idx on mvpatmeasure mvpatmeasure4 (cost=0.43..2.06 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((measurement_code = ANY ('{01050,01053}'::text[])) AND (attachmentaap1.mi_id = mi_id) AND ((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
28. 0.000 0.000 ↓ 0.0

Index Scan using mvpatpdtproc_pat_id_idx on mvpatpdtproc mvpatpdtproc1 (cost=0.43..0.91 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((procedure_code = '10029'::text) AND (attachmentaap1.mi_id = mi_id) AND ((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
29. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues6 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))
30. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues1 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))
31. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap3 (cost=0.43..0.77 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = attachmentaap1.patient_ident_id)
  • Filter: ((attachmentaap1.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
32. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues2 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))
33. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap4 (cost=0.43..0.77 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = attachmentaap1.patient_ident_id)
  • Filter: ((attachmentaap1.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
34. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues3 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))
35. 0.000 0.000 ↓ 0.0

Index Scan using mvpatpdtproc_pat_id_idx on mvpatpdtproc mvpatpdtproc2 (cost=0.43..0.91 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((procedure_code = '10030'::text) AND (attachmentaap1.mi_id = mi_id) AND ((action_date)::date >= to_date('2019-01-01'::text, 'YYYY-MM-DD'::text)) AND ((action_date)::date <= to_date('2019-06-30'::text, 'YYYY-MM-DD'::text)))
36. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap6 (cost=0.43..0.77 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = attachmentaap1.patient_ident_id)
  • Filter: ((attachmentaap1.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
37. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues5 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))
38. 0.000 0.000 ↓ 0.0

Index Scan using attachmentaap_patient_ident_id_idx1 on attachmentaap attachmentaap5 (cost=0.43..0.77 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_ident_id = attachmentaap1.patient_ident_id)
  • Filter: ((attachmentaap1.mi_id = mi_id) AND (hw_specialization = ANY ('{1,16,31}'::text[])))
39. 0.000 0.000 ↓ 0.0

Index Scan using mvpathissues_pat_id_idx on mvpathissues mvpathissues4 (cost=0.43..0.89 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (pat_id = attachmentaap1.patient_ident_id)
  • Filter: ((hi_diagnose >= 'E11'::text) AND (hi_diagnose < 'E12'::text))