explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xWnX : Optimization for: plan #LvZ

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.170 3.037 ↓ 8.0 8 1

GroupAggregate (cost=905.02..905.85 rows=1 width=84) (actual time=2.919..3.037 rows=8 loops=1)

  • Group Key: ((((patient_registration.patient_registration_last_name)::text || ', '::text) || (patient_registration.patient_registration_first_
  • ccm_patient_log.ccm_patient_log_ccm_pysician, ccm_patient_log.ccm_patient_log_dx_code, ccm_patient_log.ccm_patient_log_created_on
  • Planning time: 1.055 ms
  • Execution time: 3.299 ms
2. 0.075 2.867 ↓ 11.0 11 1

Sort (cost=905.02..905.03 rows=1 width=84) (actual time=2.863..2.867 rows=11 loops=1)

  • Sort Key: ((((patient_registration.patient_registration_last_name)::text || ', '::text) || (patient_registration.patient_registration_f
  • Sort Method: quicksort Memory: 26kB
3. 0.192 2.792 ↓ 11.0 11 1

Nested Loop (cost=16.96..905.01 rows=1 width=84) (actual time=2.368..2.792 rows=11 loops=1)

  • Join Filter: (chart.chart_patientid = ccm_patient_log.ccm_patient_log_patient_id)
  • Rows Removed by Join Filter: 99
4. 0.050 0.050 ↑ 16.3 10 1

Seq Scan on ccm_patient_log (cost=0.00..13.90 rows=163 width=39) (actual time=0.041..0.050 rows=10 loops=1)

  • Filter: (NOT ccm_patient_log_isterminated)
  • Rows Removed by Filter: 4
5. 0.022 2.550 ↓ 5.5 11 10

Materialize (cost=16.96..885.97 rows=2 width=57) (actual time=0.009..0.255 rows=11 loops=10)

6. 0.209 2.528 ↓ 5.5 11 1

Nested Loop (cost=16.96..885.96 rows=2 width=57) (actual time=0.081..2.528 rows=11 loops=1)

  • -> Index Scan using idx_chart_chart_patientid on chart (cost=0.28..0.39 rows=1 width=8) (actual time=0.017..0.017 r
7. 2.275 2.319 ↓ 5.5 11 1

Hash Join (cost=16.67..885.15 rows=2 width=49) (actual time=0.064..2.319 rows=11 loops=1)

  • Hash Cond: (patient_registration.patient_registration_id = ccm_service.ccm_service_patient_id)
  • -> Seq Scan on patient_registration (cost=0.00..845.64 rows=4564 width=37) (actual time=0.003..1.163 rows=458
  • Index Cond: (chart_patientid = patient_registration.patient_registration_id)
8. 0.044 0.044 ↓ 5.5 11 1

Hash (cost=16.65..16.65 rows=2 width=12) (actual time=0.044..0.044 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • -> Seq Scan on ccm_service (cost=0.00..16.65 rows=2 width=12) (actual time=0.028..0.039 rows=11 loops=1
  • Filter: (date_part('year'::text, (ccm_service_date)::timestamp without time zone) = '2019'::double