explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nIkL : Optimization for: plan #G6v

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,926.680 3,414.367 ↑ 1.0 3,515,831 1

Hash Join (cost=57,081.59..442,430.88 rows=3,515,837 width=4) (actual time=749.009..3,414.367 rows=3,515,831 loops=1)

  • Hash Cond: (pp.patientid = p.patient_id)
2. 738.798 738.798 ↑ 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.003..738.798 rows=3,515,837 loops=1)

3. 73.828 748.889 ↑ 1.0 364,284 1

Hash (cost=52,526.89..52,526.89 rows=364,376 width=12) (actual time=748.889..748.889 rows=364,284 loops=1)

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

Hash Right Join (cost=24,788.53..52,526.89 rows=364,376 width=12) (actual time=229.350..675.061 rows=364,284 loops=1)

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

Bitmap Heap Scan on mst_pm_contact_number pcn (cost=4,030.07..25,684.19 rows=304,212 width=8) (actual time=31.085..165.351 rows=306,274 loops=1)

  • Filter: (default_contact_number IS TRUE)
  • Heap Blocks: exact=15751
6. 28.066 28.066 ↓ 1.0 306,274 1

Bitmap Index Scan on mst_pm_contact_number_default_contact_number_idx (cost=0.00..3,954.01 rows=304,212 width=0) (actual time=28.066..28.066 rows=306,274 loops=1)

  • Index Cond: (default_contact_number = true)
7. 63.408 198.164 ↑ 1.0 364,284 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 17076kB
8. 134.756 134.756 ↑ 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..134.756 rows=364,284 loops=1)

Planning time : 0.646 ms
Execution time : 3,536.258 ms