Compared with regional anesthesia, general anesthesia may increase the risk of postoperative cognitive decline. This study aimed to investigate the type and severity of attentional network decline and the recovery of attentional networks in middle-aged women after gynecological surgery. A total of 140 consenting women undergoing elective gynecological surgery were enrolled in the study. Patients were assigned randomly to receive either total intravenous anesthesia or epidural anesthesia. To determine the efficacy of the attentional networks, patients were examined for alerting, orienting, and executive networks on the preoperative day and on the first and fifth postoperative days using the attentional network test. Significant differences were observed in the effect scores of the three attentional networks at all time points. These effect scores differed significantly between groups and between 1 and 5 days postoperation (DPO). Participants showed significantly lower effect scores for the alerting and orienting network tasks and had more difficulties in resolving conflict at 1 DPO compared with the baseline. On comparing effect scores between baseline and 5 DPO, no significant differences on the alerting and orienting network tasks were observed in the epidural anesthesia group, a significant difference on the orienting network task was observed in the general anesthesia group, and significant differences on the executive control network were observed in both the groups. Compared with epidural anesthesia, total intravenous anesthesia is more likely to impair and delay the recovery of attentional networks in middle-aged women undergoing elective hysterectomy. The executive control function showed marked damage and there were difficulties in recovery from either type of anesthesia.