The combination of the “2 + 1” phase-shifting algorithm with temporal phase unwrapping (TPU) not only facilitates the acquisition of phase information using fewer fringe patterns but also minimizes errors resulting from motion in the 3-step phase-shifting profilometry (PSP). By considering the influence of fringe frequency sequences on measurement accuracy, we derive the noise-induced wrapped phase error and its variance of the “2 + 1” phase-shifting algorithm and further analyze the phase unwrapping accuracy at each stage of the “2 + 1 + 2 + 2” algorithm. Consequently, a method for selecting the optimal fringe frequency sequence is introduced, ensuring that the phase unwrapping accuracy in both stages remains as consistent as possible, while the effectiveness of this method is experimentally validated. The experimental results demonstrate that the method for selecting the optimal fringe frequency is applicable to both hierarchical and heterodyne TPU and aligns well with theoretical analysis. Compared to two sets of non-optimal frequency sequences, the error rates of the optimal fringe frequency sequences are reduced by 33.41% and 72.53%, respectively.