This paper addresses the well-known dynamic berth allocation problem (DBAP), which finds numerous applications at container terminals aiming to allocate and schedule incoming container vessels into berthing positions along the quay. Due to its impact on ports’ performance, having efficient DBAP formulations is of great importance, especially for determining optimal schedules in quick time as well as aiding managers and developers in the assessment of solution strategies and approximate approaches. In this work, we propose two novel formulations, a time-indexed formulation and an arc-flow one, to efficiently tackle the DBAP. Additionally, to improve computational performance, we propose problem-based modeling enhancements and a variable-fixing procedure that allows to discard some variables by considering their reduced costs. By means of these contributions, we improve the models’ performance for those instances where the optimal solutions were already known, and we solve to optimality for the first time other instances from the literature.