explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cvD3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 5,982.516 ↑ 1.0 1 1

Aggregate (cost=1,778,130.79..1,778,130.80 rows=1 width=16) (actual time=5,982.515..5,982.516 rows=1 loops=1)

2. 5,924.753 5,982.425 ↑ 41.4 85 1

Nested Loop Left Join (cost=32,664.24..1,778,104.40 rows=3,518 width=32) (actual time=65.727..5,982.425 rows=85 loops=1)

3. 0.000 57.672 ↑ 41.4 85 1

Hash Left Join (cost=32,168.34..33,416.86 rows=3,518 width=113) (actual time=51.558..57.672 rows=85 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))
4. 57,887.942 57,887.942 ↑ 1.0 1 1

Hash Left Aggregate (cost=7,994,314.68..7,994,314.69 rows=1 width=16) (actual time=57,887.942..57,887.942 rows=1 loops=1)

5. 1.550 57,887.117 ↑ 21.5 747 1

Hash Left Join (cost=32,664.24..7,994,194.41 rows=16,035 width=32) (actual time=64.104..57,887.117 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))
6. 1.090 57,885.530 ↑ 21.5 747 1

Nested Loop Left Join (cost=32,660.75..7,993,008.58 rows=16,035 width=36) (actual time=64.062..57,885.530 rows=747 loops=1)

7. 0.991 109.966 ↑ 21.5 747 1

Hash Left Join (cost=32,164.85..40,744.57 rows=16,035 width=105) (actual time=50.122..109.966 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))
8. 77.818 108.937 ↑ 21.5 747 1

Index Scan using utilization_procedures_pkey on utilization_procedures up (cost=32,161.12..39,297.68 rows=16,035 width=97) (actual time=50.046..108.937 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
9.          

SubPlan (for Index Scan)

10. 31.119 31.119 ↑ 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.027..31.119 rows=81,368 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
12. 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.012..0.028 rows=91 loops=1)

13. 0.747 57,774.474 ↑ 1.0 1 747

Subquery Scan on rp (cost=495.90..495.92 rows=1 width=12) (actual time=77.342..77.342 rows=1 loops=747)

  • Filter: (up.id = rp.id)
14. 2.988 57,773.727 ↑ 1.0 1 747

Aggregate (cost=495.90..495.91 rows=1 width=12) (actual time=77.341..77.341 rows=1 loops=747)

15. 1.494 57,770.739 ↓ 2.0 2 747

Limit (cost=493.83..495.88 rows=1 width=8) (actual time=77.309..77.337 rows=2 loops=747)

16. 32.240 57,769.245 ↓ 2.0 2 747

Nested Loop (cost=493.83..495.88 rows=1 width=8) (actual time=77.308..77.335 rows=2 loops=747)

17. 10.458 57,661.677 ↓ 50.0 50 747

Unique (cost=493.41..493.42 rows=1 width=4) (actual time=77.172..77.191 rows=50 loops=747)

18. 30.627 57,651.219 ↓ 69.0 69 747

Sort (cost=493.41..493.41 rows=1 width=4) (actual time=77.170..77.177 rows=69 loops=747)

  • Sort Key: p.provider_id
  • Sort Method: quicksort Memory: 35kB
19. 20.916 57,620.592 ↓ 158.0 158 747

Subquery Scan on p (cost=493.38..493.40 rows=1 width=4) (actual time=77.096..77.136 rows=158 loops=747)

20. 44.073 57,599.676 ↓ 158.0 158 747

Sort (cost=493.38..493.39 rows=1 width=44) (actual time=77.095..77.108 rows=158 loops=747)

  • Sort Key: ((up.provider_geography_point <-> ppl.geography_point))
  • Sort Method: quicksort Memory: 42kB
21. 192.726 57,555.603 ↓ 158.0 158 747

Group (cost=493.11..493.37 rows=1 width=44) (actual time=76.780..77.049 rows=158 loops=747)

  • Group Key: ppl.provider_id, ppl.geography_point
22. 176.292 57,362.877 ↓ 158.0 158 747

Sort (cost=493.11..493.12 rows=1 width=36) (actual time=76.777..76.791 rows=158 loops=747)

  • Sort Key: ppl.provider_id, ppl.geography_point
  • Sort Method: quicksort Memory: 42kB
23. 6,605.721 57,186.585 ↓ 158.0 158 747

Bitmap Heap Scan on plan_provider_locations ppl (cost=483.97..493.10 rows=1 width=36) (actual time=71.282..76.555 rows=158 loops=747)

  • Recheck Cond: ((geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision)) AND (up.specialty_ids && specialty_ids))
  • Filter: ((up.provider_id <> provider_id) AND (plan_id = 6,584) AND (up.provider_geography_point && _st_expand(geography_point, '8046.72'::double precision)) AND _st_dwithin(up.provider_geography_point, geography_point, '8046.72'::double precision, true))
  • Rows Removed by Filter: 10,792
  • Heap Blocks: exact=3,760,402
24. 1,529.856 50,580.864 ↓ 0.0 0 747

BitmapAnd (cost=483.97..483.97 rows=6 width=0) (actual time=67.712..67.712 rows=0 loops=747)

25. 20,523.825 20,523.825 ↓ 326.8 195,421 747

Bitmap Index Scan on ix_plan_plan_provider_locations_geography (cost=0.00..11.02 rows=598 width=0) (actual time=27.475..27.475 rows=195,421 loops=747)

  • Index Cond: (geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision))
