ALB and glomerulonephritis: In contrast, glomerulonephritis as primary renal disease (HR: 0.42, 95% CI: 0.23–0.76, p = 0.004), serum albumin level (HR: 0.57, 95% CI: 0.39–0.84, p = 0.005) and eGFR at the time of the Mg2+ measurement (HR: 0.98, 95% CI: 0.97–0.99, p = 0.002) were associated with decreased risk of all-cause mortality.