Optimal compact scheme for the advection-diffusion equation