explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sf8e

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 21.846 ↓ 8.0 16 1

Unique (cost=229.94..229.95 rows=2 width=80) (actual time=21.836..21.846 rows=16 loops=1)

2. 0.034 21.838 ↓ 20.0 40 1

Sort (cost=229.94..229.95 rows=2 width=80) (actual time=21.836..21.838 rows=40 loops=1)

  • Sort Key: pc.patient_id
  • Sort Method: quicksort Memory: 30kB
3. 4.042 21.804 ↓ 20.0 40 1

Nested Loop (cost=43.98..229.93 rows=2 width=80) (actual time=2.884..21.804 rows=40 loops=1)

4. 7.712 13.296 ↓ 638.0 638 1

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

  • Hash Cond: ((form.doc ->> '_id'::text) = dr.uuid)
5. 0.069 5.230 ↑ 1.0 643 1

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

6. 0.009 0.009 ↓ 0.0 0 1

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

  • Index Cond: ((doc ->> 'form'::text) = 'death_report'::text)
7. 5.112 5.112 ↓ 1.0 643 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Index Scan using pat_person_expr_idx9 on pat_person form_8 (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)
15. 0.003 0.003 ↓ 0.0 0 1

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

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

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 time=0.002..0.002 rows=0 loops=1)

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

Index Scan using couchdb_default_expr_idx9 on couchdb_default form_11 (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)
18. 0.133 0.354 ↑ 1.2 638 1

Hash (cost=33.70..33.70 rows=755 width=80) (actual time=0.354..0.354 rows=638 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 81kB
19. 0.221 0.221 ↑ 1.2 638 1

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

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

Index Scan using useview_postnatal_patient_id on useview_postnatal_care pc (cost=0.42..3.01 rows=2 width=36) (actual time=0.007..0.007 rows=0 loops=638)

  • Index Cond: (patient_id = (form.doc #>> '{fields,inputs,contact,_id}'::text[]))
  • Filter: ((patient_id <> ''::text) AND (patient_age_in_years >= 12))
  • Rows Removed by Filter: 0
Planning time : 1.162 ms
Execution time : 21.905 ms