26. 28,527.183 28,527.183 ↓ 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=38.189..38.189 rows=275,969 loops=747)

  • Index Cond: (up.specialty_ids && specialty_ids)
27. 75.328 75.328 ↓ 0.0 0 37,664

Index Scan using ix_tmp_reprice on utilization_reprice_procedures urp (cost=0.42..2.45 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=37,664)

  • 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))
28. 0.016 0.037 ↑ 3.9 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
29. 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
30. 0.000 57.495 ↑ 41.4 85 1

Execution Time: 57889.363 msJoin (cost=32,164.61..33,096.50 rows=3,518 width=105) (actual time=51.498..57.495 rows=85 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))
31. 25.510 57.282 ↑ 41.4 85 1

Index Scan using utilization_procedures_pkey on utilization_procedures up (cost=32,161.12..32,833.61 rows=3,518 width=97) (actual time=51.430..57.282 rows=85 loops=1)

  • Index Cond: ((id >= 1) AND (id <= 10,000))
  • Filter: ((NOT is_passthrough) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 9,915
32.          

SubPlan (for Index Scan)

33. 31.772 31.772 ↑ 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.772 rows=81,368 loops=1)

  • Index Cond: (plan_id = 6,584)
34. 0.015 0.050 ↑ 3.9 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
35. 0.035 0.035 ↑ 1.0 90 1

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

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
36. 0.010 0.027 ↓ 0.0 0 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
37. 0.017 0.017 ↑ 1.0 91 1

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

38. 0.085 5,924.585 ↑ 1.0 1 85

Subquery Scan on rp (cost=495.90..495.92 rows=1 width=12) (actual time=69.701..69.701 rows=1 loops=85)

  • Filter: (up.id = rp.id)
39. 0.255 5,924.500 ↑ 1.0 1 85

Aggregate (cost=495.90..495.91 rows=1 width=12) (actual time=69.700..69.700 rows=1 loops=85)

40. 0.255 5,924.245 ↓ 2.0 2 85

Limit (cost=493.83..495.88 rows=1 width=8) (actual time=69.665..69.697 rows=2 loops=85)

41. 1.806 5,923.990 ↓ 2.0 2 85

Nested Loop (cost=493.83..495.88 rows=1 width=8) (actual time=69.665..69.694 rows=2 loops=85)

42. 0.680 5,912.260 ↓ 29.0 29 85

Unique (cost=493.41..493.42 rows=1 width=4) (actual time=69.545..69.556 rows=29 loops=85)

43. 3.485 5,911.580 ↓ 38.0 38 85

Sort (cost=493.41..493.41 rows=1 width=4) (actual time=69.544..69.548 rows=38 loops=85)

  • Sort Key: p.provider_id
  • Sort Method: quicksort Memory: 33kB
44. 2.380 5,908.095 ↓ 167.0 167 85

Subquery Scan on p (cost=493.38..493.40 rows=1 width=4) (actual time=69.466..69.507 rows=167 loops=85)

45. 5.270 5,905.715 ↓ 167.0 167 85

Sort (cost=493.38..493.39 rows=1 width=44) (actual time=69.465..69.479 rows=167 loops=85)

  • Sort Key: ((up.provider_geography_point <-> ppl.geography_point))
  • Sort Method: quicksort Memory: 39kB
46. 23.205 5,900.445 ↓ 167.0 167 85

Group (cost=493.11..493.37 rows=1 width=44) (actual time=69.132..69.417 rows=167 loops=85)

  • Group Key: ppl.provider_id, ppl.geography_point
47. 16.490 5,877.240 ↓ 167.0 167 85

Sort (cost=493.11..493.12 rows=1 width=36) (actual time=69.129..69.144 rows=167 loops=85)

  • Sort Key: ppl.provider_id, ppl.geography_point
  • Sort Method: quicksort Memory: 39kB
48. 810.815 5,860.750 ↓ 167.0 167 85

Bitmap Heap Scan on plan_provider_locations ppl (cost=483.97..493.10 rows=1 width=36) (actual time=63.409..68.950 rows=167 loops=85)

  • Recheck Cond: ((geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision)) AND (up.specialty_ids && specialty_ids))
  • Filter: ((up.provider_id <> provider_id) AND (plan_id = 6,584) AND (up.provider_geography_point && _st_expand(geography_point, '8046.72'::double precision)) AND _st_dwithin(up.provider_geography_point, geography_point, '8046.72'::double precision, true))
  • Rows Removed by Filter: 7,766
  • Heap Blocks: exact=372,733
49. 183.770 5,049.935 ↓ 0.0 0 85

BitmapAnd (cost=483.97..483.97 rows=6 width=0) (actual time=59.411..59.411 rows=0 loops=85)

50. 2,542.435 2,542.435 ↓ 347.3 207,713 85

Bitmap Index Scan on ix_plan_plan_provider_locations_geography (cost=0.00..11.02 rows=598 width=0) (actual time=29.911..29.911 rows=207,713 loops=85)

  • Index Cond: (geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision))
51. 2,323.730 2,323.730 ↓ 3.7 223,189 85

Bitmap Index Scan on ix_plan_provider_locations_specialties (cost=0.00..472.69 rows=59,826 width=0) (actual time=27.338..27.338 rows=223,189 loops=85)

  • Index Cond: (up.specialty_ids && specialty_ids)
52. 9.924 9.924 ↓ 0.0 0 2,481

Index Scan using ix_tmp_reprice on utilization_reprice_procedures urp (cost=0.42..2.45 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=2,481)

  • 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 (memb
Planning time : 4.711 ms