The interest in model predictive control (MPC) for buildings has grown in recent years due to the widespread implementation of dynamic electricity tariffs, energy flexibility and distributed energy resources. The MPC applied on buildings is a computational-based methodology used to optimize the performance of heating, ventilation and air conditioning systems (HVAC) by predicting the energy behavior and minimizing a specific cost function in a determined forecasting horizon. The forecasting horizon is one of the critical parameters in MPC design applied in buildings; it should be long enough to activate the buildings’ flexibility potential, but the computational resources grow exponentially with the horizon increase, which could difficult the real-time operation. Furthermore, long periods of non-occupancy, holidays or abrupt comfort-bound changes can significantly affect the optimal forecasting time horizon length. Unfortunately, very few studies have focused on ascertaining this key optimization process aspect. The contribution of this research paper is to demonstrate, through an innovative methodology, that the optimal horizon length can be dynamically updated according to the effects of building inertia. This methodology is validated by assessing the reduction of the economic costs of a space heating system based on a synthetic representation of an experimental building placed in Germany.