As landscape photographers, we are always desperate to have the best sharpness and depth of field, best of both worlds. Well, I am afraid that sometimes we have to compromise things. Stopping down the lens to a smaller aperture (ie larger number) in order to achieve as much depth of field as we can, not always produces great results. I will not get into technical jargon but will try to keep my explanation as simple to understand as possible.
I have seen a lot of people shooting landscapes and the aperture dial is always stuck at f/22, no matter the situation. All but the very best and highly expensive lenses, would give you maximum quality image when stopped down by 1 or 2 stops. So, a lens with maximum aperture of f/5.6 will probably give you best results between f/8-f/11. From this point on (f/11), if you continue reducing the aperture size (f/16-f/22), diffraction will start and image quality will be reduced.
When light passes through a lens, the diaphragm blades disperse and diffract the light. Even at large apertures the light passing through is diffracted but in a very small percentage, which does not really affect image quality. As you close down the aperture blades, that percentage is being increased all the time and eventually, at smaller apertures the diffraction is in such a high percentage that image quality suffers.
Now, the smaller the sensor the worst the results are when it comes to image quality and small apertures. You must have noticed that compact digital cameras usually come with an aperture no smaller than f/8, diffraction is one of the reasons, extreme depth of field due to small sensor size is the other; the smaller the sensor, the less the need for a very small aperture, here is a rough example. On a compact camera, f/8 aperture is the equivalent of f/22 on a full frame sensor (depth of field wise). So, on a camera with an APS-C sensor, f/11 aperture is the equivalent of f/16 on a full frame.
So, what is best to do? We need small apertures to cover depth of field in landscape work. Well, here are some suggestions.
a. Check all your lenses indoors (controlled environment) to find out at what aperture the diffraction is harsh.
b. Make sure your focusing technique is spot on for best depth of field results.
c. You can buy a tilt/shift lens (how to use a tilt/shift lens).
d. Learn how to properly use your live view if your camera offers it, this will improve your focusing technique. Full guide on how to use "Live View" can be found inside our "Beginner's Guide" ebook.
e. start with a larger (f/8) aperture while focusing and keep checking the results, then stop down if you need to.
In a nutshell, I would recommend to keep the aperture not smaller than f/13 when you are using a DSLR with small (APS-C) sensor or f/16 when using a full frame sensor.