Optimal $L^{2}$ estimate for harmonic functions