explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7mGe

Settings
# exclusive inclusive rows x rows loops node
1. 0.737 36,566.270 ↑ 1.0 1 1

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

2. 1.470 36,565.533 ↑ 22.0 747 1

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

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

4. 0.850 112.818 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=52.379..112.818 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. 79.917 111.926 ↑ 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.294..111.926 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.009 32.009 ↑ 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.032..32.009 rows=81,368 loops=1)

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

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

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

10. 0.747 36,449.865 ↑ 1.0 1 747

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

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

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

12. 1.494 36,446.877 ↓ 2.0 2 747

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

13. 29.947 36,445.383 ↓ 2.0 2 747

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

14. 10.458 36,340.056 ↑ 4.0 50 747

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

15. 29.880 36,329.598 ↑ 4.0 69 747

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

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

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

17. 43.326 36,279.549 ↑ 1.7 158 747

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

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

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

  • Group Key: ppl.provider_id, ppl.geography_point
19. 141.183 36,042.003 ↑ 1.7 158 747

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

  • Sort Key: ppl.provider_id, ppl.geography_point
  • Sort Method: quicksort Memory: 42kB
20. 3,450.393 35,900.820 ↑ 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.891..48.060 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,703.160 32,450.427 ↓ 0.0 0 747

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

22. 28,452.483 28,452.483 ↓ 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.089..38.089 rows=275,969 loops=747)

  • Index Cond: (up.specialty_ids && specialty_ids)
23. 2,294.784 2,294.784 ↑ 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.072..3.072 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.012 0.034 ↑ 3.9 23 1

Hash (cost=1.91..1.91 rows=90 width=20) (actual time=0.034..0.034 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.326 ms
Execution time : 36,570.028 ms