In hexagonal close-packed metals, c/a ratio is an important factor which has a strongly correlated with many properties. In this paper, we used the ab initio method to do high-throughput calculations on c/a ratio in magnesium alloys, the results indicate that there is a periodic effect of metallic alloying elements on the lattice parameters and c/a ratio at the macro and micro level. And with the addition of some alloying elements, such as V, Cr, Nb, etc., there is the similar effect at the macro and micro level. Some alloying elements will make the geometrical distortion is remarkably larger at the micro level than macro level, such as Li, Si, Ca, etc. For the alloying elements Be, Al, Cr, etc., there is the opposite distortion at the macro and micro level. This work can solve some questions from experiments.