There was disagreement over the best time to repair a postinfarction ventricular septal defect (PI-VSD). Using the proper International Classification of Diseases, Ninth and Tenth Revision Procedure Coding System Codes, ventricular septal defects (VSD) repair was located. Cardiogenic shock (CS) and time of repair from admission were used to stepwise stratify the data to produce 6 clinically meaningful groups, including shock 1 (CS; 0 to 7 days), shock 2 (CS; 8 to 14 days), and shock 3 (CS; >14 days). The classification of non-shock groups was comparable. In-hospital mortality was the main result. For each group, multilevel hierarchical logistic regression was performed to account for confounders. About 10,902 cases with PI-VSD were found. When compared to no VSD repair in shock 1 (n=5,794), VSD repair had a lower death rate (OR 0.76; 95% CI 0.68 to 0.86, P<0.001). Among shock 2 (n=1,009), mortality was numerically reduced but not statistically different in those who got VSD repair. In shock 3 (n=483), mortality was numerically greater but not statistically different among those who got VSD repair. VSD repair was linked to greater mortality in nonshock 1 (n=5,108) (odds ratio [OR] 1.59; 95% CI 1.33 to 1.90; P<0.001). Mortality was numerically greater in patients having VSD repair in non-shock 2 (n=1,265), albeit there was no statistically significant difference. Patients with VSD repair had numerically lower mortality in non-shock 3 (n=472), albeit there was no statistically significant difference. Over the 16 years, more patients with PI-VSD need mechanical circulatory support (relative change + 18%, P<0.001), but mortality did not change significantly. In conclusion, early PI-VSD repair decreased mortality in CS patients. However, early PI-VSD repair was linked to greater mortality in patients without CS.