explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aMjN

Settings
# exclusive inclusive rows x rows loops node
1. 8.394 72,130.945 ↑ 1.0 1 1

Aggregate (cost=19,417,313.32..19,417,313.33 rows=1 width=16) (actual time=72,130.945..72,130.945 rows=1 loops=1)

  • Output: sum(rp.reallocated_cost), sum(CASE WHEN (rp.reallocated_cost IS NULL) THEN '0'::double precision ELSE (up.total_cost * COALESCE(uf1.oon_factor, uf2.oon_factor, '0'::double precision)) END)
  • Buffers: shared hit=38,306,351
2. 14.588 72,122.551 ↑ 13.9 21,808 1

Hash Left Join (cost=70.68..19,415,039.23 rows=303,212 width=32) (actual time=300.766..72,122.551 rows=21,808 loops=1)

  • Output: rp.reallocated_cost, up.total_cost, uf1.oon_factor, uf2.oon_factor
  • Hash Cond: ((up.claim_type_id = uf2.claim_type_id) AND (up.place_of_service_id = uf2.place_of_service_id) AND (up.member_category_id = uf2.member_category_id))
  • Buffers: shared hit=38,306,351
3. 14.126 72,107.926 ↑ 13.9 21,808 1

Nested Loop Left Join (cost=67.19..19,392,649.06 rows=303,212 width=36) (actual time=300.723..72,107.926 rows=21,808 loops=1)

  • Output: up.total_cost, up.place_of_service_id, up.claim_type_id, up.member_category_id, uf1.oon_factor, rp.reallocated_cost
  • Inner Unique: true
  • Buffers: shared hit=38,306,350
4. 11.427 607.176 ↑ 13.9 21,808 1

Hash Left Join (cost=3.73..140,203.12 rows=303,212 width=73) (actual time=299.312..607.176 rows=21,808 loops=1)

  • Output: up.total_cost, up.id, up.provider_geography_point, up.provider_id, up.procedure_code, up.place_of_service_id, up.claim_type_id, up.member_category_id, uf1.oon_factor
  • Hash Cond: ((up.claim_type_id = uf1.claim_type_id) AND (up.place_of_service_id = uf1.place_of_service_id) AND (up.member_category_id = uf1.member_category_id) AND ((up.procedure_code)::text = (uf1.procedure_code)::text))
  • Buffers: shared hit=74,733
5. 595.712 595.712 ↑ 13.9 21,808 1

Seq Scan on "20191599".utilization_procedures up (cost=0.00..112,910.30 rows=303,212 width=65) (actual time=299.241..595.712 rows=21,808 loops=1)

  • Output: up.id, up.cost_type_id, up.procedure_code, up.total_cost, up.provider_id, up.client_provider_id, up.provider_primary_location_id, up.specialty_ids, up.place_of_service_id, up.claim_type_id, up.member_zip_code, up.member_category_id, up.client_claim_id, up.client_episode_id, up.member_geography_point, up.is_passthrough, up.member_type_id, up.combined_column, up.provider_geography_point, up.usr_region_type_id, up.base_network_ids
  • Filter: ((NOT up.is_passthrough) AND (up.provider_id IS NOT NULL) AND (6584 <> ALL (up.base_network_ids)))
  • Rows Removed by Filter: 1,677,434
  • Buffers: shared hit=74,726
6. 0.012 0.037 ↓ 0.0 0 1

Hash (cost=1.91..1.91 rows=91 width=26) (actual time=0.037..0.037 rows=0 loops=1)

  • Output: uf1.oon_factor, uf1.claim_type_id, uf1.place_of_service_id, uf1.member_category_id, uf1.procedure_code
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=1
7. 0.025 0.025 ↑ 1.0 91 1

Seq Scan on "20191599".utilization_oon_factors uf1 (cost=0.00..1.91 rows=91 width=26) (actual time=0.009..0.025 rows=91 loops=1)

  • Output: uf1.oon_factor, uf1.claim_type_id, uf1.place_of_service_id, uf1.member_category_id, uf1.procedure_code
  • Buffers: shared hit=1
8. 21.808 71,486.624 ↑ 1.0 1 21,808

Subquery Scan on rp (cost=63.46..63.48 rows=1 width=12) (actual time=3.278..3.278 rows=1 loops=21,808)

  • Output: rp.id, rp.reallocated_cost
  • Filter: (up.id = rp.id)
  • Buffers: shared hit=38,231,617
9. 21.808 71,464.816 ↑ 1.0 1 21,808

Aggregate (cost=63.46..63.47 rows=1 width=12) (actual time=3.277..3.277 rows=1 loops=21,808)

  • Output: up.id, avg(urp.reprice_avg_cost)
  • Buffers: shared hit=38,231,617
10. 43.616 71,443.008 ↓ 2.0 2 21,808

Limit (cost=0.41..63.45 rows=1 width=8) (actual time=2.682..3.276 rows=2 loops=21,808)

  • Output: urp.reprice_avg_cost
  • Buffers: shared hit=38,231,617
11. 71,399.392 71,399.392 ↓ 2.0 2 21,808

Index Scan using ix_reprice_geo_net on "20191599".utilization_reprice_procedures urp (cost=0.41..63.45 rows=1 width=8) (actual time=2.681..3.274 rows=2 loops=21,808)

  • Output: urp.reprice_avg_cost
  • Index Cond: (urp.provider_geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision))
  • Filter: ((urp.provider_id <> up.provider_id) AND ((urp.procedure_code)::text = (up.procedure_code)::text) AND (urp.place_of_service_id = up.place_of_service_id) AND (urp.claim_type_id = up.claim_type_id) AND (urp.member_category_id = up.member_category_id) AND (urp.cost_type_id = 1) AND (up.provider_geography_point && _st_expand(urp.provider_geography_point, '8046.72'::double precision)) AND _st_dwithin(up.provider_geography_point, urp.provider_geography_point, '8046.72'::double precision, true))
  • Rows Removed by Filter: 9,988
  • Buffers: shared hit=38,231,617
12. 0.016 0.037 ↑ 3.9 23 1

Hash (cost=1.91..1.91 rows=90 width=20) (actual time=0.037..0.037 rows=23 loops=1)

  • Output: uf2.oon_factor, uf2.claim_type_id, uf2.place_of_service_id, uf2.member_category_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
13. 0.021 0.021 ↑ 1.0 90 1

Seq Scan on "20191599".utilization_oon_factors uf2 (cost=0.00..1.91 rows=90 width=20) (actual time=0.004..0.021 rows=90 loops=1)

  • Output: uf2.oon_factor, uf2.claim_type_id, uf2.place_of_service_id, uf2.member_category_id
  • Filter: (uf2.procedure_code IS NULL)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1
Planning time : 3.988 ms
Execution time : 72,131.154 ms