explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7BxY

Settings
# exclusive inclusive rows x rows loops node
1. 6.008 23,920.304 ↓ 14.9 832 1

Nested Loop (cost=3,254,253.68..3,472,691.86 rows=56 width=307) (actual time=6,116.979..23,920.304 rows=832 loops=1)

  • Join Filter: (up.place_of_service_id = pos.id)
  • Rows Removed by Join Filter: 8,284
2.          

CTE ranked_providers

3. 84.308 6,324.461 ↓ 192,621.0 192,621 1

WindowAgg (cost=3,254,249.68..3,254,250.22 rows=1 width=104) (actual time=6,080.320..6,324.461 rows=192,621 loops=1)

4. 134.947 6,240.153 ↓ 192,621.0 192,621 1

WindowAgg (cost=3,254,249.68..3,254,249.96 rows=1 width=96) (actual time=6,080.300..6,240.153 rows=192,621 loops=1)

5. 176.266 6,105.206 ↓ 192,621.0 192,621 1

Sort (cost=3,254,249.68..3,254,249.69 rows=1 width=88) (actual time=6,080.279..6,105.206 rows=192,621 loops=1)

  • Sort Key: up_1.id, ((up_1.provider_geography_point <-> urp.provider_geography_point)), urp.provider_id
  • Sort Method: quicksort Memory: 33,232kB
6. 301.036 5,928.940 ↓ 192,621.0 192,621 1

GroupAggregate (cost=3,254,249.39..3,254,249.67 rows=1 width=88) (actual time=5,609.384..5,928.940 rows=192,621 loops=1)

  • Group Key: up_1.id, urp.provider_id, up_1.provider_geography_point, urp.provider_geography_point
7. 128.915 5,627.904 ↓ 193,959.0 193,959 1

Sort (cost=3,254,249.39..3,254,249.39 rows=1 width=84) (actual time=5,609.089..5,627.904 rows=193,959 loops=1)

  • Sort Key: up_1.id, urp.provider_id, up_1.provider_geography_point, urp.provider_geography_point
  • Sort Method: quicksort Memory: 33,420kB
8. 3,077.877 5,498.989 ↓ 193,959.0 193,959 1

Merge Join (cost=240,724.47..3,254,249.38 rows=1 width=84) (actual time=1,756.250..5,498.989 rows=193,959 loops=1)

  • Merge Cond: (((up_1.procedure_code)::text = (urp.procedure_code)::text) AND (up_1.place_of_service_id = urp.place_of_service_id) AND (up_1.claim_type_id = urp.claim_type_id) AND (up_1.member_category_id = urp.member_category_id))
  • Join Filter: ((urp.provider_id <> up_1.provider_id) AND (urp.specialty_ids && up_1.specialty_ids) AND (up_1.provider_geography_point && _st_expand(urp.provider_geography_point, '24140.16'::double precision)) AND (urp.provider_geography_point && _st_expand(up_1.provider_geography_point, '24140.16'::double precision)) AND _st_dwithin(up_1.provider_geography_point, urp.provider_geography_point, '24140.16'::double precision, true))
  • Rows Removed by Join Filter: 8,512,143
9. 3.080 3.962 ↑ 1.0 3,843 1

Sort (cost=399.24..408.85 rows=3,843 width=90) (actual time=3.507..3.962 rows=3,843 loops=1)

  • Sort Key: up_1.procedure_code, up_1.place_of_service_id, up_1.claim_type_id, up_1.member_category_id
  • Sort Method: quicksort Memory: 637kB
10. 0.882 0.882 ↑ 1.0 3,843 1

Seq Scan on utilization_procedures_non_par up_1 (cost=0.00..170.43 rows=3,843 width=90) (actual time=0.004..0.882 rows=3,843 loops=1)

11. 1,356.965 2,417.150 ↓ 17.5 9,157,887 1

Sort (cost=240,158.26..241,470.27 rows=524,805 width=86) (actual time=1,748.989..2,417.150 rows=9,157,887 loops=1)

  • Sort Key: urp.procedure_code, urp.place_of_service_id, urp.claim_type_id, urp.member_category_id
  • Sort Method: quicksort Memory: 102,650kB
12. 91.510 1,060.185 ↓ 1.1 573,917 1

Subquery Scan on urp (cost=121,588.05..190,298.05 rows=524,805 width=86) (actual time=772.586..1,060.185 rows=573,917 loops=1)

13. 205.561 968.675 ↓ 1.1 573,917 1

Gather Merge (cost=121,588.05..185,050.00 rows=524,805 width=86) (actual time=772.584..968.675 rows=573,917 loops=1)

  • Workers Planned: 5
  • Workers Launched: 5
14. 238.975 763.114 ↑ 1.1 95,653 6 / 6

Sort (cost=120,587.98..120,850.38 rows=104,961 width=86) (actual time=747.502..763.114 rows=95,653 loops=6)

  • Sort Key: urp_1.member_category_id, urp_1.claim_type_id, urp_1.procedure_code
  • Sort Method: quicksort Memory: 17,979kB
  • Worker 0: Sort Method: quicksort Memory: 15,920kB
  • Worker 1: Sort Method: quicksort Memory: 15,897kB
  • Worker 2: Sort Method: quicksort Memory: 16,010kB
  • Worker 3: Sort Method: quicksort Memory: 16,577kB
  • Worker 4: Sort Method: quicksort Memory: 16,759kB
15. 524.139 524.139 ↑ 1.1 95,653 6 / 6

Parallel Seq Scan on utilization_reprice_procedures urp_1 (cost=0.00..111,834.49 rows=104,961 width=86) (actual time=0.106..524.139 rows=95,653 loops=6)

  • Filter: ((provider_id IS NOT NULL) AND (cost_type_id = 2) AND (68870 = ANY (base_network_ids)))
  • Rows Removed by Filter: 609,796
