explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LuFT : Optimization for: Optimization for: plan #G6v; plan #nIkL

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1,936.250 3,342.552 ↑ 1.0 3,515,831 1

Hash Join (cost=54,941.71..440,291.00 rows=3,515,837 width=4) (actual time=668.581..3,342.552 rows=3,515,831 loops=1)

  • Hash Cond: (pp.patientid = p.patient_id)
2. 737.857 737.857 ↑ 1.0 3,515,837 1

Seq Scan on mat_patientprescriptiondata pp (cost=0.00..297,453.37 rows=3,515,837 width=8) (actual time=0.004..737.857 rows=3,515,837 loops=1)

3. 73.419 668.445 ↑ 1.0 364,284 1

Hash (cost=50,387.01..50,387.01 rows=364,376 width=12) (actual time=668.445..668.445 rows=364,284 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 17076kB
4. 295.395 595.026 ↑ 1.0 364,284 1

Hash Right Join (cost=20,758.88..50,387.01 rows=364,376 width=12) (actual time=197.569..595.026 rows=364,284 loops=1)

  • Hash Cond: (pcn.patient_id = p.patient_id)
5. 102.351 102.351 ↓ 1.0 306,274 1

Index Only Scan using mst_pm_contact_number_patient_id_default_contact_idx on mst_pm_contact_number pcn (cost=0.42..23,544.31 rows=304,212 width=8) (actual time=0.050..102.351 rows=306,274 loops=1)

  • Index Cond: (default_contact_number = true)
  • Filter: (default_contact_number IS TRUE)
  • Heap Fetches: 46557
6. 67.532 197.280 ↑ 1.0 364,284 1

Hash (cost=16,203.76..16,203.76 rows=364,376 width=12) (actual time=197.280..197.280 rows=364,284 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 17076kB
7. 129.748 129.748 ↑ 1.0 364,284 1

Seq Scan on mst_pm_patient p (cost=0.00..16,203.76 rows=364,376 width=12) (actual time=0.003..129.748 rows=364,284 loops=1)