We theoretically analyze the dependence of second-harmonic generation efficiency on the group index in periodic optical waveguides with loss. We investigate different possible scenarios of using slow light to enhance the efficiency of this process and show that in some cases there exists a maximally achievable efficiency reached for finite values of the group index at the point of phase-matching. Furthermore, we identify situations for which slow light, surprisingly, does not enhance the second-harmonic generation efficiency. Our results are corroborated by rigorous nonlinear simulations of second-harmonic generation in periodic nanobeam waveguides with loss.