explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tJ24

Settings
# exclusive inclusive rows x rows loops node
1. 0.801 57,802.473 ↑ 1.0 1 1

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

2. 1.636 57,801.672 ↑ 21.5 747 1

Hash Left Join (cost=32,664.24..7,994,194.41 rows=16,035 width=32) (actual time=64.867..57,801.672 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.384 57,799.999 ↑ 21.5 747 1

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

4. 0.979 107.805 ↑ 21.5 747 1

Hash Left Join (cost=32,164.85..40,744.57 rows=16,035 width=105) (actual time=50.771..107.805 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. 75.475 106.787 ↑ 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.690..106.787 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.312 31.312 ↑ 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.030..31.312 rows=81,368 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
9. 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)

10. 0.747 57,690.810 ↑ 1.0 1 747

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

  • Filter: (up.id = rp.id)
11. 2.241 57,690.063 ↑ 1.0 1 747

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

12. 1.494 57,687.822 ↓ 2.0 2 747

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

13. 31.493 57,686.328 ↓ 2.0 2 747

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

14. 10.458 57,579.507 ↓ 50.0 50 747

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

15. 30.627 57,569.049 ↓ 69.0 69 747

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

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

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

17. 44.073 57,517.506 ↓ 158.0 158 747

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

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

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

  • Group Key: ppl.provider_id, ppl.geography_point
19. 184.509 57,280.707 ↓ 158.0 158 747

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

  • Sort Key: ppl.provider_id, ppl.geography_point
  • Sort Method: quicksort Memory: 42kB
20. 6,577.335 57,096.198 ↓ 158.0 158 747

Bitmap Heap Scan on plan_provider_locations ppl (cost=483.97..493.10 rows=1 width=36) (actual time=71.181..76.434 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
21. 1,527.615 50,518.863 ↓ 0.0 0 747

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

22. 20,498.427 20,498.427 ↓ 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.441..27.441 rows=195,421 loops=747)

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

  • Index Cond: (up.specialty_ids && specialty_ids)
24. 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))
25. 0.016 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
26. 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 : 5.157 ms
Execution time : 57,804.045 ms