explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cKXv

Settings
# exclusive inclusive rows x rows loops node
1. 0.342 38,797.283 ↓ 16.0 16 1

HashAggregate (cost=2,623,863.80..2,623,863.81 rows=1 width=175) (actual time=38,797.271..38,797.283 rows=16 loops=1)

2. 3.242 38,796.941 ↓ 95.0 95 1

Nested Loop (cost=31.68..2,623,863.76 rows=1 width=175) (actual time=7,539.874..38,796.941 rows=95 loops=1)

  • Join Filter: (psd.section_id = sm.section_id)
  • Rows Removed by Join Filter: 12540
3. 0.147 38,790.849 ↓ 95.0 95 1

Nested Loop (cost=31.68..2,623,858.77 rows=1 width=157) (actual time=7,539.816..38,790.849 rows=95 loops=1)

4. 7,249.766 38,789.974 ↓ 182.0 182 1

Hash Join (cost=31.11..2,623,854.53 rows=1 width=161) (actual time=7,539.215..38,789.974 rows=182 loops=1)

  • Hash Cond: (psval.section_detail_id = psd.section_detail_id)
5. 31,539.801 31,539.801 ↓ 1.0 37,842,587 1

Seq Scan on patient_section_fields_audit_log psval (cost=0.00..2,483,655.88 rows=37,378,010 width=129) (actual time=0.084..31,539.801 rows=37,842,587 loops=1)

  • Filter: (((operation)::text = 'INSERT'::text) AND (field_name = 'section_detail_id'::text))
  • Rows Removed by Filter: 49205695
6. 0.031 0.407 ↓ 42.0 42 1

Hash (cost=31.10..31.10 rows=1 width=32) (actual time=0.407..0.407 rows=42 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
7. 0.085 0.376 ↓ 42.0 42 1

Bitmap Heap Scan on patient_section_details psd (cost=27.08..31.10 rows=1 width=32) (actual time=0.332..0.376 rows=42 loops=1)

  • Recheck Cond: (((patient_id)::text = 'OP2450422'::text) AND ((mr_no)::text = 'LLM151481'::text))
  • Filter: (item_type = 'CONS'::text)
  • Rows Removed by Filter: 1
8. 0.006 0.291 ↓ 0.0 0 1

BitmapAnd (cost=27.08..27.08 rows=1 width=0) (actual time=0.291..0.291 rows=0 loops=1)

9. 0.116 0.116 ↑ 5.1 43 1

Bitmap Index Scan on psd_patient_id_idx (cost=0.00..10.23 rows=221 width=0) (actual time=0.116..0.116 rows=43 loops=1)

  • Index Cond: ((patient_id)::text = 'OP2450422'::text)
10. 0.169 0.169 ↑ 2.0 263 1

Bitmap Index Scan on psd_mr_no_idx (cost=0.00..16.60 rows=538 width=0) (actual time=0.169..0.169 rows=263 loops=1)

  • Index Cond: ((mr_no)::text = 'LLM151481'::text)
11. 0.728 0.728 ↑ 1.0 1 182

Index Scan using psf_section_detail_id_idx on patient_section_forms psf (cost=0.57..4.23 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=182)

  • Index Cond: (section_detail_id = psval.section_detail_id)
  • Filter: ((form_type)::text = 'Form_CONS'::text)
  • Rows Removed by Filter: 0
12. 2.850 2.850 ↑ 1.0 133 95

Seq Scan on section_master sm (cost=0.00..3.33 rows=133 width=22) (actual time=0.001..0.030 rows=133 loops=95)