explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j1QU : Optimization for: plan #xgum

Settings

Optimization path:

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

Unique (cost=229.97..229.97 rows=1 width=80) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=229.97..229.97 rows=1 width=80) (actual rows= loops=)

  • Sort Key: pc.patient_id
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.98..229.96 rows=1 width=80) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash Join (cost=43.56..226.90 rows=1 width=1,626) (actual rows= loops=)

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

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

6. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
7. 0.000 0.000 ↓ 0.0

Seq Scan on pat_form_death_report form_1 (cost=0.00..155.63 rows=642 width=1,595) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
8. 0.000 0.000 ↓ 0.0

Seq Scan on pat_district_hospital form_2 (cost=0.00..1.21 rows=1 width=432) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
9. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
10. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
11. 0.000 0.000 ↓ 0.0

Index Scan using pat_health_center_expr_idx9 on pat_health_center form_5 (cost=0.28..2.30 rows=1 width=957) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
12. 0.000 0.000 ↓ 0.0

Index Scan using pat_info_expr_idx9 on pat_info form_6 (cost=0.43..2.45 rows=1 width=297) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
13. 0.000 0.000 ↓ 0.0

Seq Scan on pat_meta form_7 (cost=0.00..1.01 rows=1 width=849) (actual rows= loops=)

  • Filter: ((doc ->> 'form'::text) = 'death_report'::text)
14. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
15. 0.000 0.000 ↓ 0.0

Index Scan using pat_traffic_stats_expr_idx9 on pat_traffic_stats form_9 (cost=0.28..2.29 rows=1 width=828) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
16. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
17. 0.000 0.000 ↓ 0.0

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_11 (cost=0.28..2.30 rows=1 width=698) (actual rows= loops=)

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
18. 0.000 0.000 ↓ 0.0

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

19. 0.000 0.000 ↓ 0.0

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

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

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pc (cost=0.42..3.05 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (patient_id = (form.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))