Abstract A 3D three-phase segmentally variable density perforation optimization model for horizontal wells is built by coupling reservoir fluid filtration, near wellbore inflow and wellbore conduit flow based on reservoir numerical simulation. The effects of 8 factors (filtration difference between heel/toe and middle intervals, imperforated interval, permeability heterogeneity, oil layer thickness heterogeneity, porosity heterogeneity, wellbore pressure drawdown, maximum perforation density, and perforation optimization principles) on perforation density and inflow profile, and that of fluid viscosity, casing diameter and pipe wall coarseness on well bore pressure drawdown, are analyzed for segmentally variable density perforation of horizontal wells. Results show that filtration difference between heel/toe and middle intervals, imperforated interval, permeability heterogeneity and oil layer thickness heterogeneity have significant effects on segmentally variable density perforation. In particular, different perforation density optimizations may occur when filtration difference between heel/toe and middle interval is not considered; imperforated interval may affect inflow profile; well bore pressure drawdown can be ruled out for segmentally variable density perforation of most horizontal wells onshore in China. The contrast between predicted and actual production of Well AT9-7H in the Tahe Oilfield indicates that the model is highly accurate.