explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IgOh

Settings
# exclusive inclusive rows x rows loops node
1. 10.482 136,794.570 ↑ 1.0 1 1

Aggregate (cost=1,454,370,988.79..1,454,370,988.80 rows=1 width=16) (actual time=136,794.570..136,794.570 rows=1 loops=1)

2. 19.479 136,784.088 ↑ 12.3 21,281 1

Hash Left Join (cost=37,734.07..1,454,369,029.37 rows=261,256 width=32) (actual time=53.355..136,784.088 rows=21,281 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. 12.250 136,764.571 ↑ 12.3 21,281 1

Nested Loop Left Join (cost=37,730.59..1,454,349,736.03 rows=261,256 width=36) (actual time=53.312..136,764.571 rows=21,281 loops=1)

4. 14.984 788.012 ↑ 12.3 21,281 1

Hash Left Join (cost=32,164.42..148,332.00 rows=261,256 width=105) (actual time=51.889..788.012 rows=21,281 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. 741.041 772.988 ↑ 12.3 21,281 1

Seq Scan on utilization_procedures up (cost=32,160.69..124,815.22 rows=261,256 width=97) (actual time=51.808..772.988 rows=21,281 loops=1)

  • Filter: ((NOT is_passthrough) AND (provider_id IS NOT NULL) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 1,677,961
6.          

SubPlan (for Seq Scan)

7. 31.947 31.947 ↑ 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.033..31.947 rows=81,368 loops=1)

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

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

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

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

10. 21.281 135,964.309 ↑ 1.0 1 21,281

Subquery Scan on rp (cost=5,566.16..5,566.18 rows=1 width=12) (actual time=6.389..6.389 rows=1 loops=21,281)

  • Filter: (up.id = rp.id)
11. 42.562 135,943.028 ↑ 1.0 1 21,281

Aggregate (cost=5,566.16..5,566.17 rows=1 width=12) (actual time=6.388..6.388 rows=1 loops=21,281)

12. 21.281 135,900.466 ↓ 2.0 2 21,281

Limit (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=6.359..6.386 rows=2 loops=21,281)

13. 267.971 135,879.185 ↓ 2.0 2 21,281

Nested Loop (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=6.359..6.385 rows=2 loops=21,281)

14. 1,106.612 133,048.812 ↑ 3.3 60 21,281

HashAggregate (cost=5,095.65..5,097.65 rows=200 width=4) (actual time=6.241..6.252 rows=60 loops=21,281)

  • Group Key: provider_location_specialty_plans.provider_id
15. 1,681.199 131,942.200 ↑ 5.7 215 21,281

Sort (cost=5,077.42..5,080.46 rows=1,215 width=44) (actual time=6.183..6.200 rows=215 loops=21,281)

  • Sort Key: ((up.provider_geography_point <-> provider_location_specialty_plans.geography_point))
  • Sort Method: quicksort Memory: 30kB
16. 7,512.193 130,261.001 ↑ 5.7 215 21,281

Group (cost=4,702.30..5,015.17 rows=1,215 width=44) (actual time=5.752..6.121 rows=215 loops=21,281)

  • Group Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
17. 2,809.092 122,748.808 ↑ 5.6 218 21,281

Sort (cost=4,702.30..4,705.34 rows=1,216 width=36) (actual time=5.750..5.768 rows=218 loops=21,281)

  • Sort Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
  • Sort Method: quicksort Memory: 30kB
18. 119,939.716 119,939.716 ↑ 5.6 218 21,281

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.078..5.636 rows=218 loops=21,281)

  • 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,837
  • Heap Fetches: 86,292,334
19. 2,562.402 2,562.402 ↓ 0.0 0 1,281,201

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=1,281,201)

  • 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.017 0.038 ↑ 3.9 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
21. 0.021 0.021 ↑ 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.021 rows=90 loops=1)

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
Planning time : 2.555 ms
Execution time : 136,797.793 ms