explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 992d

Settings
# exclusive inclusive rows x rows loops node
1. 0.091 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. 0.168 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.150 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. 0.163 57.495 ↑ 41.4 85 1

Hash Left Join (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))
5. 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
6.          

SubPlan (for Index Scan)

7. 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)
8. 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
9. 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
10. 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
11. 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)

12. 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)
13. 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)

14. 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)

15. 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)

16. 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)

17. 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
18. 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)

19. 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
20. 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
21. 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
22. 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
23. 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)

24. 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))
25. 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)
26. 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