explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BRHp : Optimization for: plan #1O4wE

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Insert on t_charges_detail_costs (cost=817,275.12..1,456,912.68 rows=8,822,587 width=282) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* (cost=817,275.12..1,456,912.68 rows=8,822,587 width=282) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=817,275.12..1,081,952.73 rows=8,822,587 width=110) (actual rows= loops=)

  • Group Key: chgtmp.encounterid, chgtmp.chargekey, chgtmp.detailpatienttype, restmp.costcategory, chgtmp.professionalflag, chgtmp.numberofunits
4. 0.000 0.000 ↓ 0.0

Merge Join (cost=414,373.79..596,710.45 rows=8,822,587 width=54) (actual rows= loops=)

  • Merge Cond: ((restmp.activitycode = chgtmp.activitycode) AND (restmp.facilityid = chgtmp.facilityid) AND (restmp.monthnumber = chgtmp.monthnumber))
5. 0.000 0.000 ↓ 0.0

Sort (cost=173,380.26..174,858.66 rows=591,362 width=57) (actual rows= loops=)

  • Sort Key: restmp.activitycode, restmp.facilityid, restmp.monthnumber
6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on t_cost_calc_ac_service_results_summary restmp (cost=16,309.89..116,687.32 rows=591,362 width=57) (actual rows= loops=)

  • Recheck Cond: ((jobid = 1) AND (costcenter = '427210'::citext))
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_t_cost_calc_ac_service_results_summary_2 (cost=0.00..16,162.05 rows=591,362 width=0) (actual rows= loops=)

  • Index Cond: ((jobid = 1) AND (costcenter = '427210'::citext))
8. 0.000 0.000 ↓ 0.0

Sort (cost=240,965.39..244,990.56 rows=1,610,069 width=64) (actual rows= loops=)

  • Sort Key: chgtmp.activitycode, chgtmp.facilityid, chgtmp.monthnumber
9. 0.000 0.000 ↓ 0.0

Index Scan using t_cost_calc_ac_charges_idx_3 on t_cost_calc_ac_charges chgtmp (cost=0.43..74,977.82 rows=1,610,069 width=64) (actual rows= loops=)

  • Index Cond: (costcenter = '427210'::citext)
  • Filter: (jobid = 1)