16. 284.115 23,913.464 ↓ 14.9 832 1

Nested Loop (cost=3.45..218,421.99 rows=56 width=363) (actual time=6,116.906..23,913.464 rows=832 loops=1)

  • Join Filter: (up.id = rp.id)
  • Rows Removed by Join Filter: 2,811,648
17. 6,382.229 6,382.229 ↓ 440.0 440 1

CTE Scan on ranked_providers rp (cost=0.00..0.03 rows=1 width=20) (actual time=6,080.393..6,382.229 rows=440 loops=1)

  • Filter: (("row" <= 2) AND (provider_id = 700,366))
  • Rows Removed by Filter: 192,181
18. 865.020 17,247.120 ↑ 33.4 6,392 440

Hash Join (cost=3.45..215,754.75 rows=213,377 width=355) (actual time=0.029..39.198 rows=6,392 loops=440)

  • Hash Cond: (up.member_category_id = mc.id)
19. 1,132.560 16,382.080 ↑ 33.4 6,392 440

Nested Loop (cost=2.41..214,006.69 rows=213,377 width=351) (actual time=0.029..37.232 rows=6,392 loops=440)

20. 895.840 8,485.840 ↑ 1.0 3,843 440

Nested Loop (cost=1.97..18,491.19 rows=3,843 width=221) (actual time=0.019..19.286 rows=3,843 loops=440)

  • Join Filter: (up.member_type_id = mt.id)
  • Rows Removed by Join Filter: 2,212
21. 558.790 7,590.000 ↑ 1.0 3,843 440

Hash Join (cost=1.97..18,294.16 rows=3,843 width=218) (actual time=0.018..17.250 rows=3,843 loops=440)

  • Hash Cond: (up.cost_type_id = costs.id)
22. 1,041.920 7,031.200 ↑ 1.0 3,843 440

Nested Loop (cost=0.86..18,274.40 rows=3,843 width=214) (actual time=0.018..15.980 rows=3,843 loops=440)

  • Join Filter: (up.claim_type_id = claims.id)
  • Rows Removed by Join Filter: 3,843
23. 1,149.280 5,989.280 ↑ 1.0 3,843 440

Nested Loop (cost=0.86..18,177.31 rows=3,843 width=205) (actual time=0.017..13.612 rows=3,843 loops=440)

24. 1,246.080 3,149.080 ↑ 1.0 3,843 440

Nested Loop (cost=0.43..9,003.57 rows=3,843 width=146) (actual time=0.010..7.157 rows=3,843 loops=440)

25. 212.080 212.080 ↑ 1.0 3,843 440

Seq Scan on utilization_procedures_non_par up (cost=0.00..170.43 rows=3,843 width=68) (actual time=0.001..0.482 rows=3,843 loops=440)

26. 1,690.920 1,690.920 ↑ 1.0 1 1,690,920

Index Scan using providers_pkey on providers p (cost=0.43..2.30 rows=1 width=82) (actual time=0.001..0.001 rows=1 loops=1,690,920)

  • Index Cond: (id = up.provider_id)
27. 1,690.920 1,690.920 ↑ 1.0 1 1,690,920

Index Scan using provider_locations_pkey on provider_locations pl (cost=0.43..2.39 rows=1 width=67) (actual time=0.001..0.001 rows=1 loops=1,690,920)

  • Index Cond: (id = up.provider_primary_location_id)
28. 0.000 0.000 ↑ 1.0 2 1,690,920

Materialize (cost=0.00..1.03 rows=2 width=17) (actual time=0.000..0.000 rows=2 loops=1,690,920)

29. 0.007 0.007 ↑ 1.0 2 1

Seq Scan on utilization_claim_types claims (cost=0.00..1.02 rows=2 width=17) (actual time=0.007..0.007 rows=2 loops=1)

30. 0.004 0.010 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=12) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
31. 0.006 0.006 ↑ 1.0 5 1

Seq Scan on utilization_cost_types costs (cost=0.00..1.05 rows=5 width=12) (actual time=0.005..0.006 rows=5 loops=1)

32. 0.000 0.000 ↑ 2.0 2 1,690,920

Materialize (cost=0.00..1.06 rows=4 width=11) (actual time=0.000..0.000 rows=2 loops=1,690,920)

33. 0.005 0.005 ↑ 1.3 3 1

Seq Scan on utilization_member_types mt (cost=0.00..1.04 rows=4 width=11) (actual time=0.005..0.005 rows=3 loops=1)

34. 6,763.680 6,763.680 ↑ 28.0 2 1,690,920

Index Scan using ix_utilization_procedure_details_proc_id on utilization_procedure_details upd (cost=0.44..50.32 rows=56 width=130) (actual time=0.003..0.004 rows=2 loops=1,690,920)

  • Index Cond: (utilization_procedure_id = up.id)
35. 0.004 0.020 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=12) (actual time=0.020..0.020 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
36. 0.016 0.016 ↑ 1.0 2 1

Seq Scan on utilization_member_categories mc (cost=0.00..1.02 rows=2 width=12) (actual time=0.015..0.016 rows=2 loops=1)

37. 0.823 0.832 ↑ 1.7 11 832

Materialize (cost=0.00..1.28 rows=19 width=19) (actual time=0.000..0.001 rows=11 loops=832)

38. 0.009 0.009 ↑ 1.7 11 1

Seq Scan on utilization_place_of_services pos (cost=0.00..1.19 rows=19 width=19) (actual time=0.007..0.009 rows=11 loops=1)

Planning time : 10.299 ms
Execution time : 23,936.257 ms