explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hm0

Settings
# exclusive inclusive rows x rows loops node
1. 0.655 36,454.705 ↑ 1.0 1 1

Aggregate (cost=52,764,030.33..52,764,030.34 rows=1 width=16) (actual time=36,454.705..36,454.705 rows=1 loops=1)

2. 1.324 36,454.050 ↑ 22.0 747 1

Hash Left Join (cost=35,371.72..52,763,906.90 rows=16,458 width=32) (actual time=61.136..36,454.050 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. 1.549 36,452.691 ↑ 22.0 747 1

Nested Loop Left Join (cost=35,368.24..52,762,688.24 rows=16,458 width=36) (actual time=61.096..36,452.691 rows=747 loops=1)

4. 0.817 111.833 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=52.415..111.833 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. 78.986 110.975 ↑ 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=52.333..110.975 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. 31.989 31.989 ↑ 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..31.989 rows=81,368 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
9. 0.030 0.030 ↑ 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.030 rows=91 loops=1)

10. 0.747 36,339.309 ↑ 1.0 1 747

Subquery Scan on rp (cost=3,203.38..3,203.41 rows=1 width=12) (actual time=48.647..48.647 rows=1 loops=747)

  • Filter: (up.id = rp.id)
11. 1.494 36,338.562 ↑ 1.0 1 747

Aggregate (cost=3,203.38..3,203.39 rows=1 width=12) (actual time=48.646..48.646 rows=1 loops=747)

12. 2.241 36,337.068 ↓ 2.0 2 747

Limit (cost=2,733.91..3,203.37 rows=1 width=8) (actual time=48.615..48.644 rows=2 loops=747)

13. 30.694 36,334.827 ↓ 2.0 2 747

Nested Loop (cost=2,733.91..3,203.37 rows=1 width=8) (actual time=48.614..48.641 rows=2 loops=747)

14. 9.711 36,228.753 ↑ 4.0 50 747

Unique (cost=2,733.49..2,734.87 rows=200 width=4) (actual time=48.481..48.499 rows=50 loops=747)

15. 29.880 36,219.042 ↑ 4.0 69 747

Sort (cost=2,733.49..2,734.18 rows=275 width=4) (actual time=48.480..48.486 rows=69 loops=747)

  • Sort Key: p.provider_id
  • Sort Method: quicksort Memory: 35kB
16. 20.169 36,189.162 ↑ 1.7 158 747

Subquery Scan on p (cost=2,718.92..2,722.35 rows=275 width=4) (actual time=48.407..48.446 rows=158 loops=747)

17. 44.073 36,168.993 ↑ 1.7 158 747

Sort (cost=2,718.92..2,719.60 rows=275 width=44) (actual time=48.406..48.419 rows=158 loops=747)

  • Sort Key: ((up.provider_geography_point <-> ppl.geography_point))
  • Sort Method: quicksort Memory: 42kB
18. 194.220 36,124.920 ↑ 1.7 158 747

Group (cost=2,636.96..2,707.77 rows=275 width=44) (actual time=48.089..48.360 rows=158 loops=747)

  • Group Key: ppl.provider_id, ppl.geography_point
19. 146.412 35,930.700 ↑ 1.7 158 747

Sort (cost=2,636.96..2,637.65 rows=275 width=36) (actual time=48.086..48.100 rows=158 loops=747)

  • Sort Key: ppl.provider_id, ppl.geography_point
  • Sort Method: quicksort Memory: 42kB
20. 3,444.417 35,784.288 ↑ 1.7 158 747

Bitmap Heap Scan on plan_provider_locations ppl (cost=1,581.34..2,625.82 rows=275 width=36) (actual time=43.737..47.904 rows=158 loops=747)

  • Recheck Cond: ((up.specialty_ids && specialty_ids) AND (plan_id = 6,584))
  • 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,213
  • Heap Blocks: exact=680,677
21. 1,702.413 32,339.871 ↓ 0.0 0 747

BitmapAnd (cost=1,581.34..1,581.34 rows=824 width=0) (actual time=43.293..43.293 rows=0 loops=747)

22. 28,359.108 28,359.108 ↓ 4.6 275,969 747

Bitmap Index Scan on ix_plan_provider_locations_specialties (cost=0.00..472.69 rows=59,826 width=0) (actual time=37.963..37.964 rows=275,969 loops=747)

  • Index Cond: (up.specialty_ids && specialty_ids)
23. 2,278.350 2,278.350 ↑ 1.0 81,368 747

Bitmap Index Scan on ix_plan_provider_locations_plan (cost=0.00..1,108.26 rows=82,360 width=0) (actual time=3.050..3.050 rows=81,368 loops=747)

  • Index Cond: (plan_id = 6,584)
24. 75.380 75.380 ↓ 0.0 0 37,690

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=37,690)

  • Index Cond: ((provider_id = p.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))
25. 0.013 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
26. 0.022 0.022 ↑ 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.022 rows=90 loops=1)

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
Planning time : 2.423 ms
Execution time : 36,458.530 ms