explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k9Rc

Settings
# exclusive inclusive rows x rows loops node
1. 0.822 58,024.037 ↑ 1.0 1 1

Aggregate (cost=8,204,068.37..8,204,068.38 rows=1 width=16) (actual time=58,024.037..58,024.037 rows=1 loops=1)

2. 1.501 58,023.215 ↑ 22.0 747 1

Hash Left Join (cost=32,664.23..8,203,944.94 rows=16,458 width=32) (actual time=66.504..58,023.215 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.249 58,021.676 ↑ 22.0 747 1

Nested Loop Left Join (cost=32,660.74..8,202,726.28 rows=16,458 width=36) (actual time=66.462..58,021.676 rows=747 loops=1)

4. 1.029 109.999 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=52.236..109.999 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. 77.040 108.931 ↑ 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.158..108.931 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.891 31.891 ↑ 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.035..31.891 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.013..0.029 rows=91 loops=1)

10. 0.747 57,910.428 ↑ 1.0 1 747

Subquery Scan on rp (cost=495.89..495.91 rows=1 width=12) (actual time=77.524..77.524 rows=1 loops=747)

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

Aggregate (cost=495.89..495.90 rows=1 width=12) (actual time=77.523..77.523 rows=1 loops=747)

12. 2.781 57,907.440 ↑ 1.0 1 747

Nested Loop (cost=493.83..495.88 rows=1 width=8) (actual time=77.516..77.520 rows=1 loops=747)

13. 1.494 57,892.500 ↓ 2.0 2 747

Unique (cost=493.41..493.42 rows=1 width=4) (actual time=77.499..77.500 rows=2 loops=747)

14. 2.988 57,891.006 ↓ 2.0 2 747

Sort (cost=493.41..493.41 rows=1 width=4) (actual time=77.497..77.498 rows=2 loops=747)

  • Sort Key: p.provider_id
  • Sort Method: quicksort Memory: 25kB
15. 1.494 57,888.018 ↓ 2.0 2 747

Subquery Scan on p (cost=493.38..493.40 rows=1 width=4) (actual time=77.491..77.494 rows=2 loops=747)

16. 1.494 57,886.524 ↓ 2.0 2 747

Limit (cost=493.38..493.39 rows=1 width=44) (actual time=77.490..77.492 rows=2 loops=747)

17. 26.145 57,885.030 ↓ 2.0 2 747

Sort (cost=493.38..493.39 rows=1 width=44) (actual time=77.490..77.490 rows=2 loops=747)

  • Sort Key: ((up.provider_geography_point <-> ppl.geography_point))
  • Sort Method: top-N heapsort Memory: 25kB
18. 194.220 57,858.885 ↓ 158.0 158 747

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

  • Group Key: ppl.provider_id, ppl.geography_point
19. 171.810 57,664.665 ↓ 158.0 158 747

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

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

Bitmap Heap Scan on plan_provider_locations ppl (cost=483.97..493.10 rows=1 width=36) (actual time=71.685..76.965 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,529.109 50,881.158 ↓ 0.0 0 747

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

22. 20,730.744 20,730.744 ↓ 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.752..27.752 rows=195,421 loops=747)

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

  • Index Cond: (up.specialty_ids && specialty_ids)
24. 12.159 12.159 ↓ 0.0 0 1,737

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

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

Hash (cost=1.91..1.91 rows=90 width=20) (actual time=0.038..0.038 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