explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k5SG

Settings
# exclusive inclusive rows x rows loops node
1. 0.336 5,034.029 ↑ 1.0 1 1

Aggregate (cost=209,004,977.82..209,004,977.83 rows=1 width=16) (actual time=5,034.029..5,034.029 rows=1 loops=1)

2. 0.666 5,033.693 ↑ 22.0 747 1

Hash Left Join (cost=44,865.04..209,004,854.39 rows=16,458 width=32) (actual time=54.414..5,033.693 rows=747 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. 0.554 5,032.991 ↑ 22.0 747 1

Nested Loop Left Join (cost=44,861.55..209,003,635.73 rows=16,458 width=36) (actual time=54.371..5,032.991 rows=747 loops=1)

4. 0.550 101.490 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=51.488..101.490 rows=747 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. 68.868 100.900 ↑ 22.0 747 1

Index Scan using utilization_procedures_pkey on utilization_procedures up (cost=32,161.12..39,362.80 rows=16,458 width=97) (actual time=51.409..100.900 rows=747 loops=1)

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

SubPlan (for Index Scan)

7. 32.032 32.032 ↑ 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.032..32.032 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.015..0.029 rows=91 loops=1)

10. 0.747 4,930.947 ↑ 1.0 1 747

Subquery Scan on rp (cost=12,696.70..12,696.72 rows=1 width=12) (actual time=6.601..6.601 rows=1 loops=747)

  • Filter: (up.id = rp.id)
11. 0.747 4,930.200 ↑ 1.0 1 747

Aggregate (cost=12,696.70..12,696.71 rows=1 width=12) (actual time=6.600..6.600 rows=1 loops=747)

12. 1.494 4,929.453 ↓ 2.0 2 747

Limit (cost=12,226.60..12,696.68 rows=1 width=8) (actual time=6.574..6.599 rows=2 loops=747)

13. 16.285 4,927.959 ↓ 2.0 2 747

Nested Loop (cost=12,226.60..12,696.68 rows=1 width=8) (actual time=6.574..6.597 rows=2 loops=747)

14. 29.880 4,842.054 ↑ 4.3 47 747

HashAggregate (cost=12,226.18..12,228.18 rows=200 width=4) (actual time=6.474..6.482 rows=47 loops=747)

  • Group Key: provider_location_specialty_plans.provider_id
15. 43.326 4,812.174 ↑ 18.6 158 747

Sort (cost=12,182.02..12,189.38 rows=2,944 width=44) (actual time=6.429..6.442 rows=158 loops=747)

  • Sort Key: ((up.provider_geography_point <-> provider_location_specialty_plans.geography_point))
  • Sort Method: quicksort Memory: 42kB
16. 194.220 4,768.848 ↑ 18.6 158 747

Group (cost=11,254.30..12,012.40 rows=2,944 width=44) (actual time=6.112..6.384 rows=158 loops=747)

  • Group Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
17. 76.194 4,574.628 ↑ 18.3 161 747

Sort (cost=11,254.30..11,261.67 rows=2,946 width=36) (actual time=6.110..6.124 rows=161 loops=747)

  • Sort Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
  • Sort Method: quicksort Memory: 47kB
18. 4,498.434 4,498.434 ↑ 18.3 161 747

Index Scan using ix_plsp_shafjac_temp on provider_location_specialty_plans (cost=0.42..11,084.54 rows=2,946 width=36) (actual time=0.151..6.022 rows=161 loops=747)

  • 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,281
19. 69.620 69.620 ↓ 0.0 0 34,810

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=34,810)

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

Hash (cost=1.91..1.91 rows=90 width=20) (actual time=0.036..0.036 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.626 ms
Execution time : 5,037.336 ms