explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jIyc

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 9.473 ↑ 1.0 10 1

Limit (cost=77,570.55..77,570.57 rows=10 width=42) (actual time=9.471..9.473 rows=10 loops=1)

2. 0.780 9.469 ↑ 470.0 20 1

Sort (cost=77,570.52..77,594.02 rows=9,400 width=42) (actual time=9.468..9.469 rows=20 loops=1)

  • Sort Key: (CASE WHEN (insite_patient_score.score IS NULL) THEN 0::numeric ELSE insite_patient_score.score END)
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.253 8.689 ↑ 6.9 1,354 1

Nested Loop Left Join (cost=11.56..77,320.39 rows=9,400 width=42) (actual time=0.163..8.689 rows=1,354 loops=1)

4. 0.449 4.374 ↑ 6.9 1,354 1

Hash Left Join (cost=11.14..27,440.39 rows=9,400 width=37) (actual time=0.134..4.374 rows=1,354 loops=1)

  • Hash Cond: (pd.patient_num = insite_patient_score.patient_num)
5. 0.720 3.844 ↑ 6.9 1,354 1

Nested Loop Left Join (cost=0.99..26,736.99 rows=9,400 width=33) (actual time=0.034..3.844 rows=1,354 loops=1)

6. 0.416 0.416 ↑ 6.9 1,354 1

Index Scan using qt_idx_qpsc_riid on qt_patient_set_collection pc (cost=0.56..371.99 rows=9,400 width=4) (actual time=0.019..0.416 rows=1,354 loops=1)

  • Index Cond: (result_instance_id = 1962)
7. 2.708 2.708 ↑ 1.0 1 1,354

Index Only Scan using pd_idx_patientnum_sexcd_birthdate on patient_dimension pd (cost=0.43..2.79 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=1,354)

  • Index Cond: (patient_num = pc.patient_num)
  • Heap Fetches: 0
8. 0.034 0.081 ↓ 1.8 100 1

Hash (cost=9.43..9.43 rows=57 width=8) (actual time=0.081..0.081 rows=100 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
9. 0.047 0.047 ↓ 1.8 100 1

Index Scan using insite_idx_qips_riid on insite_patient_score (cost=0.42..9.43 rows=57 width=8) (actual time=0.013..0.047 rows=100 loops=1)

  • Index Cond: (result_instance_id = 1963)
10. 4.062 4.062 ↑ 1.0 1 1,354

Index Scan using pm_patnum_idx on patient_mapping pm (cost=0.43..5.30 rows=1 width=13) (actual time=0.002..0.003 rows=1 loops=1,354)

  • Index Cond: (pc.patient_num = patient_num)
  • Filter: (((patient_ide_source)::text = 'MASTER_PATIENT_INDEX'::text) AND ((patient_ide_status)::text = 'Active'::text))
Planning time : 0.781 ms
Execution time : 9.525 ms