explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bH39

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 11,349.680 ↓ 0.0 0 1

Insert on data (cost=126,667.33..150,691.25 rows=1 width=12) (actual time=11,349.680..11,349.680 rows=0 loops=1)

2. 11,300.693 11,300.693 ↓ 20,142.0 20,142 1

Hash Left Join (cost=126,667.33..150,691.25 rows=1 width=12) (actual time=7,809.608..11,300.693 rows=20,142 loops=1)

3. 11,274.958 11,274.958 ↓ 20,142.0 20,142 1

Nested Loop (cost=126,592.78..150,616.46 rows=1 width=20) (actual time=7,803.770..11,274.958 rows=20,142 loops=1)

4. 11,213.535 11,213.535 ↓ 20,142.0 20,142 1

Nested Loop (cost=126,592.51..150,616.04 rows=1 width=24) (actual time=7,803.759..11,213.535 rows=20,142 loops=1)

5. 11,070.242 11,070.242 ↓ 60,700.0 60,700 1

Nested Loop (cost=126,592.36..150,615.82 rows=1 width=28) (actual time=7,798.952..11,070.242 rows=60,700 loops=1)

6. 10,895.510 10,895.510 ↓ 60,700.0 60,700 1

Nested Loop (cost=126,592.09..150,615.52 rows=1 width=24) (actual time=7,798.940..10,895.510 rows=60,700 loops=1)

7. 10,722.475 10,722.475 ↓ 60,735.0 60,735 1

Nested Loop (cost=126,591.81..150,615.21 rows=1 width=28) (actual time=7,798.378..10,722.475 rows=60,735 loops=1)

8. 9,198.991 9,198.991 ↓ 60,736.0 60,736 1

Nested Loop (cost=126,591.38..150,614.70 rows=1 width=32) (actual time=7,798.359..9,198.991 rows=60,736 loops=1)

9. 8,479.595 8,479.595 ↓ 11.3 60,736 1

Hash Join (cost=126,590.96..147,824.07 rows=5,388 width=28) (actual time=7,798.327..8,479.595 rows=60,736 loops=1)

10. 7,741.871 7,741.871 ↓ 11.3 60,736 1

Hash Join (cost=99,479.02..117,320.62 rows=5,379 width=28) (actual time=7,252.456..7,741.871 rows=60,736 loops=1)

11. 216.543 216.543 ↑ 1.0 635,223 1

Seq Scan on residentinfo ri (cost=0.00..14,609.54 rows=635,654 width=4) (actual time=0.012..216.543 rows=635,223 loops=1)

12. 7,252.298 7,252.298 ↓ 11.3 60,736 1

Hash (cost=99,411.78..99,411.78 rows=5,379 width=24) (actual time=7,252.298..7,252.298 rows=60,736 loops=1)

13. 7,215.818 7,215.818 ↓ 11.3 60,736 1

Nested Loop (cost=42,669.74..99,411.78 rows=5,379 width=24) (actual time=2,222.107..7,215.818 rows=60,736 loops=1)

14. 3,143.207 3,143.207 ↓ 11.3 60,736 1

Merge Join (cost=42,669.32..96,611.18 rows=5,379 width=24) (actual time=2,220.980..3,143.207 rows=60,736 loops=1)

15. 1,666.655 1,666.655 ↑ 1.0 1,165,731 1

Index Scan using ix_patientcase_pk on patientcase pc (cost=0.43..50,407.85 rows=1,167,096 width=24) (actual time=0.020..1,666.655 rows=1,165,731 loops=1)

16. 1,161.859 1,161.859 ↓ 1.3 60,973 1

Sort (cost=42,668.86..42,785.42 rows=46,623 width=24) (actual time=1,138.334..1,161.859 rows=60,973 loops=1)

17. 1,083.780 1,083.780 ↓ 1.3 60,973 1

Seq Scan on casepayerset cps (cost=0.00..39,053.54 rows=46,623 width=24) (actual time=688.564..1,083.780 rows=60,973 loops=1)

18. 4,008.576 4,008.576 ↑ 1.0 1 60,736

Index Scan using ix_stay_pk on stay s (cost=0.42..0.51 rows=1 width=8) (actual time=0.066..0.066 rows=1 loops=60,736)

19. 539.513 539.513 ↑ 1.0 744,420 1

Hash (cost=14,874.64..14,874.64 rows=745,864 width=8) (actual time=539.513..539.513 rows=744,420 loops=1)

20. 256.158 256.158 ↑ 1.0 744,420 1

Seq Scan on residentpayersequence rps (cost=0.00..14,874.64 rows=745,864 width=8) (actual time=0.015..256.158 rows=744,420 loops=1)

21. 668.096 668.096 ↑ 1.0 1 60,736

Index Scan using ix_residentpayer_pk on residentpayer rp (cost=0.42..0.51 rows=1 width=12) (actual time=0.010..0.011 rows=1 loops=60,736)

22. 1,457.664 1,457.664 ↑ 1.0 1 60,736

Index Scan using ix_resident_pk on resident r (cost=0.42..0.50 rows=1 width=8) (actual time=0.024..0.024 rows=1 loops=60,736)

23. 121.470 121.470 ↑ 1.0 1 60,735

Index Only Scan using ix_facility_pk on facility f (cost=0.28..0.30 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=60,735)

24. 121.400 121.400 ↑ 1.0 1 60,700

Index Scan using ix_payerpayertype_pk on payerpayertype ppt (cost=0.28..0.29 rows=1 width=12) (actual time=0.001..0.002 rows=1 loops=60,700)

25. 121.400 121.400 ↓ 0.0 0 60,700

Index Scan using ix_payertype_pk on payertype pt (cost=0.14..0.21 rows=1 width=4) (actual time=0.001..0.002 rows=0 loops=60,700)

26. 40.284 40.284 ↑ 1.0 1 20,142

Index Only Scan using ix_payer_pk on payer p (cost=0.28..0.40 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=20,142)

27. 5.810 5.810 ↓ 2.9 5,243 1

Hash (cost=52.02..52.02 rows=1,802 width=8) (actual time=5.810..5.810 rows=5,243 loops=1)

28. 4.146 4.146 ↓ 2.9 5,243 1

Seq Scan on ard_optima a (cost=0.00..52.02 rows=1,802 width=8) (actual time=0.015..4.146 rows=5,243 loops=1)

Planning time : 13.336 ms
Execution time : 11,350.300 ms