Results showed that postoperative insomnia was an independent risk factor for CPSP (OR = 2.63, 95%CI: 1.22–5.66, p = 0.014), indicating a significantly increased risk in patients with postoperative insomnia; BMI was a protective factor (OR = 0.87, 95%CI: 0.79–0.96, p = 0.007), with each 1-unit increase in BMI associated with a 13% reduction in CPSP risk; preoperative FSH level was also a protective factor (OR = 0.98, 95% CI: 0.96–0.99, p = 0.001). This evidence concerns the gene BRD2 and insomnia.