explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RDAx

Settings
# exclusive inclusive rows x rows loops node
1. 0.718 57,897.274 ↑ 1.0 1 1

Aggregate (cost=8,202,744.24..8,202,744.25 rows=1 width=16) (actual time=57,897.274..57,897.274 rows=1 loops=1)

2. 1.435 57,896.556 ↑ 22.0 747 1

Hash Left Join (cost=32,664.24..8,202,620.82 rows=16,455 width=32) (actual time=65.588..57,896.556 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.650 57,895.085 ↑ 22.0 747 1

Nested Loop Left Join (cost=32,660.75..8,201,402.39 rows=16,455 width=36) (actual time=65.547..57,895.085 rows=747 loops=1)

4. 0.924 108.503 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.08 rows=16,455 width=105) (actual time=51.384..108.503 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.682 107.539 ↑ 22.0 747 1

Index Scan using utilization_procedures_pkey on utilization_procedures up (cost=32,161.12..39,362.39 rows=16,455 width=97) (actual time=51.305..107.539 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.857 31.857 ↑ 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.029..31.857 rows=81,368 loops=1)

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

Hash (cost=1.91..1.91 rows=91 width=26) (actual time=0.040..0.040 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 57,784.932 ↑ 1.0 1 747

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

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

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

12. 2.241 57,782.691 ↓ 2.0 2 747

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

13. 31.493 57,780.450 ↓ 2.0 2 747

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

14. 10.458 57,673.629 ↓ 50.0 50 747

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

15. 30.627 57,663.171 ↓ 69.0 69 747

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

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

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

17. 44.073 57,612.375 ↓ 158.0 158 747

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

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

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

  • Group Key: ppl.provider_id, ppl.geography_point
19. 168.822 57,375.576 ↓ 158.0 158 747

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

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

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

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

22. 20,614.212 20,614.212 ↓ 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.596..27.596 rows=195,421 loops=747)

  • Index Cond: (geography_point && _st_expand(up.provider_geography_point, '8046.72'::double precision))
23. 28,496.556 28,496.556 ↓ 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.148..38.148 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.036 ↑ 3.9 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
26. 0.020 0.020 ↑ 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.020 rows=90 loops=1)

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
Planning time : 5.216 ms
Execution time : 57,898.656 ms