explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QeJ4

Settings
# exclusive inclusive rows x rows loops node
1. 0.419 15,662.299 ↑ 1.0 1 1

Aggregate (cost=161,391,027.24..161,391,027.25 rows=1 width=16) (actual time=15,662.299..15,662.299 rows=1 loops=1)

2. 0.801 15,661.880 ↑ 22.0 747 1

Hash Left Join (cost=41,971.98..161,390,903.81 rows=16,458 width=32) (actual time=111.315..15,661.880 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. 0.831 15,661.044 ↑ 22.0 747 1

Nested Loop Left Join (cost=41,968.49..161,389,685.15 rows=16,458 width=36) (actual time=111.275..15,661.044 rows=747 loops=1)

4. 0.574 103.938 ↑ 22.0 747 1

Hash Left Join (cost=32,164.85..40,847.76 rows=16,458 width=105) (actual time=50.896..103.938 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. 71.759 103.324 ↑ 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=50.819..103.324 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.565 31.565 ↑ 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.028..31.565 rows=81,368 loops=1)

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

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

Subquery Scan on rp (cost=9,803.64..9,803.66 rows=1 width=12) (actual time=20.825..20.825 rows=1 loops=747)

  • Filter: (up.id = rp.id)
11. 0.747 15,555.528 ↑ 1.0 1 747

Aggregate (cost=9,803.64..9,803.65 rows=1 width=12) (actual time=20.824..20.824 rows=1 loops=747)

12. 1.494 15,554.781 ↓ 2.0 2 747

Limit (cost=9,329.46..9,803.62 rows=1 width=8) (actual time=20.798..20.823 rows=2 loops=747)

13. 13.513 15,553.287 ↓ 2.0 2 747

Nested Loop (cost=9,329.46..9,803.62 rows=1 width=8) (actual time=20.797..20.821 rows=2 loops=747)

14. 10.458 15,464.394 ↑ 4.0 50 747

Unique (cost=9,329.04..9,335.12 rows=200 width=4) (actual time=20.683..20.702 rows=50 loops=747)

15. 29.880 15,453.936 ↑ 17.6 69 747

Sort (cost=9,329.04..9,332.08 rows=1,216 width=4) (actual time=20.682..20.688 rows=69 loops=747)

  • Sort Key: p.provider_id
  • Sort Method: quicksort Memory: 35kB
16. 20.169 15,424.056 ↑ 7.7 158 747

Subquery Scan on p (cost=9,251.54..9,266.74 rows=1,216 width=4) (actual time=20.609..20.648 rows=158 loops=747)

17. 44.073 15,403.887 ↑ 7.7 158 747

Sort (cost=9,251.54..9,254.58 rows=1,216 width=44) (actual time=20.608..20.621 rows=158 loops=747)

  • Sort Key: ((up.provider_geography_point <-> pl.geography_point))
  • Sort Method: quicksort Memory: 42kB
18. 194.967 15,359.814 ↑ 7.7 158 747

Group (cost=8,876.11..9,189.23 rows=1,216 width=44) (actual time=20.290..20.562 rows=158 loops=747)

  • Group Key: plsp.provider_id, pl.geography_point
19. 80.676 15,164.847 ↑ 7.6 161 747

Sort (cost=8,876.11..8,879.15 rows=1,216 width=36) (actual time=20.287..20.301 rows=161 loops=747)

  • Sort Key: plsp.provider_id, pl.geography_point
  • Sort Method: quicksort Memory: 47kB
20. 1,738.302 15,084.171 ↑ 7.6 161 747

Nested Loop (cost=0.84..8,813.80 rows=1,216 width=36) (actual time=0.629..20.193 rows=161 loops=747)

21. 490.779 490.779 ↑ 1.1 3,442 747

Index Only Scan using ix_plsp_shafjac_temp on provider_location_specialty_plans plsp (cost=0.42..88.02 rows=3,647 width=8) (actual time=0.005..0.657 rows=3,442 loops=747)

  • Index Cond: (specialty_id = ANY (up.specialty_ids))
  • Heap Fetches: 0
22. 12,855.090 12,855.090 ↓ 0.0 0 2,571,018

Index Scan using provider_locations_pkey on provider_locations pl (cost=0.42..2.39 rows=1 width=36) (actual time=0.005..0.005 rows=0 loops=2,571,018)

  • Index Cond: (id = plsp.provider_location_id)
  • 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: 1
23. 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))
24. 0.014 0.035 ↑ 3.9 23 1

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

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

  • Filter: (procedure_code IS NULL)
  • Rows Removed by Filter: 1
Planning time : 28.977 ms
Execution time : 15,665.517 ms