explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U61c

Settings
# exclusive inclusive rows x rows loops node
1. 0.347 4,299.738 ↑ 1.0 1 1

Aggregate (cost=91,650,599.64..91,650,599.65 rows=1 width=16) (actual time=4,299.738..4,299.738 rows=1 loops=1)

2. 0.665 4,299.391 ↑ 22.0 747 1

Hash Left Join (cost=37,734.50..91,650,476.21 rows=16,458 width=32) (actual time=53.056..4,299.391 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.760 4,298.689 ↑ 22.0 747 1

Nested Loop Left Join (cost=37,731.01..91,649,257.55 rows=16,458 width=36) (actual time=53.013..4,298.689 rows=747 loops=1)

4. 0.547 102.030 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=51.595..102.030 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. 69.374 101.444 ↑ 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.518..101.444 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.070 32.070 ↑ 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.031..32.070 rows=81,368 loops=1)

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

Hash (cost=1.91..1.91 rows=91 width=26) (actual time=0.039..0.039 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.014..0.029 rows=91 loops=1)

10. 0.747 4,195.899 ↑ 1.0 1 747

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

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

Aggregate (cost=5,566.16..5,566.17 rows=1 width=12) (actual time=5.616..5.616 rows=1 loops=747)

12. 1.494 4,194.405 ↓ 2.0 2 747

Limit (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=5.591..5.615 rows=2 loops=747)

13. 15.538 4,192.911 ↓ 2.0 2 747

Nested Loop (cost=5,096.07..5,566.15 rows=1 width=8) (actual time=5.590..5.613 rows=2 loops=747)

14. 29.133 4,107.753 ↑ 4.3 47 747

HashAggregate (cost=5,095.65..5,097.65 rows=200 width=4) (actual time=5.491..5.499 rows=47 loops=747)

  • Group Key: provider_location_specialty_plans.provider_id
15. 44.073 4,078.620 ↑ 7.7 158 747

Sort (cost=5,077.42..5,080.46 rows=1,215 width=44) (actual time=5.447..5.460 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,034.547 ↑ 7.7 158 747

Group (cost=4,702.30..5,015.17 rows=1,215 width=44) (actual time=5.129..5.401 rows=158 loops=747)

  • Group Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
17. 76.194 3,840.327 ↑ 7.6 161 747

Sort (cost=4,702.30..4,705.34 rows=1,216 width=36) (actual time=5.127..5.141 rows=161 loops=747)

  • Sort Key: provider_location_specialty_plans.provider_id, provider_location_specialty_plans.geography_point
  • Sort Method: quicksort Memory: 47kB
18. 3,764.133 3,764.133 ↑ 7.6 161 747

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.127..5.039 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
  • Heap Fetches: 2,571,018
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.014 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)

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

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

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1