explain.depesz.com

PostgreSQL's explain analyze made readable

Result: belN

Settings
# exclusive inclusive rows x rows loops node
1. 54.575 18,063.396 ↓ 2,146.2 25,755 1

Group (cost=2,739.30..2,739.42 rows=12 width=56) (actual time=17,976.747..18,063.396 rows=25,755 loops=1)

  • Group Key: vv.vital_reading_id, pr.visit_type, pr.observation_patient
2. 355.418 18,008.821 ↓ 38,573.5 462,882 1

Sort (cost=2,739.30..2,739.33 rows=12 width=56) (actual time=17,976.742..18,008.821 rows=462,882 loops=1)

  • Sort Key: vv.vital_reading_id, pr.visit_type, pr.observation_patient
  • Sort Method: quicksort Memory: 77381kB
3. 55.514 17,653.403 ↓ 38,573.5 462,882 1

Nested Loop (cost=1.56..2,739.09 rows=12 width=56) (actual time=0.089..17,653.403 rows=462,882 loops=1)

4. 6.395 1,949.757 ↓ 25,822.0 25,822 1

Nested Loop (cost=0.99..2,724.47 rows=1 width=56) (actual time=0.075..1,949.757 rows=25,822 loops=1)

5. 1.296 1.296 ↓ 2.9 49 1

Index Scan using patient_registration_mr_no_index on patient_registration pr (cost=0.43..54.37 rows=17 width=20) (actual time=0.032..1.296 rows=49 loops=1)

  • Index Cond: ((mr_no)::text = 'UA1300000016689'::text)
6. 1,942.066 1,942.066 ↓ 527.0 527 49

Index Scan using visit_vitals_patientid_idx on visit_vitals vv (cost=0.56..157.05 rows=1 width=52) (actual time=2.850..39.634 rows=527 loops=49)

  • Index Cond: ((patient_id)::text = (pr.patient_id)::text)
  • Filter: ((patient_id)::text = (converted_from)::text)
7. 15,648.132 15,648.132 ↑ 17.3 18 25,822

Index Only Scan using vital_reading_index on vital_reading vr (cost=0.57..11.51 rows=311 width=4) (actual time=0.595..0.606 rows=18 loops=25,822)

  • Index Cond: (vital_reading_id = vv.vital_reading_id)
  • Heap Fetches: 0
Planning time : 0.987 ms
Execution time : 18,068.425 ms