explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yod8

Settings
# exclusive inclusive rows x rows loops node
1. 3.617 48,585.093 ↑ 1.0 1 1

Aggregate (cost=428,781,707.60..428,781,707.61 rows=1 width=16) (actual time=48,585.093..48,585.093 rows=1 loops=1)

2. 6.920 48,581.476 ↑ 10.2 7,534 1

Hash Left Join (cost=37,734.50..428,781,129.96 rows=77,019 width=32) (actual time=53.254..48,581.476 rows=7,534 loops=1)

  • 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))
3. 10.497 48,574.521 ↑ 10.2 7,534 1

Nested Loop Left Join (cost=37,731.01..428,775,439.77 rows=77,019 width=36) (actual time=53.213..48,574.521 rows=7,534 loops=1)

4. 5.220 331.356 ↑ 10.2 7,534 1

Hash Left Join (cost=32,164.85..72,795.86 rows=77,019 width=105) (actual time=51.799..331.356 rows=7,534 loops=1)

  • 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))
5. 294.128 326.097 ↑ 10.2 7,534 1

Index Scan using utilization_procedures_pkey on utilization_procedures up (cost=32,161.12..65,860.41 rows=77,019 width=97) (actual time=51.722..326.097 rows=7,534 loops=1)

  • Index Cond: ((id >= 1) AND (id <= 500,000))
  • Filter: ((NOT is_passthrough) AND (provider_id IS NOT NULL) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 492,466
6.          

SubPlan (for Index Scan)

7. 31.969 31.969 ↑ 1.0 81,368 1

Index Scan using ix_plan_provider_locations_plan on plan_provider_locations (cost=0.56..31,954.79 rows=82,360 width=4) (actual time=0.035..31.969 rows=81,368 loops=1)

  • Index Cond: (plan_id = 6,584)
8. 0.011 0.039 ↓ 0.0 0 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
9. 0.028 0.028 ↑ 1.0 91 1

Seq Scan on utilization_oon_factors uf1 (cost=0.00..1.91 rows=91 width=26) (actual time=0.014..0.028 rows=91 loops=1)

10. 0.000 48,232.668 ↑ 1.0 1 7,534

Subquery Scan on rp (cost=5,566.16..5,566.18 rows=1 width=12) (actual time=6.402..6.402 rows=1 loops=7,534)

  • Filter: (up.id = rp.id)
11. 15.068 48,232.668 ↑ 1.0 1 7,534

Aggregate (cost=5,566.16..5,566.17 rows=1 width=12) (actual time=6.402..6.402 rows=1 loops=7,534)

12. 7.534 48,217.600 ↓ 2.0 2 7,534

Limit (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=6.372..6.400 rows=2 loops=7,534)

13. 95.264 48,210.066 ↓ 2.0 2 7,534

Nested Loop (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=6.372..6.399 rows=2 loops=7,534)

14. 391.768 47,170.374 ↑ 3.2 63 7,534

HashAggregate (cost=5,095.65..5,097.65 rows=200 width=4) (actual time=6.250..6.261 rows=63 loops=7,534)

  • Group Key: provider_location_specialty_plans.provider_id
15. 610.254 46,778.606 ↑ 5.5 219 7,534

Sort (cost=5,077.42..5,080.46 rows=1,215 width=44) (actual time=6.190..6.209 rows=219 loops=7,534)

  • Sort Key: ((up.provider_geography_point <-> provider_location_specialty_plans.geography_point))
  • Sort Method: quicksort Memory: 25kB
16. 2,704.706 46,168.352 ↑ 5.5 219 7,534

Group (cost=4,702.30..5,015.17 rows=1,215 width=44) (actual time=5.752..6.128 rows=219 loops=7,534)

  • Group Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
17. 1,017.090 43,463.646 ↑ 5.5 222 7,534

Sort (cost=4,702.30..4,705.34 rows=1,216 width=36) (actual time=5.750..5.769 rows=222 loops=7,534)

  • Sort Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
  • Sort Method: quicksort Memory: 25kB
18. 42,446.556 42,446.556 ↑ 5.5 222 7,534

Index Only Scan using ix_plsp_shafjac_temp on provider_location_specialty_plans (cost=0.42..4,639.99 rows=1,216 width=36) (actual time=0.072..5.634 rows=222 loops=7,534)

  • Index Cond: (specialty_id = ANY (up.specialty_ids))
  • Filter: ((up.provider_id <> provider_id) AND (_st_distance(up.provider_geography_point, geography_point, '0'::double precision, false) <= '8046.72'::double precision))
  • Rows Removed by Filter: 3,815
  • Heap Fetches: 30,413,388
19. 944.428 944.428 ↓ 0.0 0 472,214

Index Scan using ix_tmp_reprice on utilization_reprice_procedures urp (cost=0.42..2.32 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=472,214)

  • Index Cond: ((provider_id = provider_location_specialty_plans.provider_id) AND ((procedure_code)::text = (up.procedure_code)::text) AND (place_of_service_id = up.place_of_service_id) AND (claim_type_id = up.claim_type_id) AND (member_category_id = up.member_category_id))
20. 0.015 0.035 ↑ 3.9 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
21. 0.020 0.020 ↑ 1.0 90 1

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

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
Planning time : 2.574 ms
Execution time : 48,588.430 ms