explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Opvz : Optimization for: 1; plan #ZAMM

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 52.301 386.030 ↑ 12.6 3,087 1

Hash Join (cost=2,923.00..12,169.64 rows=38,751 width=12) (actual time=50.416..386.030 rows=3,087 loops=1)

  • Hash Cond: (hd.id = hr.ambticket_id)
  • Join Filter: ((hr.admission_num)::text <> (md.num)::text)
  • Rows Removed by Join Filter: 36056
2. 60.080 284.392 ↓ 1.0 39,171 1

Merge Join (cost=23.10..8,486.33 rows=38,628 width=22) (actual time=0.054..284.392 rows=39,171 loops=1)

  • Merge Cond: (hd.mdoc_id = md.id)
3. 74.336 74.336 ↓ 1.0 39,171 1

Index Scan using ""ix_ambticket$mdoc_id"" on ambticket hd (cost=0.29..3,541.97 rows=38,628 width=32) (actual time=0.009..74.336 rows=39,171 loops=1)

4. 149.976 149.976 ↓ 1.0 84,263 1

Index Scan using ""pk_mdoc$id"" on mdoc md (cost=0.42..4,273.65 rows=84,096 width=22) (actual time=0.032..149.976 rows=84,263 loops=1)

5. 23.389 49.337 ↓ 1.0 39,143 1

Hash (cost=2,187.51..2,187.51 rows=38,751 width=22) (actual time=49.337..49.337 rows=39,143 loops=1)

  • Buckets: 32768 Batches: 4 Memory Usage: 777kB
6. 25.948 25.948 ↓ 1.0 39,143 1

Seq Scan on hosp_refuse hr (cost=0.00..2,187.51 rows=38,751 width=22) (actual time=0.010..25.948 rows=39,143 loops=1)

Planning time : 1.400 ms
Execution time : 386.463 